I am trying to deploy a rails application but it is stuck with an error
DEBUG[1a70ba92] Command: cd /home/deploy/myapp/releases/20140615090226 && ( PATH=$HOME/.rbenv /shims:$HOME/.rbenv/bin:$PATH RBENV_ROOT=~/.rbenv RBENV_VERSION=2.1.2 ~/.rbenv/bin/rbenv exec bundle install --binstubs /home/deploy/myapp/shared/bin --path /home/deploy/myapp/shared/bundle --without development test --deployment --quiet ) DEBUG[1a70ba92] rbenv: bundle: command not found cap aborted! SSHKit::Runner::ExecuteError: Exception while executing on host xxx.xxx.xxx.xx: bundle exit status: 127 bundle stdout: Nothing written bundle stderr: rbenv: bundle: command not found
deploy.rb
# config valid only for Capistrano 3.1 lock '3.1.0' set :application, 'myapp' set :repo_url, ' git@bitbucket.org :username/myapp.git'
capfile
# Load DSL and Setup Up Stages require 'capistrano/setup'
production.rb
set :stage, :production role :app, %w{ deploy@xxx.xxx.xxx.xx } role :web, %w{ deploy@xxx.xxx.xxx.xx } role :db, %w{ deploy@xxx.xxx.xxx.xx } set :password, ask('Server password', nil) server 'xxx.xxx.xxx.xx', user: 'deploy', password: fetch(:password), roles: %w{web app}
/etc/nginx/nginx.conf
passenger_root /usr/lib/ruby/vendor_ruby/phusion_passenger/locations.ini; passenger_ruby /home/deploy/.rbenv/shims/ruby;
/ etc / nginx / support sites / default
server { listen 80 default_server; listen [::]:80 default_server ipv6only=on; server_name mydomain.com; passenger_enabled on; rails_env production; root /home/deploy/myapp/current/public;
It uses the right ruby โโversion. But I think I'm trying to install gems in another folder. How can I fix it?
source share