开发者

Could not find rake-0.9.2 in any of the sources

I have no idea why I am getting this?

$ which rake
/Users/kamilski81/.rvm/gems/ruby-1.9.2-p290@depot/bin/rake
[~/Sites/work/depot, kamilski81@mac]
$ /Users/kamilski81/.rvm/gems/ruby-1.9.2-p290\@depot/bin/rake test
Could not find rake-0.9.2 in any of the sources
Run `bundle install` to install missing gem开发者_JAVA技巧s.

After I do a "bundle install" I get :

Installing sqlite3 (1.3.4) with native extensions 
Installing turn (0.8.2) 
Installing uglifier (1.0.3) 
Updating .gem files in vendor/cache
Your bundle is complete! It was installed into ./rake

and all my gems are installed into ./rake of my root dir...pretty annoying.


It looks like you typed bundle install rake at some point.

The bundle command doesn't take the name of a gem to install. Instead, the parameter "rake" is the name of the folder that you install your bundled gems into.

If you look in your current project folder, you will see a hidden .bundle directory. The config file in there keeps track of how you set up your bundle install options, and it remembers the directory you set for the next time you run bundle install. The easiest thing to do is to remove the option from that config file, and re-run bundle install without a third parameter.

The second part of this issue is that different bundles will install their own version of the commands such as rake. In order to run the correct version, have bundler run it for you by running bundle exec rake instead of just rake.


For me adding:

source 'https://rubygems.org'

to my Gemfile solved the problem. For some reason I removed it previously. Thanks to Andrew for the tip initially with the .bundle directory.


Add the --development parameter once to install all development dependencies from rubygems.org .

So if you're trying to run:

bundle exec rake build

Instead run:

bundle --development exec rake build

You'll see any missing development dependencies being installed, including rake 0.9.2.

Thereafter the --development parameter can be removed when you rebuild.

Note that this method also means you don't need to add source http://rubygems.org to every gem you write.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜