Question

When deploy my rails application with capistrano installing everything and gets rollback and showing following error

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

Edit-1

Here is my 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'

I didn't get any specific error to display here. The above mentioned error is the only message I am getting.

One more thing to say is

In my server i can find this path

/usr/local/rvm but i couldn't find /usr/local/rvm/bin/rvm-shell.

Edit -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.

I tried gem install pg -v '0.17.0' and also added bundle config build.pg --with-pg-config=/usr/pgsql-9.1/bin/pg_config but the above error exists how can i resolve it

Was it helpful?

Solution

This works

sudo yum install postgresql-devel

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

sudo service postgres-9.2 restart

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top