【问题标题】:Error deploying with cap deploy when using gem paperclip使用 gem 回形针时使用 cap deploy 进行部署时出错
【发布时间】:2012-05-15 09:31:41
【问题描述】:

我正在使用 gem Paperclip,现在我想使用 capistrano 将我的应用程序部署到服务器,但是在运行 cap deploy 时,我在最后收到以下消息:

 * executing "cd /home/administrator/myApp/releases/20120506165329 && bundle install --gemfile /home/administrat
or/myApp/releases/20120506165329/Gemfile --path /home/administrator/myApp/shared/bundle --deployment --qui
et --without development test"
    servers: ["myserver.com"]
    [myserver.com] executing command
 ** [out :: myserver.com] Gem::InstallError: paperclip requires Ruby version >= 1.9.2.
 ** [out :: myserver.com] An error occured while installing paperclip (3.0.3), and Bundler cannot continue.
 ** [out :: myserver.com] Make sure that `gem install paperclip -v '3.0.3'` succeeds before bundling.
    command finished in 66362ms
*** [deploy:update_code] rolling back
  * executing "rm -rf /home/administrator/myApp/releases/20120506165329; true"
    servers: ["myserver.com"]
    [myserver.com] executing command
    command finished in 66ms
failed: "sh -c 'cd /home/administrator/myApp/releases/20120506165329 && bundle install --gemfile /home/administra
tor/myApp/releases/20120506165329/Gemfile --path /home/administrator/myApp/shared/bundle --deployment --qu
iet --without development test'" on myserver.com

我检查了我服务器中的 Ruby 版本,我得到了:

$ruby -v
ruby 1.9.2p290 (2011-07-09 revision 32553) [i686-linux]

我还通过运行在服务器中手动安装了 gem

gem install paperclip -v '3.0.3'
...
Successfully installed paperclip-3.0.3

然后再次运行cap deploy,但出现了相同的消息

如何部署我的应用程序?

提前谢谢你

【问题讨论】:

    标签: ruby-on-rails-3 paperclip capistrano


    【解决方案1】:

    按照接受的答案 here 中的建议,通过设置 capistrano 的默认环境来修复它

    我现在可以使用 capistrano 进行部署(虽然我的系统 ruby​​ 仍在使用 ruby​​ 1.8.7,所以 gem 回形针没有正确安装,你可以找到这个问题 here

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 2019-04-10
      • 1970-01-01
      • 1970-01-01
      • 2015-06-18
      • 1970-01-01
      相关资源
      最近更新 更多