Rake command not working while trying to read email from gmail server using IMAP - apache

I am running below rake command to read email using IMAP from use_redmine.bat
in which my working directory is \Bitnami\redmine-3.3.3-1\apps\redmine\htdocs>
and the command is
rake redmine:email:receive_imap RAILS_ENV="production" host=imap.gmail.com \
port=993 username=xxxx password=xxxx ssl=1 tracker=feature unknown_user=accept \
allow_override=all --trace
Note:
It is working in my local system and I am successfully able to create feature and bug from email conduit. But not working on the server(another system).
Things I have tried:
Disabled firewall on the server in case if it is blocking.
Disabled antivirus on the server in case if it is blocking.
Installed the same setup in both machine local and the server.
Installed the same setup with the same windows version.
Followed the same setup steps in both machine local and the server like.
-Installing bitnami-redmine-3.3.3-1-windows-installer.exe.
-running bundle install.
-running bundle install --no-deployment.
-running rake command.
Also, have checked that port is listening by net sh command.
**Output of the command:**
** Invoke redmine:email:receive_imap (first_time)
** Invoke environment (first_time)
** Execute environment
** Execute redmine:email:receive_imap
rake aborted!
OpenSSL::SSL::SSLError: SSL_connect SYSCALL returned=5 errno=0 state=SSLv2/v3 read server hello A
C:/Bitnami/redmine-3.3.3-1/ruby/lib/ruby/2.3.0/net/imap.rb:1492:in `connect'
C:/Bitnami/redmine-3.3.3-1/ruby/lib/ruby/2.3.0/net/imap.rb:1492:in `start_tls_session'
C:/Bitnami/redmine-3.3.3-1/ruby/lib/ruby/2.3.0/net/imap.rb:1085:in `initialize'
C:/Bitnami/redmine-3.3.3-1/apps/redmine/htdocs/lib/redmine/imap.rb:30:in `new'
C:/Bitnami/redmine-3.3.3-1/apps/redmine/htdocs/lib/redmine/imap.rb:30:in `check'
C:/Bitnami/redmine-3.3.3-1/apps/redmine/htdocs/lib/tasks/email.rake:117:in `block (4 levels) in <top (required)>'
C:/Bitnami/redmine-3.3.3-1/apps/redmine/htdocs/app/models/mailer.rb:430:in `with_synched_deliveries'
C:/Bitnami/redmine-3.3.3-1/apps/redmine/htdocs/lib/tasks/email.rake:116:in `block (3 levels) in <top (required)>'
C:/Bitnami/redmine-3.3.3-1/ruby/lib/ruby/gems/2.3.0/gems/rake-12.0.0/lib/rake/task.rb:250:in `block in execute'
C:/Bitnami/redmine-3.3.3-1/ruby/lib/ruby/gems/2.3.0/gems/rake-12.0.0/lib/rake/task.rb:250:in `each'
C:/Bitnami/redmine-3.3.3-1/ruby/lib/ruby/gems/2.3.0/gems/rake-12.0.0/lib/rake/task.rb:250:in `execute'
C:/Bitnami/redmine-3.3.3-1/ruby/lib/ruby/gems/2.3.0/gems/rake-12.0.0/lib/rake/task.rb:194:in `block in invoke_with_call_chain'
C:/Bitnami/redmine-3.3.3-1/ruby/lib/ruby/2.3.0/monitor.rb:214:in `mon_synchronize'
C:/Bitnami/redmine-3.3.3-1/ruby/lib/ruby/gems/2.3.0/gems/rake-12.0.0/lib/rake/task.rb:187:in `invoke_with_call_chain'
C:/Bitnami/redmine-3.3.3-1/ruby/lib/ruby/gems/2.3.0/gems/rake-12.0.0/lib/rake/task.rb:180:in `invoke'
C:/Bitnami/redmine-3.3.3-1/ruby/lib/ruby/gems/2.3.0/gems/rake-12.0.0/lib/rake/application.rb:152:in `invoke_task'
C:/Bitnami/redmine-3.3.3-1/ruby/lib/ruby/gems/2.3.0/gems/rake-12.0.0/lib/rake/application.rb:108:in `block (2 levels) in top_level'
C:/Bitnami/redmine-3.3.3-1/ruby/lib/ruby/gems/2.3.0/gems/rake-12.0.0/lib/rake/application.rb:108:in `each'
C:/Bitnami/redmine-3.3.3-1/ruby/lib/ruby/gems/2.3.0/gems/rake-12.0.0/lib/rake/application.rb:108:in `block in top_level'
C:/Bitnami/redmine-3.3.3-1/ruby/lib/ruby/gems/2.3.0/gems/rake-12.0.0/lib/rake/application.rb:117:in `run_with_threads'
C:/Bitnami/redmine-3.3.3-1/ruby/lib/ruby/gems/2.3.0/gems/rake-12.0.0/lib/rake/application.rb:102:in `top_level'
C:/Bitnami/redmine-3.3.3-1/ruby/lib/ruby/gems/2.3.0/gems/rake-12.0.0/lib/rake/application.rb:80:in `block in run'
C:/Bitnami/redmine-3.3.3-1/ruby/lib/ruby/gems/2.3.0/gems/rake-12.0.0/lib/rake/application.rb:178:in `standard_exception_handling'
C:/Bitnami/redmine-3.3.3-1/ruby/lib/ruby/gems/2.3.0/gems/rake-12.0.0/lib/rake/application.rb:77:in `run'
C:/Bitnami/redmine-3.3.3-1/ruby/lib/ruby/gems/2.3.0/gems/rake-12.0.0/exe/rake:27:in `<top (required)>'
C:/Bitnami/redmine-3.3.3-1/ruby/bin/rake:22:in `load'
C:/Bitnami/redmine-3.3.3-1/ruby/bin/rake:22:in `<main>'
Tasks: TOP => redmine:email:receive_imap
Any help is so much appreciated.!

If you are using Gmail as the outbound email server and you are not able to send email correctly, Google may be blocking sign-in attempts from your apps or devices. Depending on whether or not you use Google Apps, the steps to correct this will differ:
For Google Apps users
For other Google users

Related

Appium Ruby Console (ARC) complains HTTP request path is empty (ArgumentError)

I'm a beginner to appium, or even the language node.js or ruby. So I completely follow the tutorial when installing appium. When I ran the command arc, got the error:
/Users/kenmux/.rbenv/versions/2.1.5/lib/ruby/2.1.0/net/http/generic_request.rb:27:in `initialize': HTTP request path is empty (ArgumentError)
from /Users/kenmux/.rbenv/versions/2.1.5/lib/ruby/2.1.0/net/http/request.rb:14:in `initialize'
from /Users/kenmux/.rbenv/versions/2.1.5/lib/ruby/gems/2.1.0/gems/selenium-webdriver-2.44.0/lib/selenium/webdriver/remote/http/default.rb:71:in `new'
from /Users/kenmux/.rbenv/versions/2.1.5/lib/ruby/gems/2.1.0/gems/selenium-webdriver-2.44.0/lib/selenium/webdriver/remote/http/default.rb:71:in `new_request_for'
from /Users/kenmux/.rbenv/versions/2.1.5/lib/ruby/gems/2.1.0/gems/selenium-webdriver-2.44.0/lib/selenium/webdriver/remote/http/default.rb:35:in `request'
from /Users/kenmux/.rbenv/versions/2.1.5/lib/ruby/gems/2.1.0/gems/selenium-webdriver-2.44.0/lib/selenium/webdriver/remote/http/default.rb:64:in `request'
from /Users/kenmux/.rbenv/versions/2.1.5/lib/ruby/gems/2.1.0/gems/selenium-webdriver-2.44.0/lib/selenium/webdriver/remote/http/common.rb:40:in `call'
from /Users/kenmux/.rbenv/versions/2.1.5/lib/ruby/gems/2.1.0/gems/appium_lib-5.0.0/lib/appium_lib/common/patch.rb:118:in `raw_execute'
from /Users/kenmux/.rbenv/versions/2.1.5/lib/ruby/gems/2.1.0/gems/selenium-webdriver-2.44.0/lib/selenium/webdriver/remote/bridge.rb:101:in `create_session'
from /Users/kenmux/.rbenv/versions/2.1.5/lib/ruby/gems/2.1.0/gems/selenium-webdriver-2.44.0/lib/selenium/webdriver/remote/bridge.rb:68:in `initialize'
from /Users/kenmux/.rbenv/versions/2.1.5/lib/ruby/gems/2.1.0/gems/selenium-webdriver-2.44.0/lib/selenium/webdriver/common/driver.rb:33:in `new'
from /Users/kenmux/.rbenv/versions/2.1.5/lib/ruby/gems/2.1.0/gems/selenium-webdriver-2.44.0/lib/selenium/webdriver/common/driver.rb:33:in `for'
from /Users/kenmux/.rbenv/versions/2.1.5/lib/ruby/gems/2.1.0/gems/selenium-webdriver-2.44.0/lib/selenium/webdriver.rb:67:in `for'
from /Users/kenmux/.rbenv/versions/2.1.5/lib/ruby/gems/2.1.0/gems/appium_lib-5.0.0/lib/appium_lib/driver.rb:477:in `start_driver'
from /Users/kenmux/.rbenv/versions/2.1.5/lib/ruby/gems/2.1.0/gems/appium_console-1.0.3/lib/start.rb:16:in `<top (required)>'
from /Users/kenmux/.rbenv/versions/2.1.5/lib/ruby/site_ruby/2.1.0/rubygems/core_ext/kernel_require.rb:54:in `require'
from /Users/kenmux/.rbenv/versions/2.1.5/lib/ruby/site_ruby/2.1.0/rubygems/core_ext/kernel_require.rb:54:in `require'
from /Users/kenmux/.rbenv/versions/2.1.5/lib/ruby/gems/2.1.0/gems/pry-0.9.12.6/lib/pry/pry_class.rb:96:in `block in load_requires'
from /Users/kenmux/.rbenv/versions/2.1.5/lib/ruby/gems/2.1.0/gems/pry-0.9.12.6/lib/pry/pry_class.rb:95:in `each'
from /Users/kenmux/.rbenv/versions/2.1.5/lib/ruby/gems/2.1.0/gems/pry-0.9.12.6/lib/pry/pry_class.rb:95:in `load_requires'
from /Users/kenmux/.rbenv/versions/2.1.5/lib/ruby/gems/2.1.0/gems/pry-0.9.12.6/lib/pry/pry_class.rb:117:in `initial_session_setup'
from /Users/kenmux/.rbenv/versions/2.1.5/lib/ruby/gems/2.1.0/gems/pry-0.9.12.6/lib/pry/pry_class.rb:142:in `start'
from /Users/kenmux/.rbenv/versions/2.1.5/lib/ruby/gems/2.1.0/gems/pry-0.9.12.6/lib/pry/cli.rb:201:in `block in <top (required)>'
from /Users/kenmux/.rbenv/versions/2.1.5/lib/ruby/gems/2.1.0/gems/pry-0.9.12.6/lib/pry/cli.rb:70:in `call'
from /Users/kenmux/.rbenv/versions/2.1.5/lib/ruby/gems/2.1.0/gems/pry-0.9.12.6/lib/pry/cli.rb:70:in `block in parse_options'
from /Users/kenmux/.rbenv/versions/2.1.5/lib/ruby/gems/2.1.0/gems/pry-0.9.12.6/lib/pry/cli.rb:70:in `each'
from /Users/kenmux/.rbenv/versions/2.1.5/lib/ruby/gems/2.1.0/gems/pry-0.9.12.6/lib/pry/cli.rb:70:in `parse_options'
from /Users/kenmux/.rbenv/versions/2.1.5/lib/ruby/gems/2.1.0/gems/appium_console-1.0.3/lib/appium_console.rb:49:in `<module:Console>'
from /Users/kenmux/.rbenv/versions/2.1.5/lib/ruby/gems/2.1.0/gems/appium_console-1.0.3/lib/appium_console.rb:31:in `<module:Appium>'
from /Users/kenmux/.rbenv/versions/2.1.5/lib/ruby/gems/2.1.0/gems/appium_console-1.0.3/lib/appium_console.rb:30:in `<top (required)>'
from /Users/kenmux/.rbenv/versions/2.1.5/lib/ruby/site_ruby/2.1.0/rubygems/core_ext/kernel_require.rb:54:in `require'
from /Users/kenmux/.rbenv/versions/2.1.5/lib/ruby/site_ruby/2.1.0/rubygems/core_ext/kernel_require.rb:54:in `require'
from /Users/kenmux/.rbenv/versions/2.1.5/lib/ruby/gems/2.1.0/gems/appium_console-1.0.3/bin/arc:66:in `<top (required)>'
from /Users/kenmux/.rbenv/versions/2.1.5/bin/arc:23:in `load'
from /Users/kenmux/.rbenv/versions/2.1.5/bin/arc:23:in `<main>'
Then what should I do? Am I missing something? I just cannot get over it!
I had this same issue when I was at work and had a proxy server in my .bash_profile
Open up a terminal and type:
cat ~/.bash_profile
That will show you what is in your profile.
my .bash_profile had the below.
export http_proxy="http://127.0.0.1:8888"
export https_proxy=$http_proxy
export ftp_proxy=$http_proxy
export rsync_proxy=$http_proxy
To comment them out just add # in front of each of the lines. Then restart your terminal session.
Side Note:
When you type user$ arc from the terminal you will want to make sure you have appium running and the appium.txt file in the same directory where your running arc.
Lots of good stuff here -> Ruby_Console
I hope that helps you or someone else.

Ruby on Rails Tutorial Demo_App - rake db:migrate to Heroku not working

I'm doing Michael Hartl's Rails Tutorials and am having a bit of a problem with the final stage of the Demo App, that is, running the rake command on Heroku to migrate the database to the web.
The rake command with a --trace on it gives the following result:
$ heroku run rake db:migrate --trace
Running `rake db:migrate --trace` attached to terminal...
/usr/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:36: command not found: tput cols
/usr/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:36: command not found: tput lines
up, run.1
(in /app)
* Invoke db:migrate (first_time)
** Invoke environment (first_time)
** Execute environment
** Execute db:migrate
rake aborted!
no such file to load -- pg
/app/vendor/bundle/ruby/1.9.1/gems/activesupport-3.0.1/lib/active_support/dependencies.rb:239:in `require'
/app/vendor/bundle/ruby/1.9.1/gems/activesupport-3.0.1/lib/active_support/dependencies.rb:239:in `block in require'
/app/vendor/bundle/ruby/1.9.1/gems/activesupport-3.0.1/lib/active_support/dependencies.rb:227:in `load_dependency'
/app/vendor/bundle/ruby/1.9.1/gems/activesupport-3.0.1/lib/active_support/dependencies.rb:239:in `require'
/app/vendor/bundle/ruby/1.9.1/gems/activerecord-3.0.1/lib/active_record/connection_adapters/postgresql_adapter.rb:9:in `postgresql_connection'
/app/vendor/bundle/ruby/1.9.1/gems/activerecord-3.0.1/lib/active_record/connection_adapters/abstract/connection_pool.rb:230:in `new_connection'
/app/vendor/bundle/ruby/1.9.1/gems/activerecord-3.0.1/lib/active_record/connection_adapters/abstract/connection_pool.rb:238:in `checkout_new_connection'
/app/vendor/bundle/ruby/1.9.1/gems/activerecord-3.0.1/lib/active_record/connection_adapters/abstract/connection_pool.rb:194:in `block (2 levels) in checkout'
/app/vendor/bundle/ruby/1.9.1/gems/activerecord-3.0.1/lib/active_record/connection_adapters/abstract/connection_pool.rb:190:in `loop'
/app/vendor/bundle/ruby/1.9.1/gems/activerecord-3.0.1/lib/active_record/connection_adapters/abstract/connection_pool.rb:190:in `block in checkout'
/usr/local/lib/ruby/1.9.1/monitor.rb:201:in `mon_synchronize'
/app/vendor/bundle/ruby/1.9.1/gems/activerecord-3.0.1/lib/active_record/connection_adapters/abstract/connection_pool.rb:189:in `checkout'
/app/vendor/bundle/ruby/1.9.1/gems/activerecord-3.0.1/lib/active_record/connection_adapters/abstract/connection_pool.rb:96:in `connection'
/app/vendor/bundle/ruby/1.9.1/gems/activerecord-3.0.1/lib/active_record/connection_adapters/abstract/connection_pool.rb:318:in `retrieve_connection'
/app/vendor/bundle/ruby/1.9.1/gems/activerecord-3.0.1/lib/active_record/connection_adapters/abstract/connection_specification.rb:97:in `retrieve_connection'
/app/vendor/bundle/ruby/1.9.1/gems/activerecord-3.0.1/lib/active_record/connection_adapters/abstract/connection_specification.rb:89:in `connection'
/app/vendor/bundle/ruby/1.9.1/gems/activerecord-3.0.1/lib/active_record/migration.rb:486:in `initialize'
/app/vendor/bundle/ruby/1.9.1/gems/activerecord-3.0.1/lib/active_record/migration.rb:433:in `new'
/app/vendor/bundle/ruby/1.9.1/gems/activerecord-3.0.1/lib/active_record/migration.rb:433:in `up'
/app/vendor/bundle/ruby/1.9.1/gems/activerecord-3.0.1/lib/active_record/migration.rb:415:in `migrate'
/app/vendor/bundle/ruby/1.9.1/gems/activerecord-3.0.1/lib/active_record/railties/databases.rake:142:in `block (2 levels) in <top (required)>'
/app/vendor/bundle/ruby/1.9.1/gems/rake-0.8.7/lib/rake.rb:636:in `call'
/app/vendor/bundle/ruby/1.9.1/gems/rake-0.8.7/lib/rake.rb:636:in `block in execute'
/app/vendor/bundle/ruby/1.9.1/gems/rake-0.8.7/lib/rake.rb:631:in `each'
/app/vendor/bundle/ruby/1.9.1/gems/rake-0.8.7/lib/rake.rb:631:in `execute'
/app/vendor/bundle/ruby/1.9.1/gems/rake-0.8.7/lib/rake.rb:597:in `block in invoke_with_call_chain'
/usr/local/lib/ruby/1.9.1/monitor.rb:201:in `mon_synchronize'
/app/vendor/bundle/ruby/1.9.1/gems/rake-0.8.7/lib/rake.rb:590:in `invoke_with_call_chain'
/app/vendor/bundle/ruby/1.9.1/gems/rake-0.8.7/lib/rake.rb:583:in `invoke'
/app/vendor/bundle/ruby/1.9.1/gems/rake-0.8.7/lib/rake.rb:2051:in `invoke_task'
/app/vendor/bundle/ruby/1.9.1/gems/rake-0.8.7/lib/rake.rb:2029:in `block (2 levels) in top_level'
/app/vendor/bundle/ruby/1.9.1/gems/rake-0.8.7/lib/rake.rb:2029:in `each'
/app/vendor/bundle/ruby/1.9.1/gems/rake-0.8.7/lib/rake.rb:2029:in `block in top_level'
/app/vendor/bundle/ruby/1.9.1/gems/rake-0.8.7/lib/rake.rb:2068:in `standard_exception_handling'
/app/vendor/bundle/ruby/1.9.1/gems/rake-0.8.7/lib/rake.rb:2023:in `top_level'
/app/vendor/bundle/ruby/1.9.1/gems/rake-0.8.7/lib/rake.rb:2001:in `block in run'
/app/vendor/bundle/ruby/1.9.1/gems/rake-0.8.7/lib/rake.rb:2068:in `standard_exception_handling'
/app/vendor/bundle/ruby/1.9.1/gems/rake-0.8.7/lib/rake.rb:1998:in `run'
/app/vendor/bundle/ruby/1.9.1/gems/rake-0.8.7/bin/rake:31:in `<top (required)>'
/app/vendor/bundle/ruby/1.9.1/bin/rake:19:in `load'
/app/vendor/bundle/ruby/1.9.1/bin/rake:19:in `<main>'
I thought that that 'command not found: tput' stuff at the start might have been down to something I modified (it looks like the word 'output' that got cut off) so I redid the entire chapter from the beginning, but ended up with the same result, so I don't think it's any changes I made to the code.
I'm using a Windows PC, running XP. Everything worked fine when run on the localhost and my Git Repository pushed to Heroku perfectly, so everything works except for this rake command. If ye want to see any of the other files, they're at: https://github.com/jimbobsweeney/demo_app
I'm very grateful in advance for any help on this. It's melting my brain.
Rob
Do you have Cygwin installed? This article (in Japanese) mentions this error and points to this SO question which suggests you make sure Cygwin and possibly ncurses is installed. A comment there links to this article which may also have useful information.
It looks like the issue is that heroku is looking for the tput command in your shell which is not available (which I believe comes with ncurses).
As for the stack trace, it looks like the pg gem is not in your Gemfile in a place the production environment will execute it. It's not necessary to install pg on Windows just to get the deploy working. Create a :production group in your Gemfile for this.
group :production do
gem "pg", "~> 0.11.0"
end
You can learn more about groups in the bundler docs.

heroku db:push issue

I am having some issues getting db:push to work with heroku.
As I have read else where, there is an issue with ruby versions > 1.9.3-p0, so I've downgraded to 1.9.2-p290, as it seems that that is the most common suggestion.
This can be confirmed via running ruby -v and getting ruby 1.9.2p290 (2011-07-09 revision 32553) [x86_64-darwin11.4.0]
[teacherjoy (master)]$ heroku db:push
Loaded Taps v0.3.24
Auto-detected local database: sqlite://db/development.sqlite3
Warning: Data in the app 'teacherjoy' will be overwritten and will not be recoverable.
! WARNING: Destructive Action
! This command will affect the app: teacherjoy
! To proceed, type "teacherjoy" or re-run this command with --confirm teacherjoy
> teacherjoy
Sending schema
Schema: 100% |==========================================| Time: 00:00:05
Sending indexes
users: 100% |==========================================| Time: 00:00:02
schema_migrat: 100% |==========================================| Time: 00:00:01
Sending data
4 tables, 76 records
holders: 0% | | ETA: --:--:--
Saving session to push_201207160342.dat..
!!! Caught Server Exception
HTTP CODE: 500
Taps Server Error: PGError: ERROR: time zone displacement out of range: "2012-07-10 12:00:00.000000+5894685600"
["/app/.bundle/gems/ruby/1.9.1/gems/sequel-3.20.0/lib/sequel/adapters/postgres.rb:175:in `async_exec'",
"/app/.bundle/gems/ruby/1.9.1/gems/sequel-3.20.0/lib/sequel/adapters/postgres.rb:175:in `block (2 levels) in execute'",
"/app/.bundle/gems/ruby/1.9.1/gems/sequel-3.20.0/lib/sequel/database/logging.rb:28:in `log_yield'",
"/app/.bundle/gems/ruby/1.9.1/gems/sequel-3.20.0/lib/sequel/adapters/postgres.rb:175:in `block in execute'",
"/app/.bundle/gems/ruby/1.9.1/gems/sequel-3.20.0/lib/sequel/adapters/postgres.rb:158:in `check_disconnect_errors'",
"/app/.bundle/gems/ruby/1.9.1/gems/sequel-3.20.0/lib/sequel/adapters/postgres.rb:175:in `execute'",
"/app/.bundle/gems/ruby/1.9.1/gems/sequel-3.20.0/lib/sequel/adapters/postgres.rb:240:in `block (2 levels) in execute'",
"/app/.bundle/gems/ruby/1.9.1/gems/sequel-3.20.0/lib/sequel/connection_pool/threaded.rb:71:in `hold'",
"/app/.bundle/gems/ruby/1.9.1/gems/sequel-3.20.0/lib/sequel/database/connecting.rb:226:in `synchronize'",
"/app/.bundle/gems/ruby/1.9.1/gems/sequel-3.20.0/lib/sequel/adapters/postgres.rb:240:in `block in execute'",
"/app/.bundle/gems/ruby/1.9.1/gems/sequel-3.20.0/lib/sequel/adapters/postgres.rb:261:in `check_database_errors'",
"/app/.bundle/gems/ruby/1.9.1/gems/sequel-3.20.0/lib/sequel/adapters/postgres.rb:238:in `execute'",
"/app/.bundle/gems/ruby/1.9.1/gems/sequel-3.20.0/lib/sequel/database/query.rb:71:in `execute_dui'",
"/app/.bundle/gems/ruby/1.9.1/gems/sequel-3.20.0/lib/sequel/dataset/actions.rb:552:in `execute_dui'",
"/app/.bundle/gems/ruby/1.9.1/gems/sequel-3.20.0/lib/sequel/dataset/actions.rb:243:in `block (2 levels) in import'",
"/app/.bundle/gems/ruby/1.9.1/gems/sequel-3.20.0/lib/sequel/dataset/actions.rb:243:in `each'",
"/app/.bundle/gems/ruby/1.9.1/gems/sequel-3.20.0/lib/sequel/dataset/actions.rb:243:in `block in import'",
"/app/.bundle/gems/ruby/1.9.1/gems/sequel-3.20.0/lib/sequel/database/query.rb:223:in `_transaction'",
"/app/.bundle/gems/ruby/1.9.1/gems/sequel-3.20.0/lib/sequel/database/query.rb:209:in `block in transaction'",
"/app/.bundle/gems/ruby/1.9.1/gems/sequel-3.20.0/lib/sequel/connection_pool/threaded.rb:84:in `hold'",
"/app/.bundle/gems/ruby/1.9.1/gems/sequel-3.20.0/lib/sequel/database/connecting.rb:226:in `synchronize'",
"/app/.bundle/gems/ruby/1.9.1/gems/sequel-3.20.0/lib/sequel/database/query.rb:207:in `transaction'",
"/app/.bundle/gems/ruby/1.9.1/gems/sequel-3.20.0/lib/sequel/dataset/actions.rb:243:in `import'",
"/app/lib/taps/data_stream.rb:315:in `import_rows'",
"/app/lib/taps/data_stream.rb:158:in `fetch_remote_in_server'",
"/app/lib/taps/server.rb:114:in `block (3 levels) in <class:Server>'",
"/app/lib/taps/utils.rb:161:in `call'", "/app/lib/taps/utils.rb:161:in `server_error_handling'",
"/app/lib/taps/server.rb:112:in `block (2 levels) in <class:Server>'",
"/app/lib/taps/db_session.rb:15:in `block in conn'",
"/app/.bundle/gems/ruby/1.9.1/gems/sequel-3.20.0/lib/sequel/database/connecting.rb:76:in `connect'",
"/app/.bundle/gems/ruby/1.9.1/gems/sequel-3.20.0/lib/sequel/core.rb:119:in `connect'",
"/app/lib/taps/db_session.rb:14:in `conn'",
"/app/lib/taps/server.rb:111:in `block in <class:Server>'",
"/app/.bundle/gems/ruby/1.9.1/gems/sinatra-1.0/lib/sinatra/base.rb:865:in `call'",
"/app/.bundle/gems/ruby/1.9.1/gems/sinatra-1.0/lib/sinatra/base.rb:865:in `block in route'",
"/app/.bundle/gems/ruby/1.9.1/gems/sinatra-1.0/lib/sinatra/base.rb:521:in `instance_eval'",
"/app/.bundle/gems/ruby/1.9.1/gems/sinatra-1.0/lib/sinatra/base.rb:521:in `route_eval'",
"/app/.bundle/gems/ruby/1.9.1/gems/sinatra-1.0/lib/sinatra/base.rb:500:in `block (2 levels) in route!'",
"/app/.bundle/gems/ruby/1.9.1/gems/sinatra-1.0/lib/sinatra/base.rb:497:in `catch'",
"/app/.bundle/gems/ruby/1.9.1/gems/sinatra-1.0/lib/sinatra/base.rb:497:in `block in route!'",
"/app/.bundle/gems/ruby/1.9.1/gems/sinatra-1.0/lib/sinatra/base.rb:476:in `each'",
"/app/.bundle/gems/ruby/1.9.1/gems/sinatra-1.0/lib/sinatra/base.rb:476:in `route!'",
"/app/.bundle/gems/ruby/1.9.1/gems/sinatra-1.0/lib/sinatra/base.rb:601:in `dispatch!'",
"/app/.bundle/gems/ruby/1.9.1/gems/sinatra-1.0/lib/sinatra/base.rb:411:in `block in call!'",
"/app/.bundle/gems/ruby/1.9.1/gems/sinatra-1.0/lib/sinatra/base.rb:566:in `instance_eval'",
"/app/.bundle/gems/ruby/1.9.1/gems/sinatra-1.0/lib/sinatra/base.rb:566:in `block in invoke'",
"/app/.bundle/gems/ruby/1.9.1/gems/sinatra-1.0/lib/sinatra/base.rb:566:in `catch'",
"/app/.bundle/gems/ruby/1.9.1/gems/sinatra-1.0/lib/sinatra/base.rb:566:in `invoke'",
"/app/.bundle/gems/ruby/1.9.1/gems/sinatra-1.0/lib/sinatra/base.rb:411:in `call!'",
"/app/.bundle/gems/ruby/1.9.1/gems/sinatra-1.0/lib/sinatra/base.rb:399:in `call'",
"/app/.bundle/gems/ruby/1.9.1/gems/sinatra-1.0/lib/sinatra/base.rb:979:in `block in call'",
"/app/.bundle/gems/ruby/1.9.1/gems/sinatra-1.0/lib/sinatra/base.rb:1005:in `synchronize'",
"/app/.bundle/gems/ruby/1.9.1/gems/sinatra-1.0/lib/sinatra/base.rb:979:in `call'",
"/home/heroku_rack/lib/static_assets.rb:9:in `call'",
"/home/heroku_rack/lib/last_access.rb:15:in `call'",
"/app/.bundle/gems/ruby/1.9.1/gems/rack-1.2.1/lib/rack/urlmap.rb:47:in `block in call'",
"/app/.bundle/gems/ruby/1.9.1/gems/rack-1.2.1/lib/rack/urlmap.rb:41:in `each'",
"/app/.bundle/gems/ruby/1.9.1/gems/rack-1.2.1/lib/rack/urlmap.rb:41:in `call'",
"/home/heroku_rack/lib/date_header.rb:14:in `call'",
"/app/.bundle/gems/ruby/1.9.1/gems/rack-1.2.1/lib/rack/builder.rb:77:in `call'",
"/app/.bundle/gems/ruby/1.9.1/gems/thin-1.2.7/lib/thin/connection.rb:76:in `block in pre_process'",
"/app/.bundle/gems/ruby/1.9.1/gems/thin-1.2.7/lib/thin/connection.rb:74:in `catch'",
"/app/.bundle/gems/ruby/1.9.1/gems/thin-1.2.7/lib/thin/connection.rb:74:in `pre_process'",
"/app/.bundle/gems/ruby/1.9.1/gems/thin-1.2.7/lib/thin/connection.rb:57:in `process'",
"/app/.bundle/gems/ruby/1.9.1/gems/thin-1.2.7/lib/thin/connection.rb:42:in `receive_data'",
"/app/.bundle/gems/ruby/1.9.1/gems/eventmachine-0.12.10/lib/eventmachine.rb:256:in `run_machine'",
"/app/.bundle/gems/ruby/1.9.1/gems/eventmachine-0.12.10/lib/eventmachine.rb:256:in `run'",
"/app/.bundle/gems/ruby/1.9.1/gems/thin-1.2.7/lib/thin/backends/base.rb:57:in `start'",
"/app/.bundle/gems/ruby/1.9.1/gems/thin-1.2.7/lib/thin/server.rb:156:in `start'",
"/app/.bundle/gems/ruby/1.9.1/gems/thin-1.2.7/lib/thin/controllers/controller.rb:80:in `start'",
"/app/.bundle/gems/ruby/1.9.1/gems/thin-1.2.7/lib/thin/runner.rb:177:in `run_command'",
"/app/.bundle/gems/ruby/1.9.1/gems/thin-1.2.7/lib/thin/runner.rb:143:in `run!'",
"/app/.bundle/gems/ruby/1.9.1/gems/thin-1.2.7/bin/thin:6:in `<top (required)>'",
"/app/.bundle/gems/ruby/1.9.1/bin/thin:19:in `load'",
"/app/.bundle/gems/ruby/1.9.1/bin/thin:19:in `<main>'"]
What is causing this issue and/or how can I fix it?
I guess this is due to date format of holders table(field is time zone displacement).
Not sure exactly what fixed it, but I was trying to push via a local seeds file. When I tried to run db:seed, I kept getting migration errors. When I tried to run the migrations, I got migration errors. So I ran the following: and then kept running db:migrate as I got new errors.
heroku run rake db:reset
heroku run rake db:migrate

Neither PUB key nor PRIV key:: nested asn1 error with apn_on_rails

I am trying to configure apn_on_rails to send push notifications from rails3 to iOS devices.
When I run bundle exec rake apn:notifications:deliver --trace
I get the following error:
(in /home/mari/Documents/descuentos)
** Invoke apn:notifications:deliver (first_time)
** Invoke environment (first_time)
** Execute environment
** Execute apn:notifications:deliver
rake aborted!
Neither PUB key nor PRIV key:: nested asn1 error
/home/mari/.rvm/gems/ruby-1.9.2-p290/bundler/gems/apn_on_rails-18f5d37397e3/lib/apn_on_rails/libs/connection.rb:52:in `initialize'
/home/mari/.rvm/gems/ruby-1.9.2-p290/bundler/gems/apn_on_rails-18f5d37397e3/lib/apn_on_rails/libs/connection.rb:52:in `new'
/home/mari/.rvm/gems/ruby-1.9.2-p290/bundler/gems/apn_on_rails-18f5d37397e3/lib/apn_on_rails/libs/connection.rb:52:in `open'
/home/mari/.rvm/gems/ruby-1.9.2-p290/bundler/gems/apn_on_rails-18f5d37397e3/lib/apn_on_rails/libs/connection.rb:23:in `open_for_delivery'
/home/mari/.rvm/gems/ruby-1.9.2-p290/bundler/gems/apn_on_rails-18f5d37397e3/lib/apn_on_rails/app/models/apn/notification.rb:104:in `send_notifications'
/home/mari/.rvm/gems/ruby-1.9.2-p290/bundler/gems/apn_on_rails-18f5d37397e3/lib/apn_on_rails/tasks/apn.rake:7:in `block (3 levels) in <top (required)>'
/home/mari/.rvm/gems/ruby-1.9.2-p290/gems/rake-0.9.2/lib/rake/task.rb:205:in `call'
/home/mari/.rvm/gems/ruby-1.9.2-p290/gems/rake-0.9.2/lib/rake/task.rb:205:in `block in execute'
/home/mari/.rvm/gems/ruby-1.9.2-p290/gems/rake-0.9.2/lib/rake/task.rb:200:in `each'
/home/mari/.rvm/gems/ruby-1.9.2-p290/gems/rake-0.9.2/lib/rake/task.rb:200:in `execute'
/home/mari/.rvm/gems/ruby-1.9.2-p290/gems/rake-0.9.2/lib/rake/task.rb:158:in `block in invoke_with_call_chain'
/home/mari/.rvm/rubies/ruby-1.9.2-p290/lib/ruby/1.9.1/monitor.rb:201:in `mon_synchronize'
/home/mari/.rvm/gems/ruby-1.9.2-p290/gems/rake-0.9.2/lib/rake/task.rb:151:in `invoke_with_call_chain'
/home/mari/.rvm/gems/ruby-1.9.2-p290/gems/rake-0.9.2/lib/rake/task.rb:144:in `invoke'
/home/mari/.rvm/gems/ruby-1.9.2-p290/gems/rake-0.9.2/lib/rake/application.rb:112:in `invoke_task'
/home/mari/.rvm/gems/ruby-1.9.2-p290/gems/rake-0.9.2/lib/rake/application.rb:90:in `block (2 levels) in top_level'
/home/mari/.rvm/gems/ruby-1.9.2-p290/gems/rake-0.9.2/lib/rake/application.rb:90:in `each'
/home/mari/.rvm/gems/ruby-1.9.2-p290/gems/rake-0.9.2/lib/rake/application.rb:90:in `block in top_level'
/home/mari/.rvm/gems/ruby-1.9.2-p290/gems/rake-0.9.2/lib/rake/application.rb:129:in `standard_exception_handling'
/home/mari/.rvm/gems/ruby-1.9.2-p290/gems/rake-0.9.2/lib/rake/application.rb:84:in `top_level'
/home/mari/.rvm/gems/ruby-1.9.2-p290/gems/rake-0.9.2/lib/rake/application.rb:62:in `block in run'
/home/mari/.rvm/gems/ruby-1.9.2-p290/gems/rake-0.9.2/lib/rake/application.rb:129:in `standard_exception_handling'
/home/mari/.rvm/gems/ruby-1.9.2-p290/gems/rake-0.9.2/lib/rake/application.rb:59:in `run'
/home/mari/.rvm/gems/ruby-1.9.2-p290/gems/rake-0.9.2/bin/rake:32:in `<top (required)>'
/home/mari/.rvm/gems/ruby-1.9.2-p290/bin/rake:19:in `load'
/home/mari/.rvm/gems/ruby-1.9.2-p290/bin/rake:19:in `<main>'
Tasks: TOP => apn:notifications:deliver
I am running the application from ubuntu (can that cause the problem?). The person that is an agent in the apple developers program has generated the p12 and the pem twice for me from his computer following these instructions:
Click the disclosure arrow next to your certificate in Keychain Access and select the certificate and the key.
Right click and choose Export 2 items….
Choose the p12 format from the drop down and name it cert.p12.
but I keep getting the error.
What can I do to fix it?
The certificate that was given to me was wrong. After generating the right certificate and p12 the problem was solved.

Issues implementing Rspec with Rails3 from tutorial

I am a newbie to Rails 3 and Rspec. Kindly excuse my being a novice.
I am trying to implement RSpec with Rails 3. I am using Rails 3.0.3 with Ruby 1.9.2 on Ubuntu 10.04 os. I am using rspec 2.5 gem and rspec-rails 2.5 gem.
I am referring to the following tutorial:-
http://www.railsfire.com/article/rspec-behaviour-driven-development-testing-framework
This tutorial is implemented on Rails 2.x with an older version of rspec and rspec-rails.
I tried to implement exactly the same tutorial with my configuration, but I have run into some issues. I am unable to figure out what I must have done wrong.
I am sure about one thing that I am not using the rails_scaffold generator as used in this tutorial. Instead of using the rails_scaffold generator, I made use of the following command rails g scaffold post title:string body:text
I don't seem to have it(rspec_scaffold) in my list of generators which as part of Rails 3 and the additional ones that will come with Rspec.
The error I am getting is :-
mohnish#mohnish-desktop:~/rails_testing/10Mar11/rspec_demo5$ rake spec
(in /home/mohnish/rails_testing/10Mar11/rspec_demo5)
rake aborted!
You have a nil object when you didn't expect it!
You might have expected an instance of ActiveRecord::Base.
The error occurred while evaluating nil.[]
(See full trace by running task with --trace)
mohnish#mohnish-desktop:~/rails_testing/10Mar11/rspec_demo5$ rake spec --trace
(in /home/mohnish/rails_testing/10Mar11/rspec_demo5)
** Invoke spec (first_time)
** Invoke db:test:prepare (first_time)
** Invoke db:abort_if_pending_migrations (first_time)
** Invoke environment (first_time)
** Execute environment
** Execute db:abort_if_pending_migrations
** Execute db:test:prepare
** Invoke db:test:load (first_time)
** Invoke db:test:purge (first_time)
** Invoke environment
** Execute db:test:purge
rake aborted!
You have a nil object when you didn't expect it!
You might have expected an instance of ActiveRecord::Base.
The error occurred while evaluating nil.[]
/home/mohnish/.rvm/gems/ruby-1.9.2-p180/gems/activerecord-3.0.3/lib/active_record/railties/databases.rake:429:in `block (3 levels) in <top (required)>'
/home/mohnish/.rvm/gems/ruby-1.9.2-p180/gems/rake-0.8.7/lib/rake.rb:636:in `call'
/home/mohnish/.rvm/gems/ruby-1.9.2-p180/gems/rake-0.8.7/lib/rake.rb:636:in `block in execute'
/home/mohnish/.rvm/gems/ruby-1.9.2-p180/gems/rake-0.8.7/lib/rake.rb:631:in `each'
/home/mohnish/.rvm/gems/ruby-1.9.2-p180/gems/rake-0.8.7/lib/rake.rb:631:in `execute'
/home/mohnish/.rvm/gems/ruby-1.9.2-p180/gems/rake-0.8.7/lib/rake.rb:597:in `block in invoke_with_call_chain'
/home/mohnish/.rvm/rubies/ruby-1.9.2-p180/lib/ruby/1.9.1/monitor.rb:201:in `mon_synchronize'
/home/mohnish/.rvm/gems/ruby-1.9.2-p180/gems/rake-0.8.7/lib/rake.rb:590:in `invoke_with_call_chain'
/home/mohnish/.rvm/gems/ruby-1.9.2-p180/gems/rake-0.8.7/lib/rake.rb:607:in `block in invoke_prerequisites'
/home/mohnish/.rvm/gems/ruby-1.9.2-p180/gems/rake-0.8.7/lib/rake.rb:604:in `each'
/home/mohnish/.rvm/gems/ruby-1.9.2-p180/gems/rake-0.8.7/lib/rake.rb:604:in `invoke_prerequisites'
/home/mohnish/.rvm/gems/ruby-1.9.2-p180/gems/rake-0.8.7/lib/rake.rb:596:in `block in invoke_with_call_chain'
/home/mohnish/.rvm/rubies/ruby-1.9.2-p180/lib/ruby/1.9.1/monitor.rb:201:in `mon_synchronize'
/home/mohnish/.rvm/gems/ruby-1.9.2-p180/gems/rake-0.8.7/lib/rake.rb:590:in `invoke_with_call_chain'
/home/mohnish/.rvm/gems/ruby-1.9.2-p180/gems/rake-0.8.7/lib/rake.rb:583:in `invoke'
/home/mohnish/.rvm/gems/ruby-1.9.2-p180/gems/activerecord-3.0.3/lib/active_record/railties/databases.rake:460:in `block (3 levels) in <top (required)>'
/home/mohnish/.rvm/gems/ruby-1.9.2-p180/gems/rake-0.8.7/lib/rake.rb:636:in `call'
/home/mohnish/.rvm/gems/ruby-1.9.2-p180/gems/rake-0.8.7/lib/rake.rb:636:in `block in execute'
/home/mohnish/.rvm/gems/ruby-1.9.2-p180/gems/rake-0.8.7/lib/rake.rb:631:in `each'
/home/mohnish/.rvm/gems/ruby-1.9.2-p180/gems/rake-0.8.7/lib/rake.rb:631:in `execute'
/home/mohnish/.rvm/gems/ruby-1.9.2-p180/gems/rake-0.8.7/lib/rake.rb:597:in `block in invoke_with_call_chain'
/home/mohnish/.rvm/rubies/ruby-1.9.2-p180/lib/ruby/1.9.1/monitor.rb:201:in `mon_synchronize'
/home/mohnish/.rvm/gems/ruby-1.9.2-p180/gems/rake-0.8.7/lib/rake.rb:590:in `invoke_with_call_chain'
/home/mohnish/.rvm/gems/ruby-1.9.2-p180/gems/rake-0.8.7/lib/rake.rb:607:in `block in invoke_prerequisites'
/home/mohnish/.rvm/gems/ruby-1.9.2-p180/gems/rake-0.8.7/lib/rake.rb:604:in `each'
/home/mohnish/.rvm/gems/ruby-1.9.2-p180/gems/rake-0.8.7/lib/rake.rb:604:in `invoke_prerequisites'
/home/mohnish/.rvm/gems/ruby-1.9.2-p180/gems/rake-0.8.7/lib/rake.rb:596:in `block in invoke_with_call_chain'
/home/mohnish/.rvm/rubies/ruby-1.9.2-p180/lib/ruby/1.9.1/monitor.rb:201:in `mon_synchronize'
/home/mohnish/.rvm/gems/ruby-1.9.2-p180/gems/rake-0.8.7/lib/rake.rb:590:in `invoke_with_call_chain'
/home/mohnish/.rvm/gems/ruby-1.9.2-p180/gems/rake-0.8.7/lib/rake.rb:583:in `invoke'
/home/mohnish/.rvm/gems/ruby-1.9.2-p180/gems/rake-0.8.7/lib/rake.rb:2051:in `invoke_task'
/home/mohnish/.rvm/gems/ruby-1.9.2-p180/gems/rake-0.8.7/lib/rake.rb:2029:in `block (2 levels) in top_level'
/home/mohnish/.rvm/gems/ruby-1.9.2-p180/gems/rake-0.8.7/lib/rake.rb:2029:in `each'
/home/mohnish/.rvm/gems/ruby-1.9.2-p180/gems/rake-0.8.7/lib/rake.rb:2029:in `block in top_level'
/home/mohnish/.rvm/gems/ruby-1.9.2-p180/gems/rake-0.8.7/lib/rake.rb:2068:in `standard_exception_handling'
/home/mohnish/.rvm/gems/ruby-1.9.2-p180/gems/rake-0.8.7/lib/rake.rb:2023:in `top_level'
/home/mohnish/.rvm/gems/ruby-1.9.2-p180/gems/rake-0.8.7/lib/rake.rb:2001:in `block in run'
/home/mohnish/.rvm/gems/ruby-1.9.2-p180/gems/rake-0.8.7/lib/rake.rb:2068:in `standard_exception_handling'
/home/mohnish/.rvm/gems/ruby-1.9.2-p180/gems/rake-0.8.7/lib/rake.rb:1998:in `run'
/home/mohnish/.rvm/gems/ruby-1.9.2-p180/gems/rake-0.8.7/bin/rake:31:in `<top (required)>'
/home/mohnish/.rvm/gems/ruby-1.9.2-p180/bin/rake:19:in `load'
/home/mohnish/.rvm/gems/ruby-1.9.2-p180/bin/rake:19:in `<main>'
mohnish#mohnish-desktop:~/rails_testing/10Mar11/rspec_demo5$
Any suggestions on what I must be doing wrong and how to fix the same. Kindly help.
Thank you very much.
I made a fundamental mistake, I realized that I always made use of rake db:create, and rake db:migrate. This would set things for me with
Development Environment. For the test enviroment, I had to use rake db:test:prepare or rake db:migrate with appropriate syntax to reflect
the migrations in the Test Environment.