0

当使用 capistrano 部署我的 Rails 应用程序时,安装所有内容并回滚并显示以下错误

failed: "rvm_path=/usr/local/rvm /usr/local/rvm/bin/rvm-shell 'ruby-2.0.0-p247' -c 'cd /var/www/vhosts/admin/releases/20131012184713 && bundle install --gemfile /var/www/vhosts/admin/releases/20131012184713/Gemfile --path /var/www/vhosts/admin/shared/bundle --deployment --quiet --without development test'" on admin.mydomain.com

编辑-1

这是我的 deploy.rb:

require "bundler/capistrano"
require "rvm/capistrano"
set :rvm_ruby_string, "ruby-2.0.0-p247"
set :rvm_type, :user

set :application, "admin"
set :repository,  "git@bitbucket.org:username/myrepo.git"
set :user, "my-server-user-name"
set :branch, "master"

set :deploy_to, "/var/www/vhosts/admin"
set :deploy_via, :copy
set :use_sudo, false
set :rvm_install_with_sudo, true

default_run_options[:pty] = true

set :port, 2775

set :scm, :git

role :web, "admin.mydomain.com"
role :app, "admin.mydomain.com"
role :db,  "admin.mydomain.com", :primary => true
role :db,  "admin.mydomain.com"

after "deploy:update_code","deploy:config_symlink"

set :rvm_type, :system

# If you are using Passenger mod_rails uncomment this:
namespace :deploy do
  task :start do ; end
  task :stop do ; end
  task :restart, :roles => :app, :except => { :no_release => true } do
    #run "#{try_sudo} touch #{File.join(current_path,'tmp','restart.txt')}"
  end

  task :config_symlink do
    #run "cp #{release_path}/config/database.yml.example #{release_path}/config/database.yml"
  end
end

before 'deploy', 'rvm:install_ruby'
before 'deploy', 'rvm:create_gemset'

我没有在此处显示任何特定错误。上述错误是我收到的唯一消息。

还有一点要说的是

在我的服务器中,我可以找到此路径

/usr/local/rvm但我找不到/usr/local/rvm/bin/rvm-shell

编辑-2

 ** [out :: admin.mydomain.com] Gem::Installer::ExtensionBuildError: ERROR: Failed to build gem native extension.
 ** [out :: admin.mydomain.com] 
 ** [out :: admin.mydomain.com] /usr/local/rvm/rubies/ruby-2.0.0-p247/bin/ruby extconf.rb --with-pg-config=/usr/pgsql-9.2/bin/pg_conf
 ** [out :: admin.mydomain.com] Using config values from /usr/pgsql-9.2/bin/pg_conf
 ** [out :: admin.mydomain.com] sh: /usr/pgsql-9.2/bin/pg_conf: No such file or directory
 ** [out :: admin.mydomain.com] sh: /usr/pgsql-9.2/bin/pg_conf: No such file or directory
 ** [out :: admin.mydomain.com] checking for libpq-fe.h... no
 ** [out :: admin.mydomain.com] Can't find the 'libpq-fe.h header
 ** [out :: admin.mydomain.com] *** extconf.rb failed ***
 ** [out :: admin.mydomain.com] Could not create Makefile due to some reason, probably lack of necessary
 ** [out :: admin.mydomain.com] libraries and/or headers.  Check the mkmf.log file for more details.  You may
 ** [out :: admin.mydomain.com] need configuration options.
 ** [out :: admin.mydomain.com] 
 ** [out :: admin.mydomain.com] Provided configuration options:
 ** [out :: admin.mydomain.com] --with-opt-dir
 ** [out :: admin.mydomain.com] --without-opt-dir
 ** [out :: admin.mydomain.com] --with-opt-include
 ** [out :: admin.mydomain.com] --without-opt-include=${opt-dir}/include
 ** [out :: admin.mydomain.com] --with-opt-lib
 ** [out :: admin.mydomain.com] --without-opt-lib=${opt-dir}/lib
 ** [out :: admin.mydomain.com] --with-make-prog
 ** [out :: admin.mydomain.com] --without-make-prog
 ** [out :: admin.mydomain.com] --srcdir=.
 ** [out :: admin.mydomain.com] --curdir
 ** [out :: admin.mydomain.com] --ruby=/usr/local/rvm/rubies/ruby-2.0.0-p247/bin/ruby
 ** [out :: admin.mydomain.com] --with-pg
 ** [out :: admin.mydomain.com] --without-pg
 ** [out :: admin.mydomain.com] --with-pg-config
 ** [out :: admin.mydomain.com] --with-pg-dir
 ** [out :: admin.mydomain.com] --without-pg-dir
 ** [out :: admin.mydomain.com] --with-pg-include
 ** [out :: admin.mydomain.com] --without-pg-include=${pg-dir}/include
 ** [out :: admin.mydomain.com] --with-pg-lib
 ** [out :: admin.mydomain.com] --without-pg-lib=${pg-dir}/
 ** [out :: admin.mydomain.com] 
 ** [out :: admin.mydomain.com] 
 ** [out :: admin.mydomain.com] Gem files will remain installed in /var/www/vhosts/admin/shared/bundle/ruby/2.0.0/gems/pg-0.17.0 for inspection.
 ** [out :: admin.mydomain.com] Results logged to /var/www/vhosts/admin/shared/bundle/ruby/2.0.0/gems/pg-0.17.0/ext/gem_make.out
 ** [out :: admin.mydomain.com] An error occurred while installing pg (0.17.0), and Bundler cannot continue.
 ** [out :: admin.mydomain.com] Make sure that `gem install pg -v '0.17.0'` succeeds before bundling.

我尝试gem install pg -v '0.17.0'并添加bundle config build.pg --with-pg-config=/usr/pgsql-9.1/bin/pg_config了,但存在上述错误我该如何解决

4

1 回答 1

0

This works

sudo yum install postgresql-devel

After installing it restart is required for configuration to take action.

sudo service postgres-9.2 restart

于 2013-10-12T20:17:53.137 回答