0

カピストラーノを使用してレールアプリケーションをデプロイすると、すべてがインストールされ、ロールバックが発生し、次のエラーが表示されます

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'

ここに表示する特定のエラーはありませんでした。上記のエラーは、私が受け取っている唯一のメッセージです。

もう1つ言うことは、

私のサーバーでは、このパスを見つけることができます

/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

これは機能します

sudo yum install postgresql-devel

インストール後、設定を有効にするために再起動が必要です。

sudo service postgres-9.2 restart

于 2013-10-12T20:17:53.137 に答える