0

我正在使用 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再次运行,但出现了相同的消息

如何部署我的应用程序?

提前谢谢你

4

1 回答 1

0

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

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

于 2012-05-06T22:35:17.930 回答