使用capistrano部署时出现跟随错误

时间:2013-09-12 01:59:25

标签: ruby-on-rails capistrano bundler

我进行了上限部署,我遇到了错误,

* executing "cd /home/deployer/apps/nthat1/releases/20130911190337 && bundle install --gemfile /home/deployer/apps/nthat1/releases/20130911190337/Gemfile --path /home/deployer/apps/nthat1/shared/bundle --deployment --quiet --without development test"
  servers: ["192.241.225.72"]
  [192.241.225.72] executing command
** [out :: 192.241.225.72] /home/deployer/.rvm/gems/ruby-1.9.3-p448/gems/psych-1.3.4/lib/psych.rb:96: warning: already initialized constant VERSION
** [out :: 192.241.225.72] 
** [out :: 192.241.225.72] /home/deployer/.rvm/gems/ruby-1.9.3-p448/gems/psych-1.3.4/lib/psych.rb:99: warning: already initialized constant LIBYAML_VERSION
** [out :: 192.241.225.72] 
** [out :: 192.241.225.72] Gem::Installer::ExtensionBuildError: ERROR: Failed to build gem native extension.
** [out :: 192.241.225.72] 
** [out :: 192.241.225.72] 
** [out :: 192.241.225.72] /home/deployer/.rvm/rubies/ruby-1.9.3-p448/bin/ruby extconf.rb
** [out :: 192.241.225.72] 
** [out :: 192.241.225.72] 
** [out :: 192.241.225.72] Gem files will remain installed in /home/deployer/apps/nthat1/shared/bundle/ruby/1.9.1/gems/libv8-3.16.14.3 for inspection.
** [out :: 192.241.225.72] 
** [out :: 192.241.225.72] Results logged to  /home/deployer/apps/nthat1/shared/bundle/ruby/1.9.1/gems/libv8- 3.16.14.3/ext/libv8/gem_make.out
** [out :: 192.241.225.72] 
** [out :: 192.241.225.72] An error occurred while installing libv8 (3.16.14.3), and Bundler cannot
** [out :: 192.241.225.72] 
** [out :: 192.241.225.72] continue.
** [out :: 192.241.225.72] 
** [out :: 192.241.225.72] Make sure that `gem install libv8 -v '3.16.14.3'` succeeds before bundling.
** [out :: 192.241.225.72] 
command finished in 174014ms
*** [deploy:update_code] rolling back
* executing "rm -rf /home/deployer/apps/nthat1/releases/20130911190337; true"

我登录到服务器,我做了宝石安装libv8 -v'3.16.14.3'

Building native extensions.  This could take a while...
Successfully installed libv8-3.16.14.3
1 gem installed
Installing ri documentation for libv8-3.16.14.3...
Installing RDoc documentation for libv8-3.16.14.3...

我再次进行了限制部署我得到了与上述相同的错误。

1 个答案:

答案 0 :(得分:0)

在您的部署中,您使用的是使用RVM构建的Ruby。当您登录该框以手动安装libv8时,请确保您使用的是部署期间使用的基于RVM的相同Ruby。手动登录后尝试此操作:

$ rvm use ruby-1.9.3-p448
$ gem install libv8 -v '3.16.14.3'

确保您的红宝石来自rvm:

$ which ruby
/home/deployer/.rvm/rubies/ruby-1.9.3-p448/bin/ruby