我是关于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:inmaterialize' /usr/local/rvm/gems/ruby-2.1.3/gems/bundler-1.7.3/lib/bundler/definition.rb:132:in
规格' /usr/local/rvm/gems/ruby-2.1.3/gems/bundler-1.7.3/lib/bundler/definition.rb:177:inspecs_for' /usr/local/rvm/gems/ruby-2.1.3/gems/bundler-1.7.3/lib/bundler/definition.rb:166:in
requested_specs' /usr/local/rvm/gems/ruby-2.1.3/gems/bundler-1.7.3/lib/bundler/environment.rb:18:inrequested_specs' /usr/local/rvm/gems/ruby-2.1.3/gems/bundler-1.7.3/lib/bundler/runtime.rb:13:in
设定' /usr/local/rvm/gems/ruby-2.1.3/gems/bundler-1.7.3/lib/bundler.rb:121:insetup' /usr/local/rvm/gems/ruby-2.1.3/gems/bundler-1.7.3/lib/bundler/setup.rb:17:in
' /usr/local/rvm/rubies/ruby-2.1.3/lib/ruby/2.1.0/rubygems/core_ext/kernel_require.rb:135:inrequire' /usr/local/rvm/rubies/ruby-2.1.3/lib/ruby/2.1.0/rubygems/core_ext/kernel_require.rb:135:in
救援要求' /usr/local/rvm/rubies/ruby-2.1.3/lib/ruby/2.1.0/rubygems/core_ext/kernel_require.rb:144:inrequire' /var/www/inphrase/releases/20141018133126/config/boot.rb:4:in
' /usr/local/rvm/rubies/ruby-2.1.3/lib/ruby/2.1.0/rubygems/core_ext/kernel_require.rb:55:inrequire' /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:inrequire' /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:inrequire' /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:inblock 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:ininitialize' 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:inblock 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:inbuild_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:inworker_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:inmaintain_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 ?
感谢您的帮助
答案 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
。