Uninitialized constant Encoding with sqlite3-ruby on windows - ruby-on-rails

On a new machine, installed ruby with the 1-click installer for windows. Installed rails 2.3.2 and all associated gems, then I installed the sqlite3 binaries (into the c:\ruby\bin folder). Lastly I did gem install sqlite3-ruby -v=1.2.3 (which is apparently the latest version that works with windows)
This error happens when I run rake db:migrate or when any ActiveRecord object is touched at runtime.
The error looks like this:
** Invoke db:migrate (first_time)
** Invoke environment (first_time)
** Execute environment
** Execute db:migrate
rake aborted!
**uninitialized constant Encoding** <----
Any help resolving this error would be greatly appreciated!
Trace:
C:/Ruby/lib/ruby/gems/1.8/gems/activesupport-2.3.2/lib/active_support/dependencies.rb:443:in `load_missing_constant'
C:/Ruby/lib/ruby/gems/1.8/gems/activesupport-2.3.2/lib/active_support/dependencies.rb:80:in `const_missing'
C:/Ruby/lib/ruby/gems/1.8/gems/activesupport-2.3.2/lib/active_support/dependencies.rb:92:in `const_missing'
C:/Ruby/lib/ruby/gems/1.8/gems/sqlite3-0.0.3/lib/sqlite3/encoding.rb:9:in `find'
C:/Ruby/lib/ruby/gems/1.8/gems/sqlite3-0.0.3/lib/sqlite3/database.rb:69:in `initialize'
C:/Ruby/lib/ruby/gems/1.8/gems/activerecord-2.3.2/lib/active_record/connection_adapters/sqlite3_adapter.rb:13:in `new'
C:/Ruby/lib/ruby/gems/1.8/gems/activerecord-2.3.2/lib/active_record/connection_adapters/sqlite3_adapter.rb:13:in `sqlite3_connection'
C:/Ruby/lib/ruby/gems/1.8/gems/activerecord-2.3.2/lib/active_record/connection_adapters/abstract/connection_pool.rb:223:in `send'
C:/Ruby/lib/ruby/gems/1.8/gems/activerecord-2.3.2/lib/active_record/connection_adapters/abstract/connection_pool.rb:223:in `new_connection'
C:/Ruby/lib/ruby/gems/1.8/gems/activerecord-2.3.2/lib/active_record/connection_adapters/abstract/connection_pool.rb:245:in `checkout_new_connection'
C:/Ruby/lib/ruby/gems/1.8/gems/activerecord-2.3.2/lib/active_record/connection_adapters/abstract/connection_pool.rb:188:in `checkout'
C:/Ruby/lib/ruby/gems/1.8/gems/activerecord-2.3.2/lib/active_record/connection_adapters/abstract/connection_pool.rb:184:in `loop'
C:/Ruby/lib/ruby/gems/1.8/gems/activerecord-2.3.2/lib/active_record/connection_adapters/abstract/connection_pool.rb:184:in `checkout'
C:/Ruby/lib/ruby/1.8/monitor.rb:242:in `synchronize'
C:/Ruby/lib/ruby/gems/1.8/gems/activerecord-2.3.2/lib/active_record/connection_adapters/abstract/connection_pool.rb:183:in `checkout'
C:/Ruby/lib/ruby/gems/1.8/gems/activerecord-2.3.2/lib/active_record/connection_adapters/abstract/connection_pool.rb:98:in `connection'
C:/Ruby/lib/ruby/gems/1.8/gems/activerecord-2.3.2/lib/active_record/connection_adapters/abstract/connection_pool.rb:326:in `retrieve_connection'
C:/Ruby/lib/ruby/gems/1.8/gems/activerecord-2.3.2/lib/active_record/connection_adapters/abstract/connection_specification.rb:123:in `retrieve_connection'
C:/Ruby/lib/ruby/gems/1.8/gems/activerecord-2.3.2/lib/active_record/connection_adapters/abstract/connection_specification.rb:115:in `connection'
C:/Ruby/lib/ruby/gems/1.8/gems/activerecord-2.3.2/lib/active_record/migration.rb:435:in `initialize'
C:/Ruby/lib/ruby/gems/1.8/gems/activerecord-2.3.2/lib/active_record/migration.rb:400:in `new'
C:/Ruby/lib/ruby/gems/1.8/gems/activerecord-2.3.2/lib/active_record/migration.rb:400:in `up'
C:/Ruby/lib/ruby/gems/1.8/gems/activerecord-2.3.2/lib/active_record/migration.rb:383:in `migrate'
C:/Ruby/lib/ruby/gems/1.8/gems/rails-2.3.2/lib/tasks/databases.rake:116
C:/Ruby/lib/ruby/gems/1.8/gems/rake-0.8.7/lib/rake.rb:636:in `call'
C:/Ruby/lib/ruby/gems/1.8/gems/rake-0.8.7/lib/rake.rb:636:in `execute'
C:/Ruby/lib/ruby/gems/1.8/gems/rake-0.8.7/lib/rake.rb:631:in `each'
C:/Ruby/lib/ruby/gems/1.8/gems/rake-0.8.7/lib/rake.rb:631:in `execute'
C:/Ruby/lib/ruby/gems/1.8/gems/rake-0.8.7/lib/rake.rb:597:in `invoke_with_call_chain'
C:/Ruby/lib/ruby/1.8/monitor.rb:242:in `synchronize'
C:/Ruby/lib/ruby/gems/1.8/gems/rake-0.8.7/lib/rake.rb:590:in `invoke_with_call_chain'
C:/Ruby/lib/ruby/gems/1.8/gems/rake-0.8.7/lib/rake.rb:583:in `invoke'
C:/Ruby/lib/ruby/gems/1.8/gems/rake-0.8.7/lib/rake.rb:2051:in `invoke_task'
C:/Ruby/lib/ruby/gems/1.8/gems/rake-0.8.7/lib/rake.rb:2029:in `top_level'
C:/Ruby/lib/ruby/gems/1.8/gems/rake-0.8.7/lib/rake.rb:2029:in `each'
C:/Ruby/lib/ruby/gems/1.8/gems/rake-0.8.7/lib/rake.rb:2029:in `top_level'
C:/Ruby/lib/ruby/gems/1.8/gems/rake-0.8.7/lib/rake.rb:2068:in `standard_exception_handling'
C:/Ruby/lib/ruby/gems/1.8/gems/rake-0.8.7/lib/rake.rb:2023:in `top_level'
C:/Ruby/lib/ruby/gems/1.8/gems/rake-0.8.7/lib/rake.rb:2001:in `run'
C:/Ruby/lib/ruby/gems/1.8/gems/rake-0.8.7/lib/rake.rb:2068:in `standard_exception_handling'
C:/Ruby/lib/ruby/gems/1.8/gems/rake-0.8.7/lib/rake.rb:1998:in `run'
C:/Ruby/lib/ruby/gems/1.8/gems/rake-0.8.7/bin/rake:31
C:/Ruby/bin/rake:19:in `load'
C:/Ruby/bin/rake:19

If you look at the backtrace will noticed that the issue is not sqlite3-ruby but another gem you have installed:
C:/Ruby/lib/ruby/gems/1.8/gems/sqlite3-0.0.3/lib/sqlite3/encoding.rb:9:in `find'
C:/Ruby/lib/ruby/gems/1.8/gems/sqlite3-0.0.3/lib/sqlite3/database.rb:69:in `initialize'
Please uninstall sqlite3 gem (gem uninstall sqlite3) since seems interfering with the loading mechanism.
The sqlite3-ruby gem version 1.2.5 has been updated for Windows and should work out of the box.
I recommend reading the tutorials of the new RubyInstaller that replaces One-Click:
Tutorials
And also install latest RC1 version, instead of One-Click from here
Hope this helps.

Related

rails 2.2 with ruby 1.9.2 undefined method `source_index' for Gem:Module

I am try to setup the development env for my rails 2 application using ruby 1.9.2.
While I am giving rake db:create command I got the following error.
I also change the version to 1.8.7 then also getting the same error
rake aborted!
undefined method `source_index' for Gem:Module
/home/dharin/.rvm/gems/ruby-1.9.2-p320/gems/rails-2.2.2/lib/rails/gem_dependency.rb:21:in `add_frozen_gem_path'
/home/dharin/.rvm/gems/ruby-1.9.2-p320/gems/rails-2.2.2/lib/initializer.rb:273:in `add_gem_load_paths'
/home/dharin/.rvm/gems/ruby-1.9.2-p320/gems/rails-2.2.2/lib/initializer.rb:131:in `process'
/home/dharin/.rvm/gems/ruby-1.9.2-p320/gems/rails-2.2.2/lib/initializer.rb:112:in `run'
/home/dharin/rails_projects/hesistudy_dev/config/environment.rb:24:in `<top (required)>'
/home/dharin/.rvm/gems/ruby-1.9.2-p320/gems/activesupport-2.2.2/lib/active_support/dependencies.rb:153:in `require'
/home/dharin/.rvm/gems/ruby-1.9.2-p320/gems/activesupport-2.2.2/lib/active_support/dependencies.rb:153:in `block in require'
/home/dharin/.rvm/gems/ruby-1.9.2-p320/gems/activesupport-2.2.2/lib/active_support/dependencies.rb:521:in `new_constants_in'
/home/dharin/.rvm/gems/ruby-1.9.2-p320/gems/activesupport-2.2.2/lib/active_support/dependencies.rb:153:in `require'
/home/dharin/.rvm/gems/ruby-1.9.2-p320/gems/rails-2.2.2/lib/tasks/misc.rake:3:in `block in <top (required)>'
/home/dharin/.rvm/rubies/ruby-1.9.2-p320/lib/ruby/1.9.1/rake.rb:634:in `call'
/home/dharin/.rvm/rubies/ruby-1.9.2-p320/lib/ruby/1.9.1/rake.rb:634:in `block in execute'
/home/dharin/.rvm/rubies/ruby-1.9.2-p320/lib/ruby/1.9.1/rake.rb:629:in `each'
/home/dharin/.rvm/rubies/ruby-1.9.2-p320/lib/ruby/1.9.1/rake.rb:629:in `execute'
/home/dharin/.rvm/rubies/ruby-1.9.2-p320/lib/ruby/1.9.1/rake.rb:595:in `block in invoke_with_call_chain'
/home/dharin/.rvm/rubies/ruby-1.9.2-p320/lib/ruby/1.9.1/monitor.rb:201:in `mon_synchronize'
/home/dharin/.rvm/rubies/ruby-1.9.2-p320/lib/ruby/1.9.1/rake.rb:588:in `invoke_with_call_chain'
/home/dharin/.rvm/rubies/ruby-1.9.2-p320/lib/ruby/1.9.1/rake.rb:605:in `block in invoke_prerequisites'
/home/dharin/.rvm/rubies/ruby-1.9.2-p320/lib/ruby/1.9.1/rake.rb:602:in `each'
/home/dharin/.rvm/rubies/ruby-1.9.2-p320/lib/ruby/1.9.1/rake.rb:602:in `invoke_prerequisites'
/home/dharin/.rvm/rubies/ruby-1.9.2-p320/lib/ruby/1.9.1/rake.rb:594:in `block in invoke_with_call_chain'
/home/dharin/.rvm/rubies/ruby-1.9.2-p320/lib/ruby/1.9.1/monitor.rb:201:in `mon_synchronize'
/home/dharin/.rvm/rubies/ruby-1.9.2-p320/lib/ruby/1.9.1/rake.rb:588:in `invoke_with_call_chain'
/home/dharin/.rvm/rubies/ruby-1.9.2-p320/lib/ruby/1.9.1/rake.rb:581:in `invoke'
/home/dharin/.rvm/rubies/ruby-1.9.2-p320/lib/ruby/1.9.1/rake.rb:2041:in `invoke_task'
/home/dharin/.rvm/rubies/ruby-1.9.2-p320/lib/ruby/1.9.1/rake.rb:2019:in `block (2 levels) in top_level'
/home/dharin/.rvm/rubies/ruby-1.9.2-p320/lib/ruby/1.9.1/rake.rb:2019:in `each'
/home/dharin/.rvm/rubies/ruby-1.9.2-p320/lib/ruby/1.9.1/rake.rb:2019:in `block in top_level'
/home/dharin/.rvm/rubies/ruby-1.9.2-p320/lib/ruby/1.9.1/rake.rb:2058:in `standard_exception_handling'
/home/dharin/.rvm/rubies/ruby-1.9.2-p320/lib/ruby/1.9.1/rake.rb:2013:in `top_level'
/home/dharin/.rvm/rubies/ruby-1.9.2-p320/lib/ruby/1.9.1/rake.rb:1992:in `run'
/home/dharin/.rvm/rubies/ruby-1.9.2-p320/bin/rake:31:in `<main>'
Ruby 1.9.2 isn't that new, you should use 1.9.3-p448. Rubygems 1.8.25 is very old, and should be used with Ruby 1.8 only AFAIK. You are probably using a very old distro. Try using rvm to install the latest Ruby 1.9 and Rubygems. Here's a brief quick-start guide. Refer to the docs in case of troubles.
\curl -L https://get.rvm.io | bash -s stable
rvm install 1.9
rvm use 1.9 --default
rvm rubygems latest --verify-downloads 1
gem install bundler
bundle exec ./script/server

Getting undefined method `name' for "actionmailer":String when installing Webistrano

When I try and run a RAKE on Webistrano I get the following error:
undefined method `name' for "actionmailer":String`
I am a not proficient in Ruby and RoR but I have installed and played about with plenty of applications before and I can't find what the issue is.
The command I am running is:
RAILS_ENV=production rake db:migrate --trace
Which produces the below:
I would really like to know the best way to diagnose and fix this issue and issues like it in the future.
(in /srv/www/webistrano)
WARNING: 'require 'rake/rdoctask'' is deprecated. Please use 'require 'rdoc/task' (in RDoc 2.4.2+)' instead.
at /usr/local/lib/ruby/gems/1.9.1/gems/rake-0.9.2.2/lib/rake/rdoctask.rb
** Invoke db:migrate (first_time)
** Invoke environment (first_time)
** Execute environment
rake aborted!
undefined method `name' for "actionmailer":String
/srv/www/webistrano/vendor/rails/railties/lib/rails/gem_dependency.rb:268:in `=='
/usr/local/lib/ruby/site_ruby/1.9.1/rubygems/dependency.rb:217:in `==='
/usr/local/lib/ruby/site_ruby/1.9.1/rubygems/dependency.rb:217:in `block in matching_specs'
/usr/local/lib/ruby/site_ruby/1.9.1/rubygems/specification.rb:411:in `block in each'
/usr/local/lib/ruby/site_ruby/1.9.1/rubygems/specification.rb:410:in `each'
/usr/local/lib/ruby/site_ruby/1.9.1/rubygems/specification.rb:410:in `each'
/usr/local/lib/ruby/site_ruby/1.9.1/rubygems/dependency.rb:216:in `find_all'
/usr/local/lib/ruby/site_ruby/1.9.1/rubygems/dependency.rb:216:in `matching_specs'
/usr/local/lib/ruby/site_ruby/1.9.1/rubygems/dependency.rb:238:in `to_specs'
/usr/local/lib/ruby/site_ruby/1.9.1/rubygems/dependency.rb:256:in `to_spec'
/usr/local/lib/ruby/site_ruby/1.9.1/rubygems.rb:1231:in `gem'
/srv/www/webistrano/vendor/rails/railties/lib/rails/gem_dependency.rb:73:in `add_load_paths'
/srv/www/webistrano/vendor/rails/railties/lib/initializer.rb:301:in `block in add_gem_load_paths'
/srv/www/webistrano/vendor/rails/railties/lib/initializer.rb:301:in `each'
/srv/www/webistrano/vendor/rails/railties/lib/initializer.rb:301:in `add_gem_load_paths'
/srv/www/webistrano/vendor/rails/railties/lib/initializer.rb:132:in `process'
/srv/www/webistrano/vendor/rails/railties/lib/initializer.rb:113:in `run'
/srv/www/webistrano/config/environment.rb:16:in `<top (required)>'
/usr/local/lib/ruby/site_ruby/1.9.1/rubygems/custom_require.rb:36:in `require'
/usr/local/lib/ruby/site_ruby/1.9.1/rubygems/custom_require.rb:36:in `require'
/srv/www/webistrano/vendor/rails/activesupport/lib/active_support/dependencies.rb:156:in `block in require'
/srv/www/webistrano/vendor/rails/activesupport/lib/active_support/dependencies.rb:521:in `new_constants_in'
/srv/www/webistrano/vendor/rails/activesupport/lib/active_support/dependencies.rb:156:in `require'
/srv/www/webistrano/vendor/rails/railties/lib/tasks/misc.rake:4:in `block in <top (required)>'
/usr/local/lib/ruby/gems/1.9.1/gems/rake-0.9.2.2/lib/rake/task.rb:205:in `call'
/usr/local/lib/ruby/gems/1.9.1/gems/rake-0.9.2.2/lib/rake/task.rb:205:in `block in execute'
/usr/local/lib/ruby/gems/1.9.1/gems/rake-0.9.2.2/lib/rake/task.rb:200:in `each'
/usr/local/lib/ruby/gems/1.9.1/gems/rake-0.9.2.2/lib/rake/task.rb:200:in `execute'
/usr/local/lib/ruby/gems/1.9.1/gems/rake-0.9.2.2/lib/rake/task.rb:158:in `block in invoke_with_call_chain'
/usr/local/lib/ruby/1.9.1/monitor.rb:190:in `mon_synchronize'
/usr/local/lib/ruby/gems/1.9.1/gems/rake-0.9.2.2/lib/rake/task.rb:151:in `invoke_with_call_chain'
/usr/local/lib/ruby/gems/1.9.1/gems/rake-0.9.2.2/lib/rake/task.rb:176:in `block in invoke_prerequisites'
/usr/local/lib/ruby/gems/1.9.1/gems/rake-0.9.2.2/lib/rake/task.rb:174:in `each'
/usr/local/lib/ruby/gems/1.9.1/gems/rake-0.9.2.2/lib/rake/task.rb:174:in `invoke_prerequisites'
/usr/local/lib/ruby/gems/1.9.1/gems/rake-0.9.2.2/lib/rake/task.rb:157:in `block in invoke_with_call_chain'
/usr/local/lib/ruby/1.9.1/monitor.rb:190:in `mon_synchronize'
/usr/local/lib/ruby/gems/1.9.1/gems/rake-0.9.2.2/lib/rake/task.rb:151:in `invoke_with_call_chain'
/usr/local/lib/ruby/gems/1.9.1/gems/rake-0.9.2.2/lib/rake/task.rb:144:in `invoke'
/usr/local/lib/ruby/gems/1.9.1/gems/rake-0.9.2.2/lib/rake/application.rb:116:in `invoke_task'
/usr/local/lib/ruby/gems/1.9.1/gems/rake-0.9.2.2/lib/rake/application.rb:94:in `block (2 levels) in top_level'
/usr/local/lib/ruby/gems/1.9.1/gems/rake-0.9.2.2/lib/rake/application.rb:94:in `each'
/usr/local/lib/ruby/gems/1.9.1/gems/rake-0.9.2.2/lib/rake/application.rb:94:in `block in top_level'
/usr/local/lib/ruby/gems/1.9.1/gems/rake-0.9.2.2/lib/rake/application.rb:133:in `standard_exception_handling'
/usr/local/lib/ruby/gems/1.9.1/gems/rake-0.9.2.2/lib/rake/application.rb:88:in `top_level'
/usr/local/lib/ruby/gems/1.9.1/gems/rake-0.9.2.2/lib/rake/application.rb:66:in `block in run'
/usr/local/lib/ruby/gems/1.9.1/gems/rake-0.9.2.2/lib/rake/application.rb:133:in `standard_exception_handling'
/usr/local/lib/ruby/gems/1.9.1/gems/rake-0.9.2.2/lib/rake/application.rb:63:in `run'
/usr/local/lib/ruby/gems/1.9.1/gems/rake-0.9.2.2/bin/rake:33:in `<top (required)>'
/usr/local/bin/rake:23:in `load'
/usr/local/bin/rake:23:in `<main>'
Tasks: TOP => db:migrate => environment
When I run ruby -v I get the following:
ruby 1.9.1p376 (2009-12-07 revision 26041) [i686-linux]
I had this problem.
The solution is to downgrade rubygems to a version you support.
I needed version 1.3.5 (for rails 2.3.5)
So you need to do:
gem install rubygems-update -v 1.3.5
update_rubygems --version=1.3.5
And now rake should work.
This worked for me.
rvm rubygems 1.6.2

"stack level too deep" while compiling assets

After running brew upgrade, or something else which updated my gems/ruby version, my rake assets:precompile task no longer works.
I get this error:
rake aborted!
stack level too deep
(in /Users/Jordan/Development/reejay/rails/reejay/app/assets/stylesheets/blog_player.css.scss)
/Users/Jordan/.rvm/gems/ruby-1.9.2-p290/gems/rake-0.9.2.2/lib/rake/task.rb:162
Tasks: TOP => assets:precompile:primary
rake aborted!
Command failed with status (1): [/usr/local/Cellar/ruby/1.9.3-p0/bin/ruby /...]
/usr/local/Cellar/ruby/1.9.3-p0/lib/ruby/1.9.1/rake/file_utils.rb:53:in `block in create_shell_runner'
/usr/local/Cellar/ruby/1.9.3-p0/lib/ruby/1.9.1/rake/file_utils.rb:45:in `call'
/usr/local/Cellar/ruby/1.9.3-p0/lib/ruby/1.9.1/rake/file_utils.rb:45:in `sh'
/usr/local/Cellar/ruby/1.9.3-p0/lib/ruby/1.9.1/rake/file_utils_ext.rb:39:in `sh'
/usr/local/Cellar/ruby/1.9.3-p0/lib/ruby/1.9.1/rake/file_utils.rb:80:in `ruby'
/usr/local/Cellar/ruby/1.9.3-p0/lib/ruby/1.9.1/rake/file_utils_ext.rb:39:in `ruby'
/Users/Jordan/.rvm/gems/ruby-1.9.2-p290/gems/actionpack-3.1.1/lib/sprockets/assets.rake:9:in `ruby_rake_task'
/Users/Jordan/.rvm/gems/ruby-1.9.2-p290/gems/actionpack-3.1.1/lib/sprockets/assets.rake:17:in `invoke_or_reboot_rake_task'
/Users/Jordan/.rvm/gems/ruby-1.9.2-p290/gems/actionpack-3.1.1/lib/sprockets/assets.rake:25:in `block (2 levels) in <top (required)>'
/usr/local/Cellar/ruby/1.9.3-p0/lib/ruby/1.9.1/rake/task.rb:205:in `call'
/usr/local/Cellar/ruby/1.9.3-p0/lib/ruby/1.9.1/rake/task.rb:205:in `block in execute'
/usr/local/Cellar/ruby/1.9.3-p0/lib/ruby/1.9.1/rake/task.rb:200:in `each'
/usr/local/Cellar/ruby/1.9.3-p0/lib/ruby/1.9.1/rake/task.rb:200:in `execute'
/usr/local/Cellar/ruby/1.9.3-p0/lib/ruby/1.9.1/rake/task.rb:158:in `block in invoke_with_call_chain'
/usr/local/Cellar/ruby/1.9.3-p0/lib/ruby/1.9.1/monitor.rb:211:in `mon_synchronize'
/usr/local/Cellar/ruby/1.9.3-p0/lib/ruby/1.9.1/rake/task.rb:151:in `invoke_with_call_chain'
/usr/local/Cellar/ruby/1.9.3-p0/lib/ruby/1.9.1/rake/task.rb:144:in `invoke'
/usr/local/Cellar/ruby/1.9.3-p0/lib/ruby/1.9.1/rake/application.rb:116:in `invoke_task'
/usr/local/Cellar/ruby/1.9.3-p0/lib/ruby/1.9.1/rake/application.rb:94:in `block (2 levels) in top_level'
/usr/local/Cellar/ruby/1.9.3-p0/lib/ruby/1.9.1/rake/application.rb:94:in `each'
/usr/local/Cellar/ruby/1.9.3-p0/lib/ruby/1.9.1/rake/application.rb:94:in `block in top_level'
/usr/local/Cellar/ruby/1.9.3-p0/lib/ruby/1.9.1/rake/application.rb:133:in `standard_exception_handling'
/usr/local/Cellar/ruby/1.9.3-p0/lib/ruby/1.9.1/rake/application.rb:88:in `top_level'
/usr/local/Cellar/ruby/1.9.3-p0/lib/ruby/1.9.1/rake/application.rb:66:in `block in run'
/usr/local/Cellar/ruby/1.9.3-p0/lib/ruby/1.9.1/rake/application.rb:133:in `standard_exception_handling'
/usr/local/Cellar/ruby/1.9.3-p0/lib/ruby/1.9.1/rake/application.rb:63:in `run'
/usr/local/bin/rake:32:in `<main>'
Tasks: TOP => assets:precompile
Here is a link to my Gemfile: http://www.pastie.org/3019470
Other rake tasks, like db:migrate, continue to work as expected. This only affects the assets:precompile task.
(Repeating my comment from above, since it appears to have actually been the correct answer. For anyone who does not already use it: rvm, rvm, rvm. Learn it, love it.)
There's something very strange with a stack trace that references three different versions of ruby (1.9.1, 1.9.2, and 1.9.3). I would recommend installing rvm, creating a clean gemset, and trying this again.
This problem is probably caused by not having the latest version of rubygems installed.
If you did this: "gem update --system", it would have worked regardless of you using rvm or not.

Ruby on Rails mysql2 adapter problem

I have installed ruby and rails and my application gives me an error when I am trying to run
rake db:migrate
this is the result of the command rake db:migrate --trace
** Execute db:migrate
rake aborted!
!!! Missing the mysql2 gem. Add it to your Gemfile: gem 'mysql2'
/usr/lib/ruby/gems/1.9.1/gems/activerecord-3.0.6/lib/active_record/connection_adapters/mysql_adapter.rb:22:in `rescue in mysql_connection'
/usr/lib/ruby/gems/1.9.1/gems/activerecord-3.0.6/lib/active_record/connection_adapters/mysql_adapter.rb:19:in `mysql_connection'
/usr/lib/ruby/gems/1.9.1/gems/activerecord-3.0.6/lib/active_record/connection_adapters/abstract/connection_pool.rb:229:in `new_connection'
/usr/lib/ruby/gems/1.9.1/gems/activerecord-3.0.6/lib/active_record/connection_adapters/abstract/connection_pool.rb:237:in `checkout_new_connection'
/usr/lib/ruby/gems/1.9.1/gems/activerecord-3.0.6/lib/active_record/connection_adapters/abstract/connection_pool.rb:191:in `block (2 levels) in checkout'
/usr/lib/ruby/gems/1.9.1/gems/activerecord-3.0.6/lib/active_record/connection_adapters/abstract/connection_pool.rb:187:in `loop'
/usr/lib/ruby/gems/1.9.1/gems/activerecord-3.0.6/lib/active_record/connection_adapters/abstract/connection_pool.rb:187:in `block in checkout'
/usr/lib/ruby/1.9.1/monitor.rb:201:in `mon_synchronize'
/usr/lib/ruby/gems/1.9.1/gems/activerecord-3.0.6/lib/active_record/connection_adapters/abstract/connection_pool.rb:186:in `checkout'
/usr/lib/ruby/gems/1.9.1/gems/activerecord-3.0.6/lib/active_record/connection_adapters/abstract/connection_pool.rb:94:in `connection'
/usr/lib/ruby/gems/1.9.1/gems/ar-octopus-0.3.4/lib/octopus/proxy.rb:83:in `select_connection'
/usr/lib/ruby/gems/1.9.1/gems/ar-octopus-0.3.4/lib/octopus/proxy.rb:177:in `send_queries_to_selected_slave'
/usr/lib/ruby/gems/1.9.1/gems/ar-octopus-0.3.4/lib/octopus/proxy.rb:140:in `method_missing'
/usr/lib/ruby/gems/1.9.1/gems/activerecord-3.0.6/lib/active_record/migration.rb:454:in `get_all_versions'
/usr/lib/ruby/gems/1.9.1/gems/activerecord-3.0.6/lib/active_record/migration.rb:583:in `migrated'
/usr/lib/ruby/gems/1.9.1/gems/activerecord-3.0.6/lib/active_record/migration.rb:492:in `current_version'
/usr/lib/ruby/gems/1.9.1/gems/activerecord-3.0.6/lib/active_record/migration.rb:509:in `block in migrate'
/usr/lib/ruby/gems/1.9.1/gems/activerecord-3.0.6/lib/active_record/migration.rb:509:in `each'
/usr/lib/ruby/gems/1.9.1/gems/activerecord-3.0.6/lib/active_record/migration.rb:509:in `detect'
/usr/lib/ruby/gems/1.9.1/gems/activerecord-3.0.6/lib/active_record/migration.rb:509:in `migrate'
/usr/lib/ruby/gems/1.9.1/gems/activerecord-3.0.6/lib/active_record/migration.rb:433:in `up'
/usr/lib/ruby/gems/1.9.1/gems/activerecord-3.0.6/lib/active_record/migration.rb:415:in `migrate'
/usr/lib/ruby/gems/1.9.1/gems/activerecord-3.0.6/lib/active_record/railties/databases.rake:142:in `block (2 levels) in <top (required)>'
/usr/lib/ruby/gems/1.9.1/gems/rake-0.8.7/lib/rake.rb:636:in `call'
/usr/lib/ruby/gems/1.9.1/gems/rake-0.8.7/lib/rake.rb:636:in `block in execute'
/usr/lib/ruby/gems/1.9.1/gems/rake-0.8.7/lib/rake.rb:631:in `each'
/usr/lib/ruby/gems/1.9.1/gems/rake-0.8.7/lib/rake.rb:631:in `execute'
/usr/lib/ruby/gems/1.9.1/gems/rake-0.8.7/lib/rake.rb:597:in `block in invoke_with_call_chain'
/usr/lib/ruby/1.9.1/monitor.rb:201:in `mon_synchronize'
/usr/lib/ruby/gems/1.9.1/gems/rake-0.8.7/lib/rake.rb:590:in `invoke_with_call_chain'
/usr/lib/ruby/gems/1.9.1/gems/rake-0.8.7/lib/rake.rb:583:in `invoke'
/usr/lib/ruby/gems/1.9.1/gems/rake-0.8.7/lib/rake.rb:2051:in `invoke_task'
/usr/lib/ruby/gems/1.9.1/gems/rake-0.8.7/lib/rake.rb:2029:in `block (2 levels) in top_level'
/usr/lib/ruby/gems/1.9.1/gems/rake-0.8.7/lib/rake.rb:2029:in `each'
/usr/lib/ruby/gems/1.9.1/gems/rake-0.8.7/lib/rake.rb:2029:in `block in top_level'
/usr/lib/ruby/gems/1.9.1/gems/rake-0.8.7/lib/rake.rb:2068:in `standard_exception_handling'
/usr/lib/ruby/gems/1.9.1/gems/rake-0.8.7/lib/rake.rb:2023:in `top_level'
/usr/lib/ruby/gems/1.9.1/gems/rake-0.8.7/lib/rake.rb:2001:in `block in run'
/usr/lib/ruby/gems/1.9.1/gems/rake-0.8.7/lib/rake.rb:2068:in `standard_exception_handling'
/usr/lib/ruby/gems/1.9.1/gems/rake-0.8.7/lib/rake.rb:1998:in `run'
/usr/lib/ruby/gems/1.9.1/gems/rake-0.8.7/bin/rake:31:in `<top (required)>'
/usr/bin/rake:19:in `load'
/usr/bin/rake:19:in `<main>'
confiz#confiz-desktop:~/mango_apps/rails_app_sms$ .
bash: .: filename argument required
.: usage: . filename [arguments]
I have already mentioned gem in my gemfile and already executed bundle install.
My database.yml file already has the correct adapter i.e. adapter: mysql2
Please help me resolve this problem.
I find the same problem if I use mysql2 v 0.2.19b4 in my Gemfile. If I use the latest mysql2 this conflicts with rails 3.0.17 which is dictated by Hobo (which generated my Gemfile). The warning I get from that is:
This version of mysql2 (0.3.11) doesn't ship with the ActiveRecord adapter bundled anymore as it's now part of Rails 3.1. Please use the 0.2.x releases if you plan on using it in Rails <= 3.0.x
Going back to mysql2 v 0.2.x The original load error comes because the rails mysql_adapter calls require 'mysql' not require 'mysql2'.
The solution is to use gem 'mysql' not gem 'mysql2' in the Gemfile
In my case bundler users gem mysql v 2.8.1 and everything works fine.

Unable to run rake after updating rails versions

I have upgraded to rails 2.3.11 and and ruby 1.9.2 as some of my gems were incompatible with previous version. Now I am unable to execute rake command. I am getting following error when i do rake gems:install or rake db:migrate.
(in C:/Ruby/New/Facebook)
rake aborted!
can't convert Symbol into Integer
C:/Ruby192/lib/ruby/gems/1.9.1/gems/rails-2.3.11/lib/rails/gem_dependency.rb:53:
in `[]'
C:/Ruby192/lib/ruby/gems/1.9.1/gems/rails-2.3.11/lib/rails/gem_dependency.rb:53:
in `initialize'
C:/Ruby192/lib/ruby/gems/1.9.1/gems/rails-2.3.11/lib/initializer.rb:836:in `new'
C:/Ruby192/lib/ruby/gems/1.9.1/gems/rails-2.3.11/lib/initializer.rb:836:in `gem'
C:/Ruby/New/Facebook/config/environment.rb:22:in `block in <top (required)>'
C:/Ruby192/lib/ruby/gems/1.9.1/gems/rails-2.3.11/lib/initializer.rb:111:in `run'
C:/Ruby/New/Facebook/config/environment.rb:9:in `<top (required)>'
<internal:lib/rubygems/custom_require>:29:in `require'
<internal:lib/rubygems/custom_require>:29:in `require'
C:/Ruby192/lib/ruby/gems/1.9.1/gems/activesupport-2.3.11/lib/active_support/depe
ndencies.rb:182:in `block in require'
C:/Ruby192/lib/ruby/gems/1.9.1/gems/activesupport-2.3.11/lib/active_support/depe
ndencies.rb:547:in `new_constants_in'
C:/Ruby192/lib/ruby/gems/1.9.1/gems/activesupport-2.3.11/lib/active_support/depe
ndencies.rb:182:in `require'
C:/Ruby192/lib/ruby/gems/1.9.1/gems/rails-2.3.11/lib/tasks/misc.rake:4:in `block
in <top (required)>'
C:/Ruby192/lib/ruby/1.9.1/rake.rb:634:in `call'
C:/Ruby192/lib/ruby/1.9.1/rake.rb:634:in `block in execute'
C:/Ruby192/lib/ruby/1.9.1/rake.rb:629:in `each'
C:/Ruby192/lib/ruby/1.9.1/rake.rb:629:in `execute'
C:/Ruby192/lib/ruby/1.9.1/rake.rb:595:in `block in invoke_with_call_chain'
C:/Ruby192/lib/ruby/1.9.1/monitor.rb:201:in `mon_synchronize'
C:/Ruby192/lib/ruby/1.9.1/rake.rb:588:in `invoke_with_call_chain'
C:/Ruby192/lib/ruby/1.9.1/rake.rb:605:in `block in invoke_prerequisites'
C:/Ruby192/lib/ruby/1.9.1/rake.rb:602:in `each'
C:/Ruby192/lib/ruby/1.9.1/rake.rb:602:in `invoke_prerequisites'
C:/Ruby192/lib/ruby/1.9.1/rake.rb:594:in `block in invoke_with_call_chain'
C:/Ruby192/lib/ruby/1.9.1/monitor.rb:201:in `mon_synchronize'
C:/Ruby192/lib/ruby/1.9.1/rake.rb:588:in `invoke_with_call_chain'
C:/Ruby192/lib/ruby/1.9.1/rake.rb:581:in `invoke'
C:/Ruby192/lib/ruby/1.9.1/rake.rb:2041:in `invoke_task'
C:/Ruby192/lib/ruby/1.9.1/rake.rb:2019:in `block (2 levels) in top_level'
C:/Ruby192/lib/ruby/1.9.1/rake.rb:2019:in `each'
C:/Ruby192/lib/ruby/1.9.1/rake.rb:2019:in `block in top_level'
C:/Ruby192/lib/ruby/1.9.1/rake.rb:2058:in `standard_exception_handling'
C:/Ruby192/lib/ruby/1.9.1/rake.rb:2013:in `top_level'
C:/Ruby192/lib/ruby/1.9.1/rake.rb:1992:in `run'
C:/Ruby192/bin/rake:31:in `<main>'
Please help me as I am stuck on it for few days.
Looks like a Rake version issue to me. Try this...
gem uninstall rake # select all options
gem 'rake', '0.8.7' # Gemfile
bundle install
run you rake command
Placing this line of code in your .rvmrc in your root directory will allow you to skip little error like this in the future.
bundle exec $SHELL
All the best, let us know how you get on.
It's possible that you need to upgrade rubygems-update.
Run gem -v to see your current version number.
Run gem update --system to upgrade rubygems. (you may need to sudo depending on your setup)
To revert to your previous version, run gem update --system 1.3.7 (swap 1.3.7 for the previous version number)
You are suppose to resolve the conflicts of gems befre initiate rake. try running server if you get succeeded it means you can run Rake as well it has nothing to do with Rake version befre running rake make a valid gem list for rails.

Resources