Rails没有找到rake-10.5.0 [英] Rails not finding rake-10.5.0

查看:180
本文介绍了Rails没有找到rake-10.5.0的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我试图在rails 4.2中安装 rake gem。
宝石似乎安装正常,但是Rails在尝试运行时失败,说它看不到 rake-10.5.0
我正在鲁米姬开发,我得到的错误如下,和我的Gemfile一样。
我尝试删除 Gemfile.lock ,如其他帖子所建议的,但无济于事。

Console:

 〜/ Development / RubymineProjects / Revenant.tech
ls
Gemfile Rakefile config lib test
Gemfile.lock app config.ru log tmp
README.rdoc bin db public vendor
〜/ Development / RubymineProjects / Revenant.tech
gem install rack
成功已安装的机架-1.6.4
解析机架文档-16.4.4
在2秒钟内完成机架安装文档
1安装的宝石
〜/ Development / RubymineProjects / Revenant.tech 
软件包更新耙子
从https://rubygems.org / ...........获取gem元数据
从https://rubygems.org获取版本元数据/ ...
从https://rubygems.org/获取依赖关系元数据..
解析依赖关系...
使用rake 10.5.0
使用i18n 0.7.0
使用json 1.8.3
使用minit est 5.8.3
使用thread_safe 0.3.5
使用构建器3.2.2
使用erubis 2.7.0
使用mini_portile2 2.0.0
使用机架1.6.4
使用mime-types 2.99
使用arel 6.0.3
使用debug_inspector 0.0.2
使用bundler 1.11.2
使用byebug 8.2.1
使用咖啡-script-source 1.10.0
使用execjs 2.6.0
使用thor 0.19.1
使用concurrent-ruby 1.0.0
使用multi_json 1.11.2
使用mysql2 0.4.2
使用sass 3.4.21
使用tilt 2.0.2
使用spring 1.6.2
使用tzinfo 1.2.2
使用nokogiri 1.6.7.1
使用rack-test 0.6.3
使用邮件2.6.3
使用binding_of_caller 0.7.2
使用coffee-script 2.4.1
使用uglifier 2.7.2
使用链轮3.5.2
使用activesupport 4.2.5
使用丝瓜2.0.3
使用rails-deprecated_sanitizer 1.0.3
使用globalid 0.3.6
使用activemodel 4.2.5
使用jbuilder 2.4.0
使用rails-html-sanitizer 1.0.2
使用rails-dom-testing 1.0.7
使用ac tivejob 4.2.5
使用activerecord 4.2.5
使用actionview 4.2.5
使用actionpack 4.2.5
使用actionmailer 4.2.5
使用railties 4.2.5
使用sprockets-rails 3.0.0
使用coffee-rails 4.1.1
使用jquery-rails 4.1.0
使用rails 4.2.5
使用sass-rails 5.0 .4
使用web-console 2.2.1
使用turbolinks 2.5.3
软件包已更新!
〜/ Development / RubymineProjects / Revenant.tech
rm Gemfile.lock
〜/ Development / RubymineProjects / Revenant.tech
bundle install
从gem元数据获取https://rubygems.org/ ...........
从https://rubygems.org / ...获取版本元数据...
从https://获取依赖关系元数据rubygems.org/ ..
解决依赖关系.....
使用rake 10.5.0
使用i18n 0.7.0
使用json 1.8.3
使用minitest 5.8.3
使用thread_safe 0.3.5
使用构建器3.2.2
使用erubis 2.7.0
使用mini_portile2 2.0.0
使用机架1.6.4
使用mime-types 2.99
使用arel 6.0.3
使用debug_inspector 0.0.2
使用bundler 1.11.2
使用byebug 8.2.1
使用coffee- script-source 1.10.0
使用execjs 2.6.0
使用thor 0.19.1
使用concurrent-ruby 1.0.0
使用multi_json 1.11.2
使用mysql2 0.4.2
使用sass 3.4.21
使用tilt 2.0.2
使用spring 1.6.2
使用tzinfo 1.2.2
使用nokogiri 1.6.7.1
使用rack-test 0.6.3
使用邮件2.6.3
使用binding_of_caller 0.7.2
使用coffee-script 2.4.1
使用uglifier 2.7.2
使用链轮3.5.2
使用activesupport 4.2.5
使用丝瓜2.0.3
使用rails-deprecated_sanitizer 1.0.3
使用globalid 0.3.6
使用activemodel 4.2.5
使用jbuilder 2.4.0
使用rails-html-sanitizer 1.0.2
使用rails-dom-testing 1.0.7
使用activejob 4.2.5
使用activerecord 4.2.5
使用actionview 4.2.5
使用actionpack 4.2.5
使用actionmailer 4.2.5
使用railties 4.2.5
使用sprockets-rails 3.0.0
使用coffee-rails 4.1.1
使用jquery-rails 4.1.0
使用rails 4.2.5
使用sass-rails 5.0.4
使用web-console 2.2.1
使用turbolinks 2.5.3
完成捆绑! 12个Gemfile依赖关系,现在安装了52个宝石。
使用`bundle show [gemname]`查看捆绑的gem的安装位置。
〜/ Development / RubymineProjects / Revenant.tech

Rubymine控制台错误:

  / usr / bin / ruby​​ -e $ stdout.sync = true; $ stderr.sync = true; load($ 0 = ARGV.shift )/Users/richardcurteis/Development/RubymineProjects/Revenant.tech/bin/rails server -b 0.0.0.0 -p 3000 -e development 
/Library/Ruby/Gems/2.0.0/gems/bundler-1.11。 2 / lib / bundler / spec_set.rb:94:在`block in materialize':找不到rake-10.5.0在任何源代码中(Bundler :: GemNotFound)
from / Library / Ruby / Gems / 2.0.0 / gems / bundler-1.11.2 / lib / bundler / spec_set.rb:87:在`map!'中
从/Library/Ruby/Gems/2.0.0/gems/bundler-1.11.2 /lib/bundler/spec_set.rb:87:in`materialize'$ / $ b / from /Library/Ruby/Gems/2.0.0/gems/bundler-1.11.2/lib/bundler/definition.rb:137:in `specs'
from /Library/Ruby/Gems/2.0.0/gems/bundler-1.11.2/lib/bundler/definition.rb:182:in`specs_for'
from / Library / Ruby /Gems/2.0.0/gems/bundler-1.11.2/lib/bundler/definiti on.rb:171:在`requested_specs'
/Library/Ruby/Gems/2.0.0/gems/bundler-1.11.2/lib/bundler/environment.rb:18:in`requested_specs'$ b $ / from /Library/Ruby/Gems/2.0.0/gems/bundler-1.11.2/lib/bundler/runtime.rb:13:in`setup'
from /Library/Ruby/Gems/2.0。 0 / gems / bundler-1.11.2 / lib / bundler.rb:92:在`setup'
从/Library/Ruby/Gems/2.0.0/gems/bundler-1.11.2/lib/bundler/ setup.rb:18:在<< top(required)>'
from /System/Library/Frameworks/Ruby.framework/Versions/2.0/usr/lib/ruby/2.0.0/rubygems/core_ext /kernel_require.rb:135:in`require'
from /System/Library/Frameworks/Ruby.framework/Versions/2.0/usr/lib/ruby/2.0.0/rubygems/core_ext/kernel_require.rb:135 :在`rescue in require'
from /System/Library/Frameworks/Ruby.framework/Versions/2.0/usr/lib/ruby/2.0.0/rubygems/core_ext/kernel_require.rb:144:in`require '来自/Users/richardcurteis/Development/RubymineProjects/Revenant.tech/config/boot.rb:3:in'的
< top(requir ed)>'
from /Users/richardcurteis/Development/RubymineProjects/Revenant.tech/bin/rails:3:in'require_relative'
from /Users/richardcurteis/Development/RubymineProjects/Revenant.tech / bin / rails:3:在< top(required)>'
from -e:1:in'load'
from -e:1:in< main>'

程序完成退出代码1

Rakefile:

  source'https://rubygems.org'


#Bundle edge Rails改为:gem'rails' ,github:'rails / rails'
gem'rails','4.2.5'
#使用mysql作为活动记录数据库
gem'mysql2','> = 0.3。 13',' 0.5'
#将SCSS用于样式表
gem'sass-rails','〜> 5.0'
#使用Uglifier作为JavaScript资产的压缩器
gem'uglifier','> = 1.3.0'
#使用CoffeeScript作为.coffee资产和视图
gem'咖啡栏','〜> 4.1.0'
#请参阅https://github.com/rails/execjs#readme以获得更多支持的运行时
#gem'therubyracer',平台:: ruby​​

#使用jquery作为JavaScript库
gem'jquery-rails'
#Turbolinks使Web应用程序中的以下链接更快。阅读更多:https://github.com/rails/turbolinks
gem'turbolinks'
#轻松构建JSON API。阅读更多:https://github.com/rails/jbuilder
gem'jbuilder','〜> 2.0'
#bundle exec rake doc:rails在doc / api下生成API。
gem'sdoc','〜> 0.4.0',组::doc

gem'rake'

#使用ActiveModel has_secure_password
#gem'bcrypt','〜> 3.1.7'

#使用Unicorn作为应用服务器
#gem'unicorn'

#使用Capistrano进行部署
#gem'capistrano- rails',group::development

group:development,:test do
#在代码的任何地方调用'byebug'来停止执行并获得调试器控制台
gem'byebug '
end

group:development do
#在异常页面或使用<%= console%>访问IRB控制台。在视图中
gem'web-console','〜> 2.0'

#Spring通过让应用程序在后台运行来加速开发。阅读更多:https://github.com/rails/spring
gem'spring'
end


解决方案

我相信这个问题与我的Ruby安装有关。
我运行了下面的命令,这似乎解决了这个问题。

  rvm install ruby​​-2.0.0-p643 
rvm - 默认使用2.0.0
ruby​​ -v
ruby​​ 2.0.0p643(2015-02-25 revision 49749)[x86_64-darwin14.1.0]


I am trying to install the rake gem in rails 4.2. Th gem seems to be install fine, but then Rails fails when it tries to run, saying that it cannot see rake-10.5.0. I am developing in Rubymine and the error I am getting is below, as is my Gemfile. I have tried deleting Gemfile.lock as suggested by other posts, but to no avail.

Console:

 ~/Development/RubymineProjects/Revenant.tech    
ls
Gemfile     Rakefile    config      lib     test
Gemfile.lock    app     config.ru   log     tmp
README.rdoc bin     db      public      vendor
 ~/Development/RubymineProjects/Revenant.tech    
gem install rack
Successfully installed rack-1.6.4
Parsing documentation for rack-1.6.4
Done installing documentation for rack after 2 seconds
1 gem installed
 ~/Development/RubymineProjects/Revenant.tech    
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...
Using rake 10.5.0
Using i18n 0.7.0
Using json 1.8.3
Using minitest 5.8.3
Using thread_safe 0.3.5
Using builder 3.2.2
Using erubis 2.7.0
Using mini_portile2 2.0.0
Using rack 1.6.4
Using mime-types 2.99
Using arel 6.0.3
Using debug_inspector 0.0.2
Using bundler 1.11.2
Using byebug 8.2.1
Using coffee-script-source 1.10.0
Using execjs 2.6.0
Using thor 0.19.1
Using concurrent-ruby 1.0.0
Using multi_json 1.11.2
Using mysql2 0.4.2
Using sass 3.4.21
Using tilt 2.0.2
Using spring 1.6.2
Using tzinfo 1.2.2
Using nokogiri 1.6.7.1
Using rack-test 0.6.3
Using mail 2.6.3
Using binding_of_caller 0.7.2
Using coffee-script 2.4.1
Using uglifier 2.7.2
Using sprockets 3.5.2
Using activesupport 4.2.5
Using loofah 2.0.3
Using rails-deprecated_sanitizer 1.0.3
Using globalid 0.3.6
Using activemodel 4.2.5
Using jbuilder 2.4.0
Using rails-html-sanitizer 1.0.2
Using rails-dom-testing 1.0.7
Using activejob 4.2.5
Using activerecord 4.2.5
Using actionview 4.2.5
Using actionpack 4.2.5
Using actionmailer 4.2.5
Using railties 4.2.5
Using sprockets-rails 3.0.0
Using coffee-rails 4.1.1
Using jquery-rails 4.1.0
Using rails 4.2.5
Using sass-rails 5.0.4
Using web-console 2.2.1
Using turbolinks 2.5.3
Bundle updated!
 ~/Development/RubymineProjects/Revenant.tech    
rm Gemfile.lock 
 ~/Development/RubymineProjects/Revenant.tech    
bundle install
Fetching gem metadata from https://rubygems.org/...........
Fetching version metadata from https://rubygems.org/...
Fetching dependency metadata from https://rubygems.org/..
Resolving dependencies.....
Using rake 10.5.0
Using i18n 0.7.0
Using json 1.8.3
Using minitest 5.8.3
Using thread_safe 0.3.5
Using builder 3.2.2
Using erubis 2.7.0
Using mini_portile2 2.0.0
Using rack 1.6.4
Using mime-types 2.99
Using arel 6.0.3
Using debug_inspector 0.0.2
Using bundler 1.11.2
Using byebug 8.2.1
Using coffee-script-source 1.10.0
Using execjs 2.6.0
Using thor 0.19.1
Using concurrent-ruby 1.0.0
Using multi_json 1.11.2
Using mysql2 0.4.2
Using sass 3.4.21
Using tilt 2.0.2
Using spring 1.6.2
Using tzinfo 1.2.2
Using nokogiri 1.6.7.1
Using rack-test 0.6.3
Using mail 2.6.3
Using binding_of_caller 0.7.2
Using coffee-script 2.4.1
Using uglifier 2.7.2
Using sprockets 3.5.2
Using activesupport 4.2.5
Using loofah 2.0.3
Using rails-deprecated_sanitizer 1.0.3
Using globalid 0.3.6
Using activemodel 4.2.5
Using jbuilder 2.4.0
Using rails-html-sanitizer 1.0.2
Using rails-dom-testing 1.0.7
Using activejob 4.2.5
Using activerecord 4.2.5
Using actionview 4.2.5
Using actionpack 4.2.5
Using actionmailer 4.2.5
Using railties 4.2.5
Using sprockets-rails 3.0.0
Using coffee-rails 4.1.1
Using jquery-rails 4.1.0
Using rails 4.2.5
Using sass-rails 5.0.4
Using web-console 2.2.1
Using turbolinks 2.5.3
Bundle complete! 12 Gemfile dependencies, 52 gems now installed.
Use `bundle show [gemname]` to see where a bundled gem is installed.
 ~/Development/RubymineProjects/Revenant.tech    

Rubymine console error:

/usr/bin/ruby -e $stdout.sync=true;$stderr.sync=true;load($0=ARGV.shift) /Users/richardcurteis/Development/RubymineProjects/Revenant.tech/bin/rails server -b 0.0.0.0 -p 3000 -e development
/Library/Ruby/Gems/2.0.0/gems/bundler-1.11.2/lib/bundler/spec_set.rb:94:in `block in materialize': Could not find rake-10.5.0 in any of the sources (Bundler::GemNotFound)
    from /Library/Ruby/Gems/2.0.0/gems/bundler-1.11.2/lib/bundler/spec_set.rb:87:in `map!'
    from /Library/Ruby/Gems/2.0.0/gems/bundler-1.11.2/lib/bundler/spec_set.rb:87:in `materialize'
    from /Library/Ruby/Gems/2.0.0/gems/bundler-1.11.2/lib/bundler/definition.rb:137:in `specs'
    from /Library/Ruby/Gems/2.0.0/gems/bundler-1.11.2/lib/bundler/definition.rb:182:in `specs_for'
    from /Library/Ruby/Gems/2.0.0/gems/bundler-1.11.2/lib/bundler/definition.rb:171:in `requested_specs'
    from /Library/Ruby/Gems/2.0.0/gems/bundler-1.11.2/lib/bundler/environment.rb:18:in `requested_specs'
    from /Library/Ruby/Gems/2.0.0/gems/bundler-1.11.2/lib/bundler/runtime.rb:13:in `setup'
    from /Library/Ruby/Gems/2.0.0/gems/bundler-1.11.2/lib/bundler.rb:92:in `setup'
    from /Library/Ruby/Gems/2.0.0/gems/bundler-1.11.2/lib/bundler/setup.rb:18:in `<top (required)>'
    from /System/Library/Frameworks/Ruby.framework/Versions/2.0/usr/lib/ruby/2.0.0/rubygems/core_ext/kernel_require.rb:135:in `require'
    from /System/Library/Frameworks/Ruby.framework/Versions/2.0/usr/lib/ruby/2.0.0/rubygems/core_ext/kernel_require.rb:135:in `rescue in require'
    from /System/Library/Frameworks/Ruby.framework/Versions/2.0/usr/lib/ruby/2.0.0/rubygems/core_ext/kernel_require.rb:144:in `require'
    from /Users/richardcurteis/Development/RubymineProjects/Revenant.tech/config/boot.rb:3:in `<top (required)>'
    from /Users/richardcurteis/Development/RubymineProjects/Revenant.tech/bin/rails:3:in `require_relative'
    from /Users/richardcurteis/Development/RubymineProjects/Revenant.tech/bin/rails:3:in `<top (required)>'
    from -e:1:in `load'
    from -e:1:in `<main>'

Process finished with exit code 1

Rakefile:

source 'https://rubygems.org'


# Bundle edge Rails instead: gem 'rails', github: 'rails/rails'
gem 'rails', '4.2.5'
# Use mysql as the database for Active Record
gem 'mysql2', '>= 0.3.13', '< 0.5'
# Use SCSS for stylesheets
gem 'sass-rails', '~> 5.0'
# Use Uglifier as compressor for JavaScript assets
gem 'uglifier', '>= 1.3.0'
# Use CoffeeScript for .coffee assets and views
gem 'coffee-rails', '~> 4.1.0'
# See https://github.com/rails/execjs#readme for more supported runtimes
# gem 'therubyracer', platforms: :ruby

# Use jquery as the JavaScript library
gem 'jquery-rails'
# Turbolinks makes following links in your web application faster. Read more: https://github.com/rails/turbolinks
gem 'turbolinks'
# Build JSON APIs with ease. Read more: https://github.com/rails/jbuilder
gem 'jbuilder', '~> 2.0'
# bundle exec rake doc:rails generates the API under doc/api.
gem 'sdoc', '~> 0.4.0', group: :doc

gem 'rake'

# Use ActiveModel has_secure_password
# gem 'bcrypt', '~> 3.1.7'

# Use Unicorn as the app server
# gem 'unicorn'

# Use Capistrano for deployment
# gem 'capistrano-rails', group: :development

group :development, :test do
  # Call 'byebug' anywhere in the code to stop execution and get a debugger console
  gem 'byebug'
end

group :development do
  # Access an IRB console on exception pages or by using <%= console %> in views
  gem 'web-console', '~> 2.0'

  # Spring speeds up development by keeping your application running in the background. Read more: https://github.com/rails/spring
  gem 'spring'
end

解决方案

I believe the issue was to do with my Ruby install. I ran the below commands and this seems to have solved the issue

rvm install ruby-2.0.0-p643
rvm --default use 2.0.0
ruby -v
ruby 2.0.0p643 (2015-02-25 revision 49749) [x86_64-darwin14.1.0]

这篇关于Rails没有找到rake-10.5.0的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆