独角兽错误:无法在任何来源中找到rake-10.3.2(Bundler :: GemNotFound)

时间:2014-10-19 19:32:51

标签: ruby-on-rails nginx bundle unicorn

我是关于rails app的设置VPS的初学者, 开始我尝试使用Digital Ocean作为提供商的Nginx + Unicorn(特别是One Click安装https://www.digitalocean.com/community/tutorials/how-to-1-click-install-ruby-on-rails-on-ubuntu-12-10-with-digitalocean)。

我很容易配置所有环境(unicorn.conf,nginx.conf,capistrano,git,...),但现在我遇到了错误。

日志文件 /home/unicorn/log/unicorn.log 不断收到此错误(因此它是grooowing):

  

E,[2014-10-19T19:09:24.117472#24110]错误 - :找不到   任何来源中的rake-10.3.2(Bundler :: GemNotFound)   /usr/local/rvm/gems/ruby-2.1.3/gems/bundler-1.7.3/lib/bundler/spec_set.rb:92:in   block in materialize' /usr/local/rvm/gems/ruby-2.1.3/gems/bundler-1.7.3/lib/bundler/spec_set.rb:85:in 地图&#39!;   /usr/local/rvm/gems/ruby-2.1.3/gems/bundler-1.7.3/lib/bundler/spec_set.rb:85:in   materialize' /usr/local/rvm/gems/ruby-2.1.3/gems/bundler-1.7.3/lib/bundler/definition.rb:132:in 规格&#39;   /usr/local/rvm/gems/ruby-2.1.3/gems/bundler-1.7.3/lib/bundler/definition.rb:177:in   specs_for' /usr/local/rvm/gems/ruby-2.1.3/gems/bundler-1.7.3/lib/bundler/definition.rb:166:in requested_specs&#39;   /usr/local/rvm/gems/ruby-2.1.3/gems/bundler-1.7.3/lib/bundler/environment.rb:18:in   requested_specs' /usr/local/rvm/gems/ruby-2.1.3/gems/bundler-1.7.3/lib/bundler/runtime.rb:13:in 设定&#39;   /usr/local/rvm/gems/ruby-2.1.3/gems/bundler-1.7.3/lib/bundler.rb:121:in   setup' /usr/local/rvm/gems/ruby-2.1.3/gems/bundler-1.7.3/lib/bundler/setup.rb:17:in &#39;   /usr/local/rvm/rubies/ruby-2.1.3/lib/ruby/2.1.0/rubygems/core_ext/kernel_require.rb:135:in   require' /usr/local/rvm/rubies/ruby-2.1.3/lib/ruby/2.1.0/rubygems/core_ext/kernel_require.rb:135:in 救援要求&#39;   /usr/local/rvm/rubies/ruby-2.1.3/lib/ruby/2.1.0/rubygems/core_ext/kernel_require.rb:144:in   require' /var/www/inphrase/releases/20141018133126/config/boot.rb:4:in&#39;   /usr/local/rvm/rubies/ruby-2.1.3/lib/ruby/2.1.0/rubygems/core_ext/kernel_require.rb:55:in   require' /usr/local/rvm/rubies/ruby-2.1.3/lib/ruby/2.1.0/rubygems/core_ext/kernel_require.rb:55:in 需要&#39;   /var/www/inphrase/releases/20141018133126/config/application.rb:1:in   <top (required)>' /usr/local/rvm/rubies/ruby-2.1.3/lib/ruby/2.1.0/rubygems/core_ext/kernel_require.rb:55:in 需要&#39;   /usr/local/rvm/rubies/ruby-2.1.3/lib/ruby/2.1.0/rubygems/core_ext/kernel_require.rb:55:in   require' /var/www/inphrase/releases/20141018133126/config/environment.rb:2:in &#39;   /usr/local/rvm/rubies/ruby-2.1.3/lib/ruby/2.1.0/rubygems/core_ext/kernel_require.rb:55:in   require' /usr/local/rvm/rubies/ruby-2.1.3/lib/ruby/2.1.0/rubygems/core_ext/kernel_require.rb:55:in 需要&#39; config.ru:4:in block in <main>' /usr/local/rvm/gems/ruby-2.1.3/gems/rack-1.5.2/lib/rack/builder.rb:55:in instance_eval&#39;   /usr/local/rvm/gems/ruby-2.1.3/gems/rack-1.5.2/lib/rack/builder.rb:55:in   initialize' config.ru:1:in新&#39; config.ru:1:in <main>' /usr/local/rvm/gems/ruby-2.1.3/gems/unicorn-4.8.3/lib/unicorn.rb:48:in eval&#39;   /usr/local/rvm/gems/ruby-2.1.3/gems/unicorn-4.8.3/lib/unicorn.rb:48:in   block in builder' /usr/local/rvm/gems/ruby-2.1.3/gems/unicorn-4.8.3/lib/unicorn/http_server.rb:764:in 呼叫&#39;   /usr/local/rvm/gems/ruby-2.1.3/gems/unicorn-4.8.3/lib/unicorn/http_server.rb:764:in   build_app!' /usr/local/rvm/gems/ruby-2.1.3/gems/unicorn-4.8.3/lib/unicorn/http_server.rb:628:in init_worker_process&#39;   /usr/local/rvm/gems/ruby-2.1.3/gems/unicorn-4.8.3/lib/unicorn/http_server.rb:651:in   worker_loop' /usr/local/rvm/gems/ruby-2.1.3/gems/unicorn-4.8.3/lib/unicorn/http_server.rb:525:in spawn_missing_workers&#39;   /usr/local/rvm/gems/ruby-2.1.3/gems/unicorn-4.8.3/lib/unicorn/http_server.rb:536:in   maintain_worker_count' /usr/local/rvm/gems/ruby-2.1.3/gems/unicorn-4.8.3/lib/unicorn/http_server.rb:294:in 加入&#39;   /usr/local/rvm/gems/ruby-2.1.3/gems/unicorn-4.8.3/bin/unicorn:126:in   <top (required)>' /usr/local/rvm/gems/ruby-2.1.3/bin/unicorn:23:in 负载&#39; /usr/local/rvm/gems/ruby-2.1.3/bin/unicorn:23:in <main>' /usr/local/rvm/gems/ruby-2.0.0-p353/bin/ruby_executable_hooks:15:in eval&#39;   /usr/local/rvm/gems/ruby-2.0.0-p353/bin/ruby_executable_hooks:15:in ...

我已经在服务器的文件夹应用中运行了捆绑安装,所有宝石都已成功安装,所以为什么我会臭名昭着无法在任何来源(Bundler :: GemNotFound)中找到rake-10.3.2

感谢您的帮助

1 个答案:

答案 0 :(得分:2)

你正在使用两种不同的红宝石。 Bundler在一个gemset中安装Rake,Rails正在寻找另一个。请参阅堆栈跟踪的底部:

  

load'/ usr / local / rvm / gems / ruby​​-2.1.3 / bin / unicorn:23:in'
  / usr / local / rvm / gems / ruby​​-2.0.0-p353 / bin / ruby​​_executable_hooks:15:in eval'
  / usr / local / rvm / gems / ruby​​-2.0.0-p353 / bin / ruby​​_executable_hooks:15:in ...

设置要使用的默认Ruby版本:

rvm use --default 2.1.3

打开Gemfile并指定匹配的Ruby版本

# Gemfile
source 'https://rubygems.org'
ruby '2.1.3'
# ...

然后再次运行bundle install