Could not find rake-0.9.2.2 in any of the sources

It is odd. I get this error when I run rake to run tests, but not during migration. I run RVM, the shell dump below should provide any necessary information.

Any help would be greatly appreciated. I saw several other people with this problem, but no solutions that worked for me yet (or them).

Thanks.

$ rake Could not find rake-0.9.2.2 in any of the sources Run `bundle install` to install missing gems. Could not find rake-0.9.2.2 in any of the sources Run `bundle install` to install missing gems. Errors running test:units, test:functionals, test:integration! $ ruby -v ruby 1.9.3p194 (2012-04-20 revision 35410) [x86_64-darwin11.4.0] $ rails -v Rails 3.1.6 $ more .rvmrc rvm ruby-1.9.3-p194@... $ rake db:rollback == AddAllLocationsToAlert: reverting ========================================= -- remove_column(... -> 0.0320s == AddAllLocationsToAlert: reverted (0.0321s) ================================ 

------- EDIT ::

Since then I have updated to the latest version of Rails - 3.2.6. The error still occurs even if I use "bundle exec". (This is not new to 3.2.6 - I still ran into a problem in version 3.1). undefined newbie method.

 Your bundle is complete! Use `bundle show [gemname]` to see where a bundled gem is installed. $ bundle exec rake Could not find rake-0.9.2.2 in any of the sources Run `bundle install` to install missing gems. Could not find rake-0.9.2.2 in any of the sources Run `bundle install` to install missing gems. Errors running test:units! #<NoMethodError: undefined method `[]' for nil:NilClass> Errors running test:functionals! #<RuntimeError: Command failed with status (7): [/Users/ben/.rvm/rubies/ruby-1.9.3-p194/bin...]> Errors running test:integration! #<RuntimeError: Command failed with status (7): [/Users/ben/.rvm/rubies/ruby-1.9.3-p194/bin...]> 

My Gemfile, upon request:

 source 'http://rubygems.org' gem 'rails', '3.2.6' group :assets do gem 'sass-rails', " ~> 3.2.5" gem 'coffee-rails', "~> 3.2.1" gem 'uglifier', '>= 1.2.6' end gem 'jquery-rails' gem 'rake' gem "mysql2" gem "squeel" gem 'tinymce-rails' gem 'dynamic_form' gem 'will_paginate' gem 'devise' gem 'whitelist' gem 'rmagick' gem 'json' gem 'paperclip' gem 'acts_as_list', :git => 'https://github.com/swanandp/acts_as_list' gem 'htmlentities' gem 'formtastic' # Bundle gems for the local environment. Make sure to # put test-only gems in this group so their generators # and rake tasks are available in development mode: # group :development, :test do # gem 'webrat' # end 
+4
source share
2 answers

gem 'rake', "> = 0.9.2" # in your Gemfile

then

$ bundle install

then

$ bundle exec rake

if above does not work:

$ rvm all do gem install rake -v 0.9.2.2 # install rake in all ruby โ€‹โ€‹versions

then rake again

+3
source

If you are using bundler (and with rails, probably you are), always run rake like this:

bundle exec rake

This will pick up the gems specified in your gemfile.

0
source

All Articles