我正在尝试将rails应用程序部署到digitalocean VPS droplet。我在Ubuntu 12.10(Nginx + Unicorn)上有以下设置Ruby on Rails。我已经通过rvm安装了Ruby ruby-2.0.0-p247和rails Rails 4.0.0但是当我尝试重新启动Unicorn时,我收到以下错误。
/usr/local/rvm/rubies/ruby-2.0.0-p247/lib/ruby/site_ruby/2.0.0/rubygems/
core_ext/kernel_require.rb:45:in
`require': cannot load such file -- unicorn/launcher (LoadError)
from /usr/local/rvm/rubies/ruby-2.0.0-p247/lib/ruby/site_ruby/2.0.0/rubygems/
core_ext/kernel_require.rb:45:in
`require' from /usr/bin/unicorn:3:in `<main>'
可能是因为我的GEM_HOME和GEM_PATH不同吗?
$GEM_PATH:
/usr/local/rvm/gems/ruby-2.0.0-p247:/usr/local/rvm/gems/ruby-2.0.0-p247@global
$GEM_HOME:
/usr/local/rvm/gems/ruby-2.0.0-p247
答案 0 :(得分:0)
您的PATH
设置不正确。您正在从/usr/bin
运行独角兽二进制文件(请参阅错误消息)。您应该从rvm bin目录运行它。确保rvm设置正确(您正在运行rvm init脚本),并且PATH
包含rvm bin目录,而不是其他任何内容。
有关类似问题,请参阅此处以获取有关rvm和PATH
的进一步讨论:
https://stackoverflow.com/a/19189111/823617