2011-09-29 114 views
2

我不知道爲什麼我得到這個?找不到耙0.9.2在任何來源

$ which rake 
/Users/kamilski81/.rvm/gems/[email protected]/bin/rake 
[~/Sites/work/depot, [email protected]] 
$ /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 gems. 

後,我做了一個「包安裝」我得到:

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 

,並安裝我的所有寶石到./rake我的根目錄的......煩了。

回答

7

看起來您在某個時間鍵入bundle install rake

bundle命令不採用gem的名稱進行安裝。相反,參數「rake」是您安裝捆綁寶石的文件夾的名稱。

如果您查看當前的項目文件夾,您將看到一個隱藏的.bundle目錄。其中的配置文件會跟蹤您如何設置捆綁軟件安裝選項,並記住您在下次運行捆綁軟件安裝時設置的目錄。最簡單的方法是從該配置文件中刪除該選項,然後在沒有第三個參數的情況下重新運行bundle install

這個問題的第二部分是,不同的捆綁軟件將安裝他們自己版本的命令,如rake。爲了運行正確的版本,請使用bundler運行bundle exec rake而不是rake

1

對於我補充說:

source 'https://rubygems.org' 

我Gemfile中解決了這個問題。出於某種原因,我以前刪除它。感謝Andrew最初提供.bundle目錄的提示。

+0

這爲我修好了。我知道我沒有從我的Gemfile中刪除它。我正在安裝畫布LMS。 – joshmmo

1

添加--development參數一次以安裝來自rubygems.org的所有開發依賴項。

所以,如果你想運行:

bundle exec rake build 

改爲運行:

bundle --development exec rake build 

你會看到正在安裝任何缺少發展的依賴性,包括rake 0.9.2

此後--development參數可以在重建時刪除。

請注意,這種方法也意味着你不需要需要添加source http://rubygems.org你寫的每一個寶石。

相關問題