Ruby: Could not find rake-0.9.2 in any of the sour

2019-09-14 22:33发布

问题:

Note: I retagged this question since I neglected to include the Aptana tag. The error occurs when choosing "run server" in Aptana Studio 3. Aptana tries to execute script/rails server, which results in the error below.

Perhaps an Aptana guru can answer?


I've looked through and tried the suggested solutions in all the similar questions I found. Most of the questions did not have an accepted answer.

I've started a fresh Rails project to start on a tutorial, and when I try to run the server, I get the infamous:

Could not find rake-0.9.2 in any of the sources

However, gem list shows:

rake (0.9.2, 0.8.7)

How can I be receiving this error when gem list clearly shows the gem is there?

How can I debug and resolve this issue?

My gemfile is:

gem 'rails', '3.0.4' 
gem 'sqlite3' 
gem 'sqlite3-ruby', :require =>'sqlite3'

回答1:

You need to require rake gem in your Gemfile

gem 'rails', '3.0.4' 
gem 'sqlite3' 
gem 'sqlite3-ruby', :require =>'sqlite3'
gem 'rake', '0.9.2'

now run bundle install make sure you are connected with internet. now if you want to execute rake tasks then use bundle exec rake task_name



回答2:

Actually, in a subsequent update of Apatana, this error went away. I now can run my application with the "Run Server" menu item again.

It's currently functional on Aptana 3.0.8.201201201658