2014-05-03 39 views
1

我試圖在Ruby on Rails4中進行搜索,但沒有奏效。 當我在我的Mac中首先安裝的Ruby時,沒有錯誤。 但我安裝rbenv後,發生此錯誤。 我該如何解決這個問題?Rake在Rails4中不起作用

$ bundle exec rake assets:precompile 
/Library/Ruby/Gems/2.0.0/gems/bundler-1.5.3/lib/bundler/runtime.rb:220: warning: Insecure world writable dir /usr/local in PATH, mode 040777 
/Library/Ruby/Gems/2.0.0/gems/bundler-1.5.3/lib/bundler/spec_set.rb:92:in `block in materialize': Could not find rake-10.3.1 in any of the sources (Bundler::GemNotFound) 
from /Library/Ruby/Gems/2.0.0/gems/bundler-1.5.3/lib/bundler/spec_set.rb:85:in `map!' 
from /Library/Ruby/Gems/2.0.0/gems/bundler-1.5.3/lib/bundler/spec_set.rb:85:in `materialize' 
from /Library/Ruby/Gems/2.0.0/gems/bundler-1.5.3/lib/bundler/definition.rb:133:in `specs' 
from /Library/Ruby/Gems/2.0.0/gems/bundler-1.5.3/lib/bundler/definition.rb:178:in `specs_for' 
from /Library/Ruby/Gems/2.0.0/gems/bundler-1.5.3/lib/bundler/definition.rb:167:in `requested_specs' 
from /Library/Ruby/Gems/2.0.0/gems/bundler-1.5.3/lib/bundler/environment.rb:18:in `requested_specs' 
from /Library/Ruby/Gems/2.0.0/gems/bundler-1.5.3/lib/bundler/runtime.rb:13:in `setup' 
from /Library/Ruby/Gems/2.0.0/gems/bundler-1.5.3/lib/bundler.rb:119:in `setup' 
from /Library/Ruby/Gems/2.0.0/gems/bundler-1.5.3/lib/bundler/setup.rb:17:in `<top (required)>' 
from /Users/Fumiya/.rbenv/versions/2.1.1/lib/ruby/2.1.0/rubygems/core_ext/kernel_require.rb:55:in `require' 
from /Users/Fumiya/.rbenv/versions/2.1.1/lib/ruby/2.1.0/rubygems/core_ext/kernel_require.rb:55:in `require' 
+0

它說'找不到耙10.3.1任何來源'。你運行'捆綁安裝'? – gotva

+0

我已經完成了... 在Gem列表上,它顯示「使用rake(10.3.1)」 – Fumiya

+0

什麼'bundle show rake'返回? – gotva

回答

3

指定您的Gemfile

gem 'rake', '10.3.1' 

然後

bundle install 

,做

bundle exec rake assets:precompile 
+0

我已經這樣做了,rake-10.3.1在寶石名單。但是當我運行耙子時,錯誤發生了......我該怎麼辦......? – Fumiya