2016-07-13 40 views
0

私はStackOverflowのを読んで、今2時間、このエラーに対処しようとしてきた:"bundle exec"にレーキがインストールされているのはなぜですか?

bundle exec rake db:setup 
    Could not find rake-10.4.2 in any of the sources 
    Run `bundle install` to install missing gems. 

私は無駄に、ここではアドバイスに従っ:

rails s: Could not find rake-10.4.2 in any of the sources (Bundler::GemNotFound)

をも:

Could not find rake with bundle exec

だから私はでした:

gem uninstall rake 
    gem install rake 

そして、私が読んで、他のStackOverflowの記事次、私が試した:私はバージョンを探している場合、コマンドラインで

rbenv install 2.3.1     
    Downloading ruby-2.3.1.tar.bz2... 
    -> https://cache.ruby-lang.org/pub/ruby/2.3/ruby-2.3.1.tar.bz2 
    Installing ruby-2.3.1... 
    Installed ruby-2.3.1 to /Users/lkrubner/.rbenv/versions/2.3.1 

    rbenv global 2.3.1 
    ruby -v 
    ruby 2.0.0p645 (2015-04-13 revision 50299) [universal.x86_64-darwin15] 



    bundle exec rake db:setup 
    Could not find rake-10.4.2 in any of the sources 
    Run `bundle install` to install missing gems. 

    rbenv rehash 
    rbenv uninstall rake 
    rbenv: version `rake' not installed 

を、私は以下を参照してください。

rake -V 
    rake, version 11.2.2 

    rails -v 
    Rails 4.2.0 

    ruby -v 
    ruby 2.0.0p645 (2015-04-13 revision 50299) [universal.x86_64-darwin15] 

けどまだこのエラーが発生します:

bundle exec rake db:setup 
    Could not find rake-10.4.2 in any of the sources 
    Run `bundle install` to install missing gems. 

これを修正するにはどうすればよいですか?

[[UPDATE]]

[[UPDATE]]

これはさらに混乱です:

bundle update rake 

    Fetching gem metadata from https://rubygems.org/............. 
    Fetching version metadata from https://rubygems.org/... 
    Fetching dependency metadata from https://rubygems.org/.. 
    Resolving dependencies... 
    Installing rake 11.2.2 (was 10.4.2) 
    Using i18n 0.7.0 
    Using json 1.8.3 
    Using minitest 5.8.3 
    Using thread_safe 0.3.5 
    Using tzinfo 1.2.2 
    Using activesupport 4.2.0 
    Using builder 3.2.2 
    Using erubis 2.7.0 
    Using mini_portile 0.6.2 
    Using nokogiri 1.6.6.4 
    Using rails-deprecated_sanitizer 1.0.3 
    Using rails-dom-testing 1.0.7 
    Using loofah 2.0.3 
    Using rails-html-sanitizer 1.0.2 
    Using actionview 4.2.0 
    Using rack 1.6.4 
    Using rack-test 0.6.3 
    Using actionpack 4.2.0 
    Using globalid 0.3.6 
    Using activejob 4.2.0 
    Using mime-types 2.99 
    Using mail 2.6.3 
    Using actionmailer 4.2.0 
    Using activemodel 4.2.0 
    Using arel 6.0.3 
    Using activerecord 4.2.0 
    Using addressable 2.3.8 
    Using multi_xml 0.5.5 
    Using httparty 0.13.7 
    Using uuidtools 2.1.5 
    Using aws-sdk 1.3.9 
    Using bcrypt 3.1.10 
    Using debug_inspector 0.0.2 
    Using binding_of_caller 0.7.2 
    Using bson 3.2.6 
    Using bson_ext 1.5.1 
    Using bundler 1.8.5 
    Using byebug 8.2.1 
    Using xpath 2.0.0 
    Using capybara 2.5.0 
    Using ffi 1.9.10 
    Using childprocess 0.5.8 
    Using climate_control 0.0.3 
    Using cocaine 0.5.8 
    Using coderay 1.1.0 
    Using coffee-script-source 1.10.0 
    Using execjs 2.6.0 
    Using coffee-script 2.4.1 
    Using thor 0.19.1 
    Using railties 4.2.0 
    Using coffee-rails 4.1.0 
    Using database_cleaner 1.5.1 
    Using orm_adapter 0.5.0 
    Using responders 2.1.0 
    Using warden 1.2.3 
    Using devise 3.5.2 
    Using diff-lcs 1.2.5 
    Using dotenv 2.1.0 
    Using dotenv-rails 2.1.0 
    Using factory_girl 4.5.0 
    Using factory_girl_rails 4.5.0 
    Using faker 1.4.3 
    Using multipart-post 2.0.0 
    Using faraday 0.9.2 
    Using sass 3.4.19 
    Using foundation-rails 5.5.3.2 
    Using geocoder 1.2.9 
    Using httpclient 2.6.0.1 
    Using icalendar 2.3.0 
    Using multi_json 1.11.2 
    Using jbuilder 2.3.2 
    Using jquery-rails 4.0.5 
    Using jwt 1.5.2 
    Using kgio 2.9.3 
    Using method_source 0.8.2 
    Using mimemagic 0.3.0 
    Using mongo 2.1.2 
    Using origin 2.1.1 
    Using mongoid 5.0.1 
    Using paperclip 4.3.2 
    Using mongoid-paperclip 0.0.10 
    Using oauth2 1.0.0 
    Using slop 3.6.0 
    Using pry 0.10.1 
    Using pry-rails 0.3.4 
    Using quiet_assets 1.1.0 
    Using sprockets 3.4.1 
    Using sprockets-rails 2.3.3 
    Using rails 4.2.0 
    Using rails_serve_static_assets 0.0.4 
    Using rails_stdout_logging 0.0.3 
    Using rails_12factor 0.0.3 
    Using raindrops 0.15.0 
    Using rdoc 4.2.0 
    Using rspec-support 3.3.0 
    Using rspec-core 3.3.1 
    Using rspec-expectations 3.3.0 
    Using rspec-mocks 3.3.1 
    Using rspec-rails 3.3.2 
    Using rspec_junit_formatter 0.2.2 
    Using rubyzip 1.1.7 
    Using tilt 2.0.1 
    Using sass-rails 5.0.4 
    Using sdoc 0.4.1 
    Using websocket 1.2.2 
    Using selenium-webdriver 2.48.1 
    Using shoulda-matchers 2.8.0 
    Using signet 0.7.2 
    Using simple_form 3.2.0 
    Using spring 1.4.4 
    Using timezone 0.5.0 
    Using turbolinks 2.5.3 
    Using uglifier 2.7.2 
    Using unicorn 4.9.0 
    Using web-console 2.2.1 
    Updating files in vendor/cache 
    * rake-11.2.2.gem 
    Removing outdated .gem files from vendor/cache 
    * rake-10.4.2.gem 
    Bundle updated! 
    bundle exec rake db:setup 
    Could not find rake-11.2.2 in any of the sources 
    Run `bundle install` to install missing gems. 
    bundle update rake  

だから、一行はレーキがインストールされていることを言って、次の行は、と言っていますそれはインストールされておらず、両方のラインはBundlerによって名目上管理されているので、理論的にはこれはキャッシュの問題にはなりません。

[[UPDATE]]

[[UPDATE]]

私は宝石のファイルにこれを追加しました:

gem 'rake', '10.5.0' 

そして私を与え

bundle install 

を走りました:

Updating files in vendor/cache 
    Bundle complete! 40 Gemfile dependencies, 116 gems now installed. 
    Bundled gems are installed into ./vendor/cache. 

それでは、私は試してみてください。

bundle exec rake db:setup 

と私が手:

Could not find rake-10.5.0 in any of the sources 
    Run `bundle install` to install missing gems. 
+4

'you'r熊手のバージョンである' あなたは 'バンドルinstall'を試してみました? – zetetic

+0

'which rbenv'の出力をここに貼り付けることはできますか? –

+0

もちろん、私は "bundle install"を実行しました。何度も。 – charlottesville

答えて

-2

はちょうどsudo gem install rake -v '11.2.2'

+0

あなたは 'sudo'で' gem'を実行するべきではありません。それは許可を失い、あなたを将来的に噛んでしまいます。その他:https://stackoverflow.com/questions/2119064/sudo-gem-install-or-gem-install-and-gem-locations – medik

関連する問題