找不到独角兽 (>= 0)

发布于 2024-12-12 08:41:42 字数 1199 浏览 0 评论 0原文

我目前正在使用 capistrano 来部署我的项目。但是我遇到了以下问题:

$ cap deploy:start

* executing `deploy:start'
  * executing " /usr/local/rvm/gems/ruby-1.9.2-p290/bin/unicorn_rails -c /app/current/config/unicorn.rb -E production -D"
    servers: ["x.x.x.x"]
    [x.x.x.x] executing command
 ** [out :: x.x.x.x] /usr/local/rvm/rubies/ruby-1.9.2-p290/lib/ruby/site_ruby/1.9.1/rubygems/dependency.**rb:247:in `to_specs': Could not find unicorn (>= 0) amongst [minitest-1.6.0, rake-0.8.7, rdoc-2.5.8]** (
 ** [out :: x.x.x.x] Gem::LoadError)
 ** [out :: x.x.x.x] from /usr/local/rvm/rubies/ruby-1.9.2-p290/lib/ruby/site_ruby/1.9.1/rubygems/dependency.rb:256:in `to_spec'
 ** [out :: x.x.x.x] from /usr/local/rvm/rubies/ruby-1.9.2-p290/lib/ruby/site_ruby/1.9.1/rubygems.rb:1210:in `gem'
 ** [out :: x.x.x.x] from /usr/local/rvm/gems/ruby-1.9.2-p290/bin/unicorn_rails:18:in `<main>'
 ** [out :: x.x.x.x] 
    command finished in 253ms
failed: "sh -c '/usr/local/rvm/gems/ruby-1.9.2-p290/bin/unicorn_rails -c /app/current/config/unicorn.rb -E production -D'" on x.x.x.x

软件版本:

  • rails 3.1
  • ruby​​-1.9.2-p290
  • ubuntu 10.04

有人可以帮忙吗?非常感谢!!

I'm currently using capistrano to deploy my project. However I'm having this problem below:

$ cap deploy:start

* executing `deploy:start'
  * executing " /usr/local/rvm/gems/ruby-1.9.2-p290/bin/unicorn_rails -c /app/current/config/unicorn.rb -E production -D"
    servers: ["x.x.x.x"]
    [x.x.x.x] executing command
 ** [out :: x.x.x.x] /usr/local/rvm/rubies/ruby-1.9.2-p290/lib/ruby/site_ruby/1.9.1/rubygems/dependency.**rb:247:in `to_specs': Could not find unicorn (>= 0) amongst [minitest-1.6.0, rake-0.8.7, rdoc-2.5.8]** (
 ** [out :: x.x.x.x] Gem::LoadError)
 ** [out :: x.x.x.x] from /usr/local/rvm/rubies/ruby-1.9.2-p290/lib/ruby/site_ruby/1.9.1/rubygems/dependency.rb:256:in `to_spec'
 ** [out :: x.x.x.x] from /usr/local/rvm/rubies/ruby-1.9.2-p290/lib/ruby/site_ruby/1.9.1/rubygems.rb:1210:in `gem'
 ** [out :: x.x.x.x] from /usr/local/rvm/gems/ruby-1.9.2-p290/bin/unicorn_rails:18:in `<main>'
 ** [out :: x.x.x.x] 
    command finished in 253ms
failed: "sh -c '/usr/local/rvm/gems/ruby-1.9.2-p290/bin/unicorn_rails -c /app/current/config/unicorn.rb -E production -D'" on x.x.x.x

software version:

  • rails 3.1
  • ruby-1.9.2-p290
  • ubuntu 10.04

Could anyone help? Many thanks!!

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(2

猫瑾少女 2024-12-19 08:41:42

Capistrano 找不到正确的 PATH、GEM_PATH 和 GEM_HOME 变量。您应该在 config/deploy.rb 中设置它们,如下所示:

set :default_environment, {
  'PATH' => "/usr/local/rvm/gems/ruby-1.9.2-p290/bin:/usr/local/rvm/gems/ruby-1.9.2-p290@global/bin:/usr/local/rvm/rubies/ruby-1.9.2-p290/bin:/usr/local/rvm/bin:$PATH",
  'RUBY_VERSION' => 'ruby 1.9.2p290',
  'GEM_HOME' => '/usr/local/rvm/gems/ruby-1.9.2-p290',
  'GEM_PATH' => '/usr/local/rvm/gems/ruby-1.9.2-p290:/usr/local/rvm/gems/ruby-1.9.2-p290@global'
}

Capistrano can't find the right variable of PATH,GEM_PATH and GEM_HOME.You should set them in config/deploy.rb like below:

set :default_environment, {
  'PATH' => "/usr/local/rvm/gems/ruby-1.9.2-p290/bin:/usr/local/rvm/gems/ruby-1.9.2-p290@global/bin:/usr/local/rvm/rubies/ruby-1.9.2-p290/bin:/usr/local/rvm/bin:$PATH",
  'RUBY_VERSION' => 'ruby 1.9.2p290',
  'GEM_HOME' => '/usr/local/rvm/gems/ruby-1.9.2-p290',
  'GEM_PATH' => '/usr/local/rvm/gems/ruby-1.9.2-p290:/usr/local/rvm/gems/ruby-1.9.2-p290@global'
}
淡看悲欢离合 2024-12-19 08:41:42

服务器上似乎未安装 Unicorn gem。

登录服务器并运行

which unicorn_rails

如果没有返回任何路径,则意味着它不可用。以 root 身份登录,然后安装它。

$ gem install unicorn

It seems the Unicorn gem is not installed on the server.

Login into the server and run

which unicorn_rails

If it doesn't return any path, it means it's not available. Login as root, then install it.

$ gem install unicorn
~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文