rake task does not launch for lack of Mime JSON - ruby-on-rails

After installing a repository locally and bundling for a rails 4.0 application, the database creation
rake db:create
command fails returning the following error:
uninitialized constant Mime::JSON
invoking from application.rb this particular line
Bundler.require(:default, Rails.env)
this line is preceeded by:
require File.expand_path('../boot', __FILE__)
require 'rails/all'
How can I get rake to properly process?
** update **
as per request full stack trace follows. I did manage to avoid the error by removing the jbuilder gem.
NameError: uninitialized constant Mime::JSON
/Users/deploy/.rbenv/versions/2.6.1/lib/ruby/gems/2.6.0/gems/jbuilder-1.5.3/lib/jbuilder/jbuilder_template.rb:110:in `<class:JbuilderHandler>'
/Users/deploy/.rbenv/versions/2.6.1/lib/ruby/gems/2.6.0/gems/jbuilder-1.5.3/lib/jbuilder/jbuilder_template.rb:108:in `<top (required)>'
/Users/deploy/.rbenv/versions/2.6.1/lib/ruby/gems/2.6.0/gems/jbuilder-1.5.3/lib/jbuilder.rb:358:in `<top (required)>'
/Users/deploy/.rbenv/versions/2.6.1/lib/ruby/gems/2.6.0/gems/bundler-2.1.4/lib/bundler/runtime.rb:74:in `require'
/Users/deploy/.rbenv/versions/2.6.1/lib/ruby/gems/2.6.0/gems/bundler-2.1.4/lib/bundler/runtime.rb:74:in `block (2 levels) in require'
/Users/deploy/.rbenv/versions/2.6.1/lib/ruby/gems/2.6.0/gems/bundler-2.1.4/lib/bundler/runtime.rb:69:in `each'
/Users/deploy/.rbenv/versions/2.6.1/lib/ruby/gems/2.6.0/gems/bundler-2.1.4/lib/bundler/runtime.rb:69:in `block in require'
/Users/deploy/.rbenv/versions/2.6.1/lib/ruby/gems/2.6.0/gems/bundler-2.1.4/lib/bundler/runtime.rb:58:in `each'
/Users/deploy/.rbenv/versions/2.6.1/lib/ruby/gems/2.6.0/gems/bundler-2.1.4/lib/bundler/runtime.rb:58:in `require'
/Users/deploy/.rbenv/versions/2.6.1/lib/ruby/gems/2.6.0/gems/bundler-2.1.4/lib/bundler.rb:174:in `require'
/Volumes/Mo/r/uelcom/config/application.rb:7:in `<top (required)>'
/Volumes/Mo/r/uelcom/Rakefile:8:in `require'
/Volumes/Mo/r/uelcom/Rakefile:8:in `<top (required)>'
/Users/deploy/.rbenv/versions/2.6.1/lib/ruby/gems/2.6.0/gems/rake-13.0.1/lib/rake/rake_module.rb:29:in `load'
/Users/deploy/.rbenv/versions/2.6.1/lib/ruby/gems/2.6.0/gems/rake-13.0.1/lib/rake/rake_module.rb:29:in `load_rakefile'
/Users/deploy/.rbenv/versions/2.6.1/lib/ruby/gems/2.6.0/gems/rake-13.0.1/lib/rake/application.rb:703:in `raw_load_rakefile'
/Users/deploy/.rbenv/versions/2.6.1/lib/ruby/gems/2.6.0/gems/rake-13.0.1/lib/rake/application.rb:104:in `block in load_rakefile'
/Users/deploy/.rbenv/versions/2.6.1/lib/ruby/gems/2.6.0/gems/rake-13.0.1/lib/rake/application.rb:186:in `standard_exception_handling'
/Users/deploy/.rbenv/versions/2.6.1/lib/ruby/gems/2.6.0/gems/rake-13.0.1/lib/rake/application.rb:103:in `load_rakefile'
/Users/deploy/.rbenv/versions/2.6.1/lib/ruby/gems/2.6.0/gems/rake-13.0.1/lib/rake/application.rb:82:in `block in run'
/Users/deploy/.rbenv/versions/2.6.1/lib/ruby/gems/2.6.0/gems/rake-13.0.1/lib/rake/application.rb:186:in `standard_exception_handling'
/Users/deploy/.rbenv/versions/2.6.1/lib/ruby/gems/2.6.0/gems/rake-13.0.1/lib/rake/application.rb:80:in `run'
/Users/deploy/.rbenv/versions/2.6.1/lib/ruby/gems/2.6.0/gems/rake-13.0.1/exe/rake:27:in `<top (required)>'
/Users/deploy/.rbenv/versions/2.6.1/bin/rake:23:in `load'
/Users/deploy/.rbenv/versions/2.6.1/bin/rake:23:in `<top (required)>'
/Users/deploy/.rbenv/versions/2.6.1/lib/ruby/gems/2.6.0/gems/bundler-2.1.4/lib/bundler/cli/exec.rb:63:in `load'
/Users/deploy/.rbenv/versions/2.6.1/lib/ruby/gems/2.6.0/gems/bundler-2.1.4/lib/bundler/cli/exec.rb:63:in `kernel_load'
/Users/deploy/.rbenv/versions/2.6.1/lib/ruby/gems/2.6.0/gems/bundler-2.1.4/lib/bundler/cli/exec.rb:28:in `run'
/Users/deploy/.rbenv/versions/2.6.1/lib/ruby/gems/2.6.0/gems/bundler-2.1.4/lib/bundler/cli.rb:476:in `exec'
/Users/deploy/.rbenv/versions/2.6.1/lib/ruby/gems/2.6.0/gems/bundler-2.1.4/lib/bundler/vendor/thor/lib/thor/command.rb:27:in `run'
/Users/deploy/.rbenv/versions/2.6.1/lib/ruby/gems/2.6.0/gems/bundler-2.1.4/lib/bundler/vendor/thor/lib/thor/invocation.rb:127:in `invoke_command'
/Users/deploy/.rbenv/versions/2.6.1/lib/ruby/gems/2.6.0/gems/bundler-2.1.4/lib/bundler/vendor/thor/lib/thor.rb:399:in `dispatch'
/Users/deploy/.rbenv/versions/2.6.1/lib/ruby/gems/2.6.0/gems/bundler-2.1.4/lib/bundler/cli.rb:30:in `dispatch'
/Users/deploy/.rbenv/versions/2.6.1/lib/ruby/gems/2.6.0/gems/bundler-2.1.4/lib/bundler/vendor/thor/lib/thor/base.rb:476:in `start'
/Users/deploy/.rbenv/versions/2.6.1/lib/ruby/gems/2.6.0/gems/bundler-2.1.4/lib/bundler/cli.rb:24:in `start'
/Users/deploy/.rbenv/versions/2.6.1/lib/ruby/gems/2.6.0/gems/bundler-2.1.4/exe/bundle:46:in `block in <top (required)>'
/Users/deploy/.rbenv/versions/2.6.1/lib/ruby/gems/2.6.0/gems/bundler-2.1.4/lib/bundler/friendly_errors.rb:123:in `with_friendly_errors'
/Users/deploy/.rbenv/versions/2.6.1/lib/ruby/gems/2.6.0/gems/bundler-2.1.4/exe/bundle:34:in `<top (required)>'
/Users/deploy/.rbenv/versions/2.6.1/bin/bundle:23:in `load'
/Users/deploy/.rbenv/versions/2.6.1/bin/bundle:23:in `<main>'

It seems you are using rails 5 or above.
As of rails version 5 or above accessing Mime types through Mime::JSON is deprecated, We need to access it as Mime[:json]
Please find the following references for the same - Release Note and Pull request
Deprecated accessing mime types via constants (eg. Mime::HTML). Use the subscript operator with a symbol instead (eg. Mime[:html])
As per the backtrace of the exception you have given, the gem jbuilder is causing the issue, which accesses Mime types as Mime::JSON which is deprecated.
Please find the reference of the line which causes the error on the gem jbuilder - Jubilder - Github.
You are using the older version of the jbuilder(1.5.3), please upgrade this gem to the latest version and try
Try the below version:
Gemfile
gem 'jbuilder', '~> 2.10'

Related

rake db:schema:dump not working

I'm learning ruby on rails on windows platform in windows 8. Now I'm in the database part where rake db:schema:dump command should create a file in config folder named schema.rb, but that's not happening. When I'm typing rake db:schema:dump it shows rake aborted and a long list. Please help.
Here is what shows up in console:
C:\Users\New User\sites2\learning_rails>rake db:schema;dump
rake aborted!
Bundler::GemRequireError: There was an error while trying to load the gem 'uglif
ier'.
Gem Load Error is: Could not find a JavaScript runtime. See https://github.com/r
ails/execjs for a list of available runtimes.
Backtrace for gem load error is:
C:/Ruby22-x64/lib/ruby/gems/2.2.0/gems/execjs-2.7.0/lib/execjs/runtimes.rb:58:in
`autodetect'
C:/Ruby22-x64/lib/ruby/gems/2.2.0/gems/execjs-2.7.0/lib/execjs.rb:5:in `<module:
ExecJS>'
C:/Ruby22-x64/lib/ruby/gems/2.2.0/gems/execjs-2.7.0/lib/execjs.rb:4:in `<top (re
quired)>'
C:/Ruby22-x64/lib/ruby/gems/2.2.0/gems/uglifier-3.0.0/lib/uglifier.rb:5:in `requ
ire'
C:/Ruby22-x64/lib/ruby/gems/2.2.0/gems/uglifier-3.0.0/lib/uglifier.rb:5:in `<top
(required)>'
C:/Ruby22-x64/lib/ruby/gems/2.2.0/gems/bundler-1.12.5/lib/bundler/runtime.rb:86:
in `require'
C:/Ruby22-x64/lib/ruby/gems/2.2.0/gems/bundler-1.12.5/lib/bundler/runtime.rb:86:
in `block (2 levels) in require'
C:/Ruby22-x64/lib/ruby/gems/2.2.0/gems/bundler-1.12.5/lib/bundler/runtime.rb:81:
in `each'
C:/Ruby22-x64/lib/ruby/gems/2.2.0/gems/bundler-1.12.5/lib/bundler/runtime.rb:81:
in `block in require'
C:/Ruby22-x64/lib/ruby/gems/2.2.0/gems/bundler-1.12.5/lib/bundler/runtime.rb:70:
in `each'
C:/Ruby22-x64/lib/ruby/gems/2.2.0/gems/bundler-1.12.5/lib/bundler/runtime.rb:70:
in `require'
C:/Ruby22-x64/lib/ruby/gems/2.2.0/gems/bundler-1.12.5/lib/bundler.rb:102:in `req
uire'
C:/Users/New User/sites2/learning_rails/config/application.rb:7:in `<top (requir
ed)>'
C:/Ruby22-x64/lib/ruby/site_ruby/2.2.0/rubygems/core_ext/kernel_require.rb:55:in
`require'
C:/Ruby22-x64/lib/ruby/site_ruby/2.2.0/rubygems/core_ext/kernel_require.rb:55:in
`require'
C:/Users/New User/sites2/learning_rails/Rakefile:4:in `<top (required)>'
C:/Ruby22-x64/lib/ruby/gems/2.2.0/gems/rake-11.1.2/lib/rake/rake_module.rb:28:in
`load'
C:/Ruby22-x64/lib/ruby/gems/2.2.0/gems/rake-11.1.2/lib/rake/rake_module.rb:28:in
`load_rakefile'
C:/Ruby22-x64/lib/ruby/gems/2.2.0/gems/rake-11.1.2/lib/rake/application.rb:689:i
n `raw_load_rakefile'
C:/Ruby22-x64/lib/ruby/gems/2.2.0/gems/rake-11.1.2/lib/rake/application.rb:94:in
`block in load_rakefile'
C:/Ruby22-x64/lib/ruby/gems/2.2.0/gems/rake-11.1.2/lib/rake/application.rb:176:i
n `standard_exception_handling'
C:/Ruby22-x64/lib/ruby/gems/2.2.0/gems/rake-11.1.2/lib/rake/application.rb:93:in
`load_rakefile'
C:/Ruby22-x64/lib/ruby/gems/2.2.0/gems/rake-11.1.2/lib/rake/application.rb:77:in
`block in run'
C:/Ruby22-x64/lib/ruby/gems/2.2.0/gems/rake-11.1.2/lib/rake/application.rb:176:i
n `standard_exception_handling'
C:/Ruby22-x64/lib/ruby/gems/2.2.0/gems/rake-11.1.2/lib/rake/application.rb:75:in
`run'
C:/Ruby22-x64/lib/ruby/gems/2.2.0/gems/rake-11.1.2/bin/rake:33:in `<top (require
d)>'
C:/Ruby22-x64/bin/rake:22:in `load'
C:/Ruby22-x64/bin/rake:22:in `<main>'
Bundler Error Backtrace:
C:/Users/New User/sites2/learning_rails/config/application.rb:7:in `<top (requir
ed)>'
C:/Users/New User/sites2/learning_rails/Rakefile:4:in `<top (required)>'
ExecJS::RuntimeUnavailable: Could not find a JavaScript runtime. See https://git
hub.com/rails/execjs for a list of available runtimes.
C:/Users/New User/sites2/learning_rails/config/application.rb:7:in `<top (requir
ed)>'
C:/Users/New User/sites2/learning_rails/Rakefile:4:in `<top (required)>'
(See full trace by running task with --trace)
install nodejs
Uglifier is JavaScript compressor, so it need javascript runtime try installing nodejs
apt-get install nodejs
or
brew install nodejs
if you are on a OSX.

sorcery occured error on rails4 on using mongoid gem

I wanna use sorcery gem using user authentication and mongid gem
add Gemfile to
gem 'sorcery'
$ bundle
$ rails g sorcery:install core reset_password
I was success using activerecord...
but mongoid not make defualt sorcery initial files..
why not make initial files
help expert persons :(
This is deprecated, in future versions you may need to `bundle binstub rails` to work around a system/bundle conflict.
/Users/user_name/.rvm/gems/ruby-2.1.0/gems/activesupport-4.1.0/lib/active_support/concern.rb:126:in `included': Cannot define multiple 'included' blocks for a Concern (ActiveSupport::Concern::MultipleIncludedBlocks)
from /Users/user_name/.rvm/gems/ruby-2.1.0/gems/sorcery-0.8.5/lib/sorcery.rb:73:in `block in <module:Sorcery>'
from /Users/user_name/.rvm/gems/ruby-2.1.0/gems/sorcery-0.8.5/lib/sorcery.rb:72:in `module_eval'
from /Users/user_name/.rvm/gems/ruby-2.1.0/gems/sorcery-0.8.5/lib/sorcery.rb:72:in `<module:Sorcery>'
from /Users/user_name/.rvm/gems/ruby-2.1.0/gems/sorcery-0.8.5/lib/sorcery.rb:1:in `<top (required)>'
from /Users/user_name/.rvm/gems/ruby-2.1.0/gems/bundler-1.6.2/lib/bundler/runtime.rb:76:in `require'
from /Users/user_name/.rvm/gems/ruby-2.1.0/gems/bundler-1.6.2/lib/bundler/runtime.rb:76:in `block (2 levels) in require'
from /Users/user_name/.rvm/gems/ruby-2.1.0/gems/bundler-1.6.2/lib/bundler/runtime.rb:72:in `each'
from /Users/user_name/.rvm/gems/ruby-2.1.0/gems/bundler-1.6.2/lib/bundler/runtime.rb:72:in `block in require'
from /Users/user_name/.rvm/gems/ruby-2.1.0/gems/bundler-1.6.2/lib/bundler/runtime.rb:61:in `each'
from /Users/user_name/.rvm/gems/ruby-2.1.0/gems/bundler-1.6.2/lib/bundler/runtime.rb:61:in `require'
from /Users/user_name/.rvm/gems/ruby-2.1.0/gems/bundler-1.6.2/lib/bundler.rb:132:in `require'
from /Users/user_name/Desktop/rails/project/config/application.rb:14:in `<top (required)>'
from /Users/user_name/.rvm/gems/ruby-2.1.0/gems/spring-1.1.3/lib/spring/application.rb:82:in `require'
from /Users/user_name/.rvm/gems/ruby-2.1.0/gems/spring-1.1.3/lib/spring/application.rb:82:in `preload'
from /Users/user_name/.rvm/gems/ruby-2.1.0/gems/spring-1.1.3/lib/spring/application.rb:140:in `serve'
from /Users/user_name/.rvm/gems/ruby-2.1.0/gems/spring-1.1.3/lib/spring/application.rb:128:in `block in run'
from /Users/user_name/.rvm/gems/ruby-2.1.0/gems/spring-1.1.3/lib/spring/application.rb:122:in `loop'
from /Users/user_name/.rvm/gems/ruby-2.1.0/gems/spring-1.1.3/lib/spring/application.rb:122:in `run'
from /Users/user_name/.rvm/gems/ruby-2.1.0/gems/spring-1.1.3/lib/spring/application/boot.rb:18:in `<top (required)>'
from /Users/user_name/.rvm/rubies/ruby-2.1.0/lib/ruby/site_ruby/2.1.0/rubygems/core_ext/kernel_require.rb:55:in `require'
from /Users/user_name/.rvm/rubies/ruby-2.1.0/lib/ruby/site_ruby/2.1.0/rubygems/core_ext/kernel_require.rb:55:in `require'

bundle console fails w/ uninitialized constant Rails

I have create a new Rails engine using the rails plugin new Foobar --full --mountable command. When running bundle console I get uninitialized constant Rails Why is this?
Resolving dependencies...
Unfortunately, a fatal error has occurred. Please see the Bundler troubleshooting documentation at http://bit.ly/bundler-issues. Thanks!
/Users/kyledecot/Desktop/Foobar/lib/foobar/engine.rb:2:in `<module:Foobar>': uninitialized constant Rails (NameError)
from /Users/kyledecot/Desktop/Foobar/lib/foobar/engine.rb:1:in `<top (required)>'
from /Users/kyledecot/Desktop/Foobar/lib/foobar.rb:1:in `require'
from /Users/kyledecot/Desktop/Foobar/lib/foobar.rb:1:in `<top (required)>'
from /Users/kyledecot/.rvm/gems/ruby-2.0.0-p353#global/gems/bundler-1.5.1/lib/bundler/runtime.rb:76:in `require'
from /Users/kyledecot/.rvm/gems/ruby-2.0.0-p353#global/gems/bundler-1.5.1/lib/bundler/runtime.rb:76:in `block (2 levels) in require'
from /Users/kyledecot/.rvm/gems/ruby-2.0.0-p353#global/gems/bundler-1.5.1/lib/bundler/runtime.rb:72:in `each'
from /Users/kyledecot/.rvm/gems/ruby-2.0.0-p353#global/gems/bundler-1.5.1/lib/bundler/runtime.rb:72:in `block in require'
from /Users/kyledecot/.rvm/gems/ruby-2.0.0-p353#global/gems/bundler-1.5.1/lib/bundler/runtime.rb:61:in `each'
from /Users/kyledecot/.rvm/gems/ruby-2.0.0-p353#global/gems/bundler-1.5.1/lib/bundler/runtime.rb:61:in `require'
from /Users/kyledecot/.rvm/gems/ruby-2.0.0-p353#global/gems/bundler-1.5.1/lib/bundler.rb:131:in `require'
from /Users/kyledecot/.rvm/gems/ruby-2.0.0-p353#global/gems/bundler-1.5.1/lib/bundler/cli.rb:664:in `console'
from /Users/kyledecot/.rvm/gems/ruby-2.0.0-p353#global/gems/bundler-1.5.1/lib/bundler/vendor/thor/command.rb:27:in `run'
from /Users/kyledecot/.rvm/gems/ruby-2.0.0-p353#global/gems/bundler-1.5.1/lib/bundler/vendor/thor/invocation.rb:120:in `invoke_command'
from /Users/kyledecot/.rvm/gems/ruby-2.0.0-p353#global/gems/bundler-1.5.1/lib/bundler/vendor/thor.rb:363:in `dispatch'
from /Users/kyledecot/.rvm/gems/ruby-2.0.0-p353#global/gems/bundler-1.5.1/lib/bundler/vendor/thor/base.rb:438:in `start'
from /Users/kyledecot/.rvm/gems/ruby-2.0.0-p353#global/gems/bundler-1.5.1/lib/bundler/cli.rb:10:in `start'
from /Users/kyledecot/.rvm/gems/ruby-2.0.0-p353#global/gems/bundler-1.5.1/bin/bundle:22:in `block in <top (required)>'
from /Users/kyledecot/.rvm/gems/ruby-2.0.0-p353#global/gems/bundler-1.5.1/lib/bundler/friendly_errors.rb:5:in `with_friendly_errors'
from /Users/kyledecot/.rvm/gems/ruby-2.0.0-p353#global/gems/bundler-1.5.1/bin/bundle:22:in `<top (required)>'
from /Users/kyledecot/.rvm/gems/ruby-2.0.0-p353#global/bin/bundle:23:in `load'
from /Users/kyledecot/.rvm/gems/ruby-2.0.0-p353#global/bin/bundle:23:in `<main>'
from /Users/kyledecot/.rvm/gems/ruby-2.0.0-p353#foobar/bin/ruby_executable_hooks:15:in `eval'
from /Users/kyledecot/.rvm/gems/ruby-2.0.0-p353#foobar/bin/ruby_executable_hooks:15:in `<main>'
Adding require 'rails' in Foobar/lib/foobar/engine.rb file worked for me. I got my answer from here.

rake command gets "cannot load such file -- yaml/encoding"

I want to use ruby-1.9.3-p194 on CentOS 5.8. I could install it with rvm and also system (libyaml and libyaml-devel were installed). But I can't run all of 'rake' tasks (not only 'rake spec').
I got "cannot load such file -- yaml/encoding". It's a sample result with trace. The 'rake' version is '0.9.2.2'. How can I resolve it?
$ rake spec --trace
rake aborted!
cannot load such file -- yaml/encoding
/home/inohiro/.rvm/gems/ruby-1.9.3-p194/gems/activesupport-2.3.14/lib/active_support/dependencies.rb:182:in `require'
/home/inohiro/.rvm/gems/ruby-1.9.3-p194/gems/activesupport-2.3.14/lib/active_support/dependencies.rb:182:in `block in require'
/home/inohiro/.rvm/gems/ruby-1.9.3-p194/gems/activesupport-2.3.14/lib/active_support/dependencies.rb:547:in `new_constants_in'
/home/inohiro/.rvm/gems/ruby-1.9.3-p194/gems/activesupport-2.3.14/lib/active_support/dependencies.rb:182:in `require'
/home/inohiro/Projects/rails_2_3_14_r5066/src/admin/lib/tasks/fixture_dump.rake:2:in `<top (required)>'
/home/inohiro/.rvm/gems/ruby-1.9.3-p194/gems/activesupport-2.3.14/lib/active_support/dependencies.rb:171:in `load'
/home/inohiro/.rvm/gems/ruby-1.9.3-p194/gems/activesupport-2.3.14/lib/active_support/dependencies.rb:171:in `block in load_with_new_constant_marking'
/home/inohiro/.rvm/gems/ruby-1.9.3-p194/gems/activesupport-2.3.14/lib/active_support/dependencies.rb:547:in `new_constants_in'
/home/inohiro/.rvm/gems/ruby-1.9.3-p194/gems/activesupport-2.3.14/lib/active_support/dependencies.rb:171:in `load_with_new_constant_marking'
/home/inohiro/.rvm/gems/ruby-1.9.3-p194/gems/rails-2.3.14/lib/tasks/rails.rb:14:in `block in <top (required)>'
/home/inohiro/.rvm/gems/ruby-1.9.3-p194/gems/rails-2.3.14/lib/tasks/rails.rb:14:in `each'
/home/inohiro/.rvm/gems/ruby-1.9.3-p194/gems/rails-2.3.14/lib/tasks/rails.rb:14:in `<top (required)>'
/home/inohiro/Projects/rails_2_3_14_r5066/src/admin/Rakefile:10:in `require'
/home/inohiro/Projects/rails_2_3_14_r5066/src/admin/Rakefile:10:in `<top (required)>'
/home/inohiro/.rvm/gems/ruby-1.9.3-p194/gems/rake-0.9.2.2/lib/rake/rake_module.rb:25:in `load'
/home/inohiro/.rvm/gems/ruby-1.9.3-p194/gems/rake-0.9.2.2/lib/rake/rake_module.rb:25:in `load_rakefile'
/home/inohiro/.rvm/gems/ruby-1.9.3-p194/gems/rake-0.9.2.2/lib/rake/application.rb:501:in `raw_load_rakefile'
/home/inohiro/.rvm/gems/ruby-1.9.3-p194/gems/rake-0.9.2.2/lib/rake/application.rb:82:in `block in load_rakefile'
/home/inohiro/.rvm/gems/ruby-1.9.3-p194/gems/rake-0.9.2.2/lib/rake/application.rb:133:in `standard_exception_handling'
/home/inohiro/.rvm/gems/ruby-1.9.3-p194/gems/rake-0.9.2.2/lib/rake/application.rb:81:in `load_rakefile'
/home/inohiro/.rvm/gems/ruby-1.9.3-p194/gems/rake-0.9.2.2/lib/rake/application.rb:65:in `block in run'
/home/inohiro/.rvm/gems/ruby-1.9.3-p194/gems/rake-0.9.2.2/lib/rake/application.rb:133:in `standard_exception_handling'
/home/inohiro/.rvm/gems/ruby-1.9.3-p194/gems/rake-0.9.2.2/lib/rake/application.rb:63:in `run'
/home/inohiro/.rvm/gems/ruby-1.9.3-p194/gems/rake-0.9.2.2/bin/rake:33:in `<top (required)>'
/home/inohiro/.rvm/gems/ruby-1.9.3-p194/bin/rake:19:in `load'
/home/inohiro/.rvm/gems/ruby-1.9.3-p194/bin/rake:19:in `<main>'
It's not a rake problem, it's a ruby <=> rails version incompatibility. You're using the most recent stable version of ruby with the rails version from the era of dinosaurs.
You need to do some hacking in order for them to understand each other!
Here's a nice read that should get you started:
http://scottiestech.info/2012/02/07/make-rails-2-3-x-happy-with-ruby-1-9-3/
This gist also rocks:
https://gist.github.com/1976864 (thanks Jonathan!)

Why am I getting an error when I try to update my Heroku database?

Why am I getting an error when I try to update my Heroku database?
Whenever I try any heroku rake... command I get the same error:
$ heroku rake db:setup
(in /app)
rake aborted!
uninitialized constant Rake::DSL
/usr/ruby1.9.2/lib/ruby/1.9.1/rake.rb:2482:in `const_missing'
/app/.bundle/gems/ruby/1.9.1/gems/rake-0.9.2/lib/rake/tasklib.rb:8:in `<class:TaskLib>'
/app/.bundle/gems/ruby/1.9.1/gems/rake-0.9.2/lib/rake/tasklib.rb:6:in `<module:Rake>'
/app/.bundle/gems/ruby/1.9.1/gems/rake-0.9.2/lib/rake/tasklib.rb:3:in `<top (required)>'
/app/.bundle/gems/ruby/1.9.1/gems/rake-0.9.2/lib/rake/rdoctask.rb:20:in `require'
/app/.bundle/gems/ruby/1.9.1/gems/rake-0.9.2/lib/rake/rdoctask.rb:20:in `<top (required)>'
/app/.bundle/gems/ruby/1.9.1/gems/railties-3.0.8/lib/rails/tasks/documentation.rake:1:in `require'
/app/.bundle/gems/ruby/1.9.1/gems/railties-3.0.8/lib/rails/tasks/documentation.rake:1:in `<top (required)>'
/app/.bundle/gems/ruby/1.9.1/gems/railties-3.0.8/lib/rails/tasks.rb:15:in `load'
/app/.bundle/gems/ruby/1.9.1/gems/railties-3.0.8/lib/rails/tasks.rb:15:in `block in <top (required)>'
/app/.bundle/gems/ruby/1.9.1/gems/railties-3.0.8/lib/rails/tasks.rb:6:in `each'
/app/.bundle/gems/ruby/1.9.1/gems/railties-3.0.8/lib/rails/tasks.rb:6:in `<top (required)>'
/app/.bundle/gems/ruby/1.9.1/gems/railties-3.0.8/lib/rails/application.rb:215:in `require'
/app/.bundle/gems/ruby/1.9.1/gems/railties-3.0.8/lib/rails/application.rb:215:in `initialize_tasks'
/app/.bundle/gems/ruby/1.9.1/gems/railties-3.0.8/lib/rails/application.rb:139:in `load_tasks'
/app/.bundle/gems/ruby/1.9.1/gems/railties-3.0.8/lib/rails/application.rb:77:in `method_missing'
/app/Rakefile:7:in `<top (required)>'
/usr/ruby1.9.2/lib/ruby/1.9.1/rake.rb:2373:in `load'
/usr/ruby1.9.2/lib/ruby/1.9.1/rake.rb:2373:in `raw_load_rakefile'
/usr/ruby1.9.2/lib/ruby/1.9.1/rake.rb:2007:in `block in load_rakefile'
/usr/ruby1.9.2/lib/ruby/1.9.1/rake.rb:2058:in `standard_exception_handling'
/usr/ruby1.9.2/lib/ruby/1.9.1/rake.rb:2006:in `load_rakefile'
/usr/ruby1.9.2/lib/ruby/1.9.1/rake.rb:1991:in `run'
/usr/ruby1.9.2/bin/rake:31:in `<main>'
Rakefile should include
require 'rake/dsl_definition'
There are two ways to fix this. I have a blog post about it here:
Use an older rake version, or require DSL for the newer gem.
http://codeglot.com/posts/13-you_have_already_activated_rake_0_9_2.
sadly, including require 'rake/dsl_definition' did not work for me. I am using rails 3.0.6. So I reverted back to rake 0.8.7.

Resources