heroku db:push issue - sql

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

Related

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

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

Heroku console giving Encoding::UndefinedConversionError

Running a heroku console with
heroku run console
all commands returning UTF-8 characters (like german Umlauts) will result in the following error:
irb(main):004:0> Play.all[-2]
Play Load (27.5ms) SELECT "plays".* FROM "plays" ORDER BY name asc
Encoding::UndefinedConversionError: U+00E4 from UTF-8 to US-ASCII
from /usr/local/lib/ruby/1.9.1/irb.rb:311:in `write'
from /usr/local/lib/ruby/1.9.1/irb.rb:311:in `printf'
from /usr/local/lib/ruby/1.9.1/irb.rb:311:in `output_value'
from /usr/local/lib/ruby/1.9.1/irb.rb:160:in `block (2 levels) in eval_input'
from /usr/local/lib/ruby/1.9.1/irb.rb:273:in `signal_status'
from /usr/local/lib/ruby/1.9.1/irb.rb:156:in `block in eval_input'
from /usr/local/lib/ruby/1.9.1/irb/ruby-lex.rb:243:in `block (2 levels) in each_top_level_statement'
from /usr/local/lib/ruby/1.9.1/irb/ruby-lex.rb:229:in `loop'
from /usr/local/lib/ruby/1.9.1/irb/ruby-lex.rb:229:in `block in each_top_level_statement'
from /usr/local/lib/ruby/1.9.1/irb/ruby-lex.rb:228:in `catch'
from /usr/local/lib/ruby/1.9.1/irb/ruby-lex.rb:228:in `each_top_level_statement'
from /usr/local/lib/ruby/1.9.1/irb.rb:155:in `eval_input'
from /usr/local/lib/ruby/1.9.1/irb.rb:70:in `block in start'
from /usr/local/lib/ruby/1.9.1/irb.rb:69:in `catch'
from /usr/local/lib/ruby/1.9.1/irb.rb:69:in `start'
from /app/vendor/bundle/ruby/1.9.1/gems/railties-3.2.12/lib/rails/commands/console.rb:47:in `start'
from /app/vendor/bundle/ruby/1.9.1/gems/railties-3.2.12/lib/rails/commands/console.rb:8:in `start'
from /app/vendor/bundle/ruby/1.9.1/gems/railties-3.2.12/lib/rails/commands.rb:41:in `<top (required)>'
from script/rails:6:in `require'
from script/rails:6:in `<main>'Maybe IRB bug!!
I do not really understand the cause of this.
Is there a workaround?
I am using iTerm with a setting of "UTF-8 xterm-color".
Update
This error completely disappeared for no reason known to me and I can reproduce it neither under ruby 1.9.2p320 nor 1.9.3p448
Typing "\u00E4" into the console now yields "ä" as expected:
irb(main):001:0> "\u00E4"
=> "ä"

Rails server fails to start with exit code 1 in rubymine

I was using my server yesterday no problem. Came back today with an error when starting the server
runnerw.exe C:\Ruby187\bin\ruby.exe -e $stdout.sync=true;$stderr.sync=true;load($0=ARGV.shift) "C:/Users/Stefan/RubymineProjects/gallery/gallery-app/script/rails" server -b 127.0.0.1 -p 3000 -e development
=> Booting WEBrick
=> Rails 3.2.8 application starting in development on http://127.0.0.1:3000
=> Call with -d to detach
=> Ctrl-C to shutdown server
Exiting
C:/Ruby187/lib/ruby/gems/1.8/gems/actionpack-3.2.8/lib/action_dispatch/routing/route_set.rb:278:in `eval_block': C:/Ruby187/lib/ruby/gems/1.8/gems/actionpack-3.2.8/lib/action_dispatch/routing/mapper.rb:1508: syntax error, unexpected kEND, expecting $end (SyntaxError)
from C:/Ruby187/lib/ruby/gems/1.8/gems/actionpack-3.2.8/lib/action_dispatch/routing/route_set.rb:297:in `clear!'
from C:/Ruby187/lib/ruby/gems/1.8/gems/actionpack-3.2.8/lib/action_dispatch/routing/route_set.rb:297:in `each'
from C:/Ruby187/lib/ruby/gems/1.8/gems/actionpack-3.2.8/lib/action_dispatch/routing/route_set.rb:297:in `clear!'
from C:/Ruby187/lib/ruby/gems/1.8/gems/railties-3.2.8/lib/rails/application/routes_reloader.rb:35:in `clear!'
from C:/Ruby187/lib/ruby/gems/1.8/gems/railties-3.2.8/lib/rails/application/routes_reloader.rb:33:in `each'
from C:/Ruby187/lib/ruby/gems/1.8/gems/railties-3.2.8/lib/rails/application/routes_reloader.rb:33:in `clear!'
from C:/Ruby187/lib/ruby/gems/1.8/gems/railties-3.2.8/lib/rails/application/routes_reloader.rb:15:in `reload!'
from C:/Ruby187/lib/ruby/gems/1.8/gems/railties-3.2.8/lib/rails/application/routes_reloader.rb:26:in `updater'
from C:/Ruby187/lib/ruby/gems/1.8/gems/activesupport-3.2.8/lib/active_support/file_update_checker.rb:78:in `call'
from C:/Ruby187/lib/ruby/gems/1.8/gems/activesupport-3.2.8/lib/active_support/file_update_checker.rb:78:in `execute'
from C:/Ruby187/lib/ruby/gems/1.8/gems/railties-3.2.8/lib/rails/application/routes_reloader.rb:27:in `updater'
from C:0:in `execute_if_updated'
from C:/Ruby187/lib/ruby/gems/1.8/gems/railties-3.2.8/lib/rails/application/finisher.rb:66
from C:/Ruby187/lib/ruby/gems/1.8/gems/railties-3.2.8/lib/rails/initializable.rb:30:in `instance_exec'
from C:/Ruby187/lib/ruby/gems/1.8/gems/railties-3.2.8/lib/rails/initializable.rb:30:in `run'
from C:/Ruby187/lib/ruby/gems/1.8/gems/railties-3.2.8/lib/rails/initializable.rb:55:in `run_initializers'
from C:/Ruby187/lib/ruby/gems/1.8/gems/railties-3.2.8/lib/rails/initializable.rb:54:in `each'
from C:/Ruby187/lib/ruby/gems/1.8/gems/railties-3.2.8/lib/rails/initializable.rb:54:in `run_initializers'
from C:/Ruby187/lib/ruby/gems/1.8/gems/railties-3.2.8/lib/rails/application.rb:136:in `initialize!'
from C:/Ruby187/lib/ruby/gems/1.8/gems/railties-3.2.8/lib/rails/railtie/configurable.rb:30:in `send'
from C:/Ruby187/lib/ruby/gems/1.8/gems/railties-3.2.8/lib/rails/railtie/configurable.rb:30:in `method_missing'
from C:/Users/Stefan/RubymineProjects/gallery/gallery-app/config/environment.rb:5
from C:/Users/Stefan/RubymineProjects/gallery/gallery-app/config.ru:4:in `require'
from C:/Users/Stefan/RubymineProjects/gallery/gallery-app/config.ru:4
from C:/Ruby187/lib/ruby/gems/1.8/gems/rack-1.4.1/lib/rack/builder.rb:51:in `instance_eval'
from C:/Ruby187/lib/ruby/gems/1.8/gems/rack-1.4.1/lib/rack/builder.rb:51:in `initialize'
from C:/Users/Stefan/RubymineProjects/gallery/gallery-app/config.ru:1:in `new'
from C:/Users/Stefan/RubymineProjects/gallery/gallery-app/config.ru:1
Process finished with exit code 1
Not sure what could be causing this and it's baffling me why its only now decided to pop up.
I was able to fix this by reinstalling the actionpack gem. It must have got corrupt or I accidently changed it between last night and today.

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.

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.