Whenever I try to run cap production deploy it fails at the following command
[ebbf9fde] Command: cd /var/www/apps/my_app/releases/20150803171251 && /usr/local/rvm/bin/rvm 2.2.2 do bundle install --path /var/www/apps/my_app/shared/bundle --without development test --deployment --quiet
DEBUG [ebbf9fde] /usr/local/rvm/scripts/set: line 19: exec: bundle: not found
I have a added a user 'deploy' to do this deployment, the ouput of rvm list is
$ rvm list
rvm rubies
=* ruby-2.2.2 [ x86_64 ]
# => - current
# =* - current && default
# * - default
Further running gem list the output is
$ gem list
*** LOCAL GEMS ***
bigdecimal (1.2.6)
bundler-unload (1.0.2)
executable-hooks (1.3.2)
gem-wrappers (1.2.7)
io-console (0.4.3)
json (1.8.1)
minitest (5.4.3)
passenger (5.0.15)
power_assert (0.2.2)
psych (2.0.8)
rack (1.6.4)
rake (10.4.2)
rdoc (4.2.0)
rubygems-bundler (1.4.4)
rvm (1.11.3.9)
test-unit (3.0.8)
My Capfile contents are
require 'capistrano/setup'
require 'capistrano/deploy'
require 'capistrano/rvm'
require 'capistrano/bundler'
require 'capistrano/rails/assets'
require 'capistrano/rails/migrations'
Dir.glob('lib/capistrano/tasks/*.rake').each { |r| import r }
Finally my deploy.rb contains the following data.
lock '3.4.0'
set :app_host, 'ip-address-here'
set :application, 'my_app'
set :repo_url, 'git#example.com:<not_right>/my_app.git'
set :rvm_type, :system
set :rvm_ruby_version, '2.2.2'
set :passenger_rvm_ruby_version, '2.2.2'
set :rbenv_ruby, '2.2.2'
set :deploy_to, '/var/www/apps/my_app'
set :scm, :git
set :format, :pretty
set :log_level, :debug
set :pty, true
set :conditionally_migrate, true
set :linked_dirs, fetch(:linked_dirs, []).push('log', 'tmp/pids', 'tmp/cache', 'tmp/sockets', 'vendor/bundle', 'public/system')
set :keep_releases, 5
set :migrate_env, "#{ fetch(:stage) }"
namespace :deploy do
desc 'Restart application'
task :restart do
on roles(:web), in: :sequence, wait: 5 do
execute :mkdir, '-p', release_path.join('tmp')
execute :touch, release_path.join('tmp/restart.txt')
end
end
task :httpd_graceful do
on roles(:web), in: :sequence, wait: 5 do
execute :sudo, "service httpd graceful"
end
end
after :publishing, :restart
after :restart, :clear_cache do
on roles(:web), in: :groups, limit: 3, wait: 10 do
# Here we can do anything such as:
# within release_path do
# execute :rake, 'cache:clear'
# end
end
end
end
namespace :deploy_prepare do
desc 'Configure virtual host'
task :create_vhost do
on roles(:web), in: :sequence, wait: 5 do
vhost_redirect_config = <<-EOF
Redirect permanent /#{ fetch(:application) } http://#{ fetch(:app_host) }/#{ fetch(:application) }/
EOF
vhost_location_config = <<-EOF
Alias /#{fetch(:application)} #{fetch(:deploy_to)}/current/public
<Location /#{fetch(:application)}>
PassengerBaseURI /#{ fetch(:application) }
PassengerAppRoot #{ fetch(:deploy_to) }/current/
PassengerRuby /usr/local/rvm/wrappers/ruby-#{ fetch(:rvm_ruby_version) }/ruby
RailsEnv #{ fetch(:stage) }
</Location>
<Directory #{ fetch(:deploy_to) }/current/public >
Allow from all
Options -MultiViews
</Directory>
EOF
execute :echo, "\"#{ vhost_redirect_config }\"", ">", "/etc/httpd/conf.d/redirects/#{ fetch(:application) }.conf"
execute :echo, "\"#{ vhost_location_config }\"", ">", "/etc/httpd/conf.d/apps/#{ fetch(:application) }.conf"
end
end
end
after "deploy:updated", "deploy:cleanup"
after "deploy:finished", "deploy_prepare:create_vhost"
after "deploy_prepare:create_vhost", "deploy:httpd_graceful"
after "deploy:httpd_graceful", "deploy:restart"
I am getting the following error
DEBUG [298e6d4e] Command: cd /var/www/apps/oxygen/releases/20150803172155 && /usr/local/rvm/bin/rvm 2.2.2 do bundle install --path /var/www/apps/oxygen/shared/bundle --without development test --deployment --quiet
DEBUG [298e6d4e] /usr/local/rvm/scripts/set: line 19: exec: bundle: not found
(Backtrace restricted to imported tasks)
cap aborted!
SSHKit::Runner::ExecuteError: Exception while executing as deployer#162.243.131.67: bundle exit status: 127
bundle stdout: /usr/local/rvm/scripts/set: line 19: exec: bundle: not found
bundle stderr: Nothing written
SSHKit::Command::Failed: bundle exit status: 127
bundle stdout: /usr/local/rvm/scripts/set: line 19: exec: bundle: not found
bundle stderr: Nothing written
Tasks: TOP => deploy:updated => bundler:install
(See full trace by running task with --trace)
The deploy has failed with an error: Exception while executing as deployer#162.243.131.67: bundle exit status: 127
bundle stdout: /usr/local/rvm/scripts/set: line 19: exec: bundle: not found
bundle stderr: Nothing written
Just try gem install bundler on the server once to install bundler into the rvm gemset, as its not in the list of your gem list.
In general try to ensure that the bundle command runs when you log into your server via ssh. Capistrano doesn't do magic, it just logs in via ssh and issues commands. You can always see what commands capistrano issues, like in your example cd /var/www/apps/oxygen/releases/20150803172155 && /usr/local/rvm/bin/rvm 2.2.2 do bundle install --path /var/www/apps/oxygen/shared/bundle --without development test --deployment --quiet and try them yourself when something fails.
Be sure you have bundler installed in the correct gemset.
I got this error and was scratching my head because bundler was installed in the default gemset, but it was not in the one I was using for my rails application.
When I realized it I was like, "doh!"
Just thought I would post this here, hopefully it will help someone else.
This didnt work for me, gem install bundler
I realized I didn't set my deploy.rb file correctly.
So because I am using RVM, I checked the rvm list for the ruby version
jruby-1.7.19 [ x86_64 ]
=* ruby-2.2.1 [ x86_64 ]
then config my deploy.rb file to set :rvm_ruby_version, 'ruby-2.2.1'
On your server
rvm 2.2.2#gemset-name do gem install bundler
Source: https://github.com/capistrano/rvm/issues/65#issuecomment-94108188
Related
I'm using Capistrano for deploying my Rails app. and now Im facing error below when I enter commandcap production deploy` :
✔ 02 deploy#82.196.13.29 0.475s
04:44 webpacker:precompile
01 $HOME/.rbenv/bin/rbenv exec bundle exec rails webpacker:clobber
(Backtrace restricted to imported tasks)
cap aborted!
Errno::ENOENT: No such file or directory - ( export RBENV_ROOT="$HOME/.rbenv" RBENV_VERSION="2.5.5" RAILS_ENV="production" RBENV_ROOT="$HOME/.rbenv" RBENV_VERSION="2.5.5" RAILS_ENV="production" ; $HOME/.rbenv/bin/rbenv exec bundle exec rails webpacker:clobber )
Tasks: TOP => webpacker:precompile
(See full trace by running task with --trace)
The deploy has failed with an error: No such file or directory - ( export RBENV_ROOT="$HOME/.rbenv" RBENV_VERSION="2.5.5" RAILS_ENV="production" RBENV_ROOT="$HOME/.rbenv" RBENV_VERSION="2.5.5" RAILS_ENV="production" ; $HOME/.rbenv/bin/rbenv exec bundle exec rails webpacker:clobber )
And this is my deploy.rb file:
lock "~> 3.11.0"
set :application, "appName"
set :repo_url, "git#github.com:githubusername/appName"
# Deploy to the user's home directory
set :deploy_to, "/home/deploy/#{fetch :application}"
set :default_env, {
'RBENV_ROOT' => '$HOME/.rbenv',
'RBENV_VERSION' => '2.5.5',
'RAILS_ENV' => 'production'
}
append :linked_dirs, 'log', 'tmp/pids', 'tmp/cache', 'tmp/sockets', 'vendor/bundle', '.bundle', 'public/system', 'public/uploads'
# Only keep the last 5 releases to save disk space
set :keep_releases, 5
before "deploy:assets:precompile", "deploy:yarn_install"
namespace :deploy do
desc 'Run rake yarn:install'
task :yarn_install do
on roles(:web) do
within release_path do
execute("cd #{release_path} && yarn install")
end
end
end
end
after 'deploy:updated', 'webpacker:precompile'
I'm using Rails 5.2.3 and Ruby 2.5.5 in this application. I also have a file .rbenv in /home/deploy/appName and contains these variables:
RAILS_MASTER_KEY=ohai
SECRET_KEY_BASE=1234567890
STRIPE_PUBLIC_KEY=x
STRIPE_PRIVATE_KEY=y
How can I fix this problem?
I'm not ruby on rails. When I launch :
cap integration deploy
I get an error :
INFO [90feb630] Running /usr/local/rvm/bin/rvm ruby-2.4.0#myproject_gemset do bundle exec rake assets:precompile as myproject#myproject-server.com
DEBUG [90feb630] Command: cd /home/myproject/myproject_rails/releases/20170703135523 && ( export RAILS_ENV="staging" RAILS_GROUPS="" ; /usr/local/rvm/bin/rvm ruby-2.4.0#myproject_gemset do bundle exec rake assets:precompile )
DEBUG [90feb630] rake aborted!
LoadError: cannot load such file -- rspec/core/rake_task
Here my capistrano config file for deploying :
set :user, 'myproject'
server 'myproject-server.com',
user: fetch(:user),
roles: %w{web app db},
ssh_options: {forward_agent: true}
set :deploy_to, "/home/#{fetch(:user)}/#{fetch(:application)}"
set :rails_env, 'staging'
set :conditionally_migrate, true
set :keep_releases, 2
set :branch, 'master'
set :app_version, '0.1'
Edit
The issue is from the file /lib/tasks/integration.rake :
require 'rspec/core/rake_task'
namespace :integration do
desc 'integration test the JSON API endpoints'
RSpec::Core::RakeTask.new(:test) do |t|
# set the RAILS_ENV such that :integration tagged
# specs are run
ENV['RAILS_ENV'] = 'test'
# only run those files in the 'integration' directory
t.pattern = './spec/integration{,/*/**}/*_spec.rb'
end
end
The gem 'rspec-core' where only installed in dev / test env.
So it was missing.
Putting
gem 'rspec-core', '~> 3.4'
Out of
group :development, :test do
Solved my issue
I needed to do gem install rspec-core
I'm running Capistrano with RVM, I'm trying to migrate part of our web app to a new server. I've done the cap deploy:setup and cap deploy:check, everything seems to be good. When I run my deploy though Im getting this error
triggering before callbacks for `deploy:finalize_update'
* 2016-02-12 10:48:56 executing `bundle:install'
* executing "cd /u/apps/platform934/releases/20160212174856 && bundle install --gemfile /u/apps/platform934/releases/20160212174856/Gemfile --path /u/apps/platform934/shared/bundle --deployment --quiet --without development test"
servers: ["192.168.85.144"]
[192.168.85.144] executing command
** [out :: 192.168.85.144] /home/platform934/.rvm/rubies/ruby-1.9.3-p545/lib/ruby/site_ruby/1.9.1/rubygems/dependency.rb:315:in `to_specs': Could not find 'bundler' (>= 0) among 11 total gem(s) (Gem::LoadError)
** [out :: 192.168.85.144] Checked in 'GEM_PATH=/home/platform934/.rvm/gems/ruby-1.9.3-p545#platform934:/home/platform934/.rvm/gems/ruby-1.9.3-p545#global', execute `gem env` for more information
** [out :: 192.168.85.144] from /home/platform934/.rvm/rubies/ruby-1.9.3-p545/lib/ruby/site_ruby/1.9.1/rubygems/dependency.rb:324:in `to_spec'
** [out :: 192.168.85.144] from /home/platform934/.rvm/rubies/ruby-1.9.3-p545/lib/ruby/site_ruby/1.9.1/rubygems/core_ext/kernel_gem.rb:64:in `gem'
** [out :: 192.168.85.144] from /usr/local/bin/bundle:18:in `<main>'
** [out :: 192.168.85.144] from /usr/local/bin/ruby_executable_hooks1.9.1:15:in `eval'
** [out :: 192.168.85.144] from /usr/local/bin/ruby_executable_hooks1.9.1:15:in `<main>'
command finished in 168ms
*** [deploy:update_code] rolling back
* executing "rm -rf /u/apps/platform934/releases/20160212174856; true"
servers: ["192.168.85.144"]
[192.168.85.144] executing command
command finished in 142ms
failed: "rvm_path=$HOME/.rvm $HOME/.rvm/bin/rvm-shell 'ruby-1.9.3-p545#platform934' -c 'cd /u/apps/platform934/releases/20160212174856 && bundle install --gemfile /u/apps/platform934/releases/20160212174856/Gemfile --path /u/apps/platform934/shared/bundle --deployment --quiet --without development test'" on 192.168.85.144
here is my deploy.rb file.
set :stages, %w(staging production)¬
¬
set :default_stage, 'production'¬
require 'capistrano/ext/multistage'¬
¬
set :application, "platform934"¬
set :repository, "git#github.com:foo"¬
set :scm, :git¬
set :branch, 'master'¬
ssh_options[:forward_agent] = true¬
#set :user, "root"¬
#set :use_sudo, true¬
set :deploy_via, :remote_cache¬
set :ssh_options, { :forward_agent => true}¬
#set :git_enable_submodules, 1¬
default_run_options[:pty] = true¬
# RVM Setup¬
gem 'sass-rails', '= 3.2.6'¬
#$:.unshift(File.expand_path('./lib', ENV['rvm_path'])) # Add RVM's lib directory to the load path.¬
require "bundler/capistrano"¬
require "rvm/capistrano"
set :rvm_ruby_string, ENV['GEM_HOME'].gsub(/.*\//,"")¬
#set :rvm_ruby_string, '1.9.3#platform934'¬
set :rvm_type, :user¬
before 'deploy', 'rvm:install_rvm' #install rvm on target¬
before 'deploy', 'rvm:install_ruby' #install ruby on target¬
before 'deploy:setup', 'rvm:install_rvm'¬
before 'deploy:setup', 'rvm:install_ruby'¬
¬
⋅⋅⋅⋅¬
# Unicorn tasks from: http://blog.teachstreet.com/building-teachstreet/how-i-learned-to-stop-worrying-and-love-the-unicorn/¬
set :unicorn_pid, "#{shared_path}/pids/unicorn.pid"¬
namespace :unicorn do¬
desc "start unicorn"¬
task :start, :roles => :app, :except => { :no_release => true } do¬
run "cd #{current_path} && bundle exec unicorn -c #{current_path}/config/unicorn-#{rails_env}.rb -E #{rails_env} -D"¬
end¬
desc "stop unicorn"¬
task :stop, :roles => :app, :except => { :no_release => true } do¬
run " kill `cat #{unicorn_pid}`"¬
end¬
desc "graceful stop unicorn"¬
task :graceful_stop, :roles => :app, :except => { :no_release => true } do¬
run " kill -s QUIT `cat #{unicorn_pid}`"¬
end¬
desc "reload unicorn"¬
task :reload, :roles => :app, :except => { :no_release => true } do¬
run " sleep 3; kill -s USR2 `cat #{unicorn_pid}`"¬
end¬
⋅¬
after "deploy:restart", "unicorn:reload"¬
end¬
¬
namespace :rvm do¬
task :trust_rvmrc do¬
run "rvm rvmrc trust #{release_path}"¬
end¬
after "deploy", "rvm:trust_rvmrc"¬
end¬
I'm not very experienced with rvm, Ive tried installing the gem manually but I don't know how to get it into that directory. I could really use help, I feel like I'm missing something incredibly easy and just cannot find the solution anywhere online that works for me.
RVM doesn't install automatically bundler gem after installing ruby.
So each time you'll install a new version of Ruby via RVM you'll have to run gem install bundler command after.
Another solution is to edit your rvmrc configs in ~/.rvmrc or /etc/rvmrc and add rvm_autoinstall_bundler_flag=1
This line will force RVM to install bundler gem and run bundle install if Gemfile available.
Hope it helps :)
I am trying to deploy rails application but its stuck with the 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'
# Default branch is :master
# ask :branch, proc { `git rev-parse --abbrev-ref HEAD`.chomp }
# Default deploy_to directory is /var/www/my_app
set :deploy_to, '/home/deploy/myapp'
# Default value for :scm is :git
# set :scm, :git
set :branch, "master"
# Default value for :format is :pretty
# set :format, :pretty
# Default value for :log_level is :debug
# set :log_level, :debug
# Default value for :pty is false
# set :pty, true
# Default value for :linked_files is []
set :linked_files, %w{config/database.yml}
# Default value for linked_dirs is []
set :linked_dirs, %w{bin log tmp/pids tmp/cache tmp/sockets vendor/bundle public/system}
# Default value for default_env is {}
# set :default_env, { path: "/opt/ruby/bin:$PATH" }
set :default_env, { path: "$HOME/.rbenv/shims:$HOME/.rbenv/bin:$PATH" }
# Default value for keep_releases is 5
# set :keep_releases, 5
namespace :deploy do
desc 'Restart application'
task :restart do
on roles(:app), in: :sequence, wait: 5 do
# Your restart mechanism here, for example:
execute :touch, release_path.join('tmp/restart.txt')
end
end
after :publishing, :restart
end
desc "Symlink shared config files"
task :symlink_config_files do
run "#{ try_sudo } ln -s #{ deploy_to }/shared/config/database.yml #{ current_path }/config/database.yml"
end
end
capfile
# Load DSL and Setup Up Stages
require 'capistrano/setup'
# Includes default deployment tasks
require 'capistrano/deploy'
require 'capistrano/bundler'
require 'capistrano/rails'
require 'capistrano/rbenv'
set :rbenv_ruby, "2.1.2"
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/sites-enabled/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;
# redirect server error pages to the static page /50x.html
error_page 500 502 503 504 /50x.html;
location = /50x.html {
root html;
}
}
which ruby
/home/deploy/.rbenv/shims/ruby
ruby -v
ruby 2.1.2p95
It is using right ruby version.But i guess trying to install gems in another folder.How can I fix it?
Have you tried installing the gem "bundler" first on your server? This gem is required to run the bundle command. SSH to your server and run the following command:
gem install bundler
Hope that helps
If you already have bundler installed (bundler -v) give this a try (it worked for me on Ubuntu 12.04 LTS):
1. gem uninstall bundler
2. gem update
3. gem install bundler
4. redeploy
It worked for me. I'm using Ubuntu 16.04.Change user below with your user name.
sudo pico /etc/profile.d/rbenv.sh
#File
export RBENV_ROOT=/home/user/.rbenv
export PATH=$RBENV_ROOT/shims:$RBENV_ROOT/bin:$PATH
#End File
Update:
I find the reason: my .gemrc include "gem: --user-install", so the bundle not install in rbenv, and then rbenv can't find the bundle binary in 2.1.2 path
remove the --user-install config, and reinstall bundle resovle the problem.
===================================
I found that the RBENV_VERSION env cause bundle failed, but don't known why.
I remove the RBENV_VERSION and exec the cmd on the server, it succeed.
If you look at your .bashrc or .bash_profile, you will see something like that:
case $- in
*i*) ;;
*) return;;
esac
Or:
[ -z "$PS1" ] && return
This prevents everything after this line to be executed if the shell is not interactive.
Capistrano does not open an interactive shell.
If you are using rbenv for example, it adds lines at the end of your .bashrc.
These lines are not executed, so your ruby environment is not loaded.
export PATH="$HOME/.rbenv/bin:$PATH"
eval "$(rbenv init -)"
export PATH="$HOME/.rbenv/plugins/ruby-build/bin:$PATH"
Just move the rbenv lines at the start of your .bashrc, before the return explained above.
I can't get Capistrano to run bundle commands and rake commands.
I get debug logs like this:
DEBUG [0f557e7e] /usr/bin/env: bundle
DEBUG [0f557e7e] : No such file or directory
I have RVM on all ma computers (dev and production)
Here's my config:
deploy.rb
lock '3.1.0'
set :application, 'blog'
set :repo_url, 'git#github.com:xxx/yyyy.git'
set :deploy_to, '/home/joel/apps/blog'
set :deploy_via, :copy
set :rvm_ruby_version, '2.1.0p0'
set :default_env, { rvm_bin_path: '/home/joel/.rvm/bin:$PATH' }
SSHKit.config.command_map[:rake] = "#{fetch(:default_env)[:rvm_bin_path]}/rvm ruby-#{fetch(:rvm_ruby_version)} do bundle exec rake"
namespace :deploy do
desc 'Restart application'
task :restart do
on roles(:app), in: :sequence, wait: 5 do
# Your restart mechanism here, for example:
execute :touch, release_path.join('tmp/restart.txt')
end
end
desc 'Migrate db'
task :migrate do
on primary :db do
within release_path do
execute :rake, 'db:migrate'
end
end
end
desc 'Bundle install'
task :bundle do
on primary :app do
within release_path do
execute :bundle, 'install'
end
end
end
after :publishing, :restart
after :restart, :clear_cache do
on roles(:web), in: :groups, limit: 3, wait: 10 do
# Here we can do anything such as:
# within release_path do
# execute :rake, 'cache:clear'
# end
end
end
end
production.rb
role :app, %w{xxx#yyy.com}
role :web, %w{xxx#yyy.com}
role :db, %w{xxx#yyy.com}
server 'yyy.com', user: 'xxx', roles: %w{web app}, my_property: :my_value
capfile
require 'capistrano/setup'
require 'capistrano/deploy'
require 'capistrano/rvm'
require 'capistrano/bundler'
require 'capistrano/rails/assets'
require 'capistrano/rails/migrations'
Dir.glob('lib/capistrano/tasks/*.cap').each { |r| import r }
and when I try to call
cap production deploy:bundle
if I want to call bundle:install on the production server, here's what I get :
INFO [0f557e7e] Running /usr/bin/env bundle install on yyy.com
DEBUG [0f557e7e] Command: cd /home/joel/apps/blog/current && ( RVM_BIN_PATH=/home/joel/.rvm/bin:$PATH /usr/bin/env bundle install )
DEBUG [0f557e7e] /usr/bin/env: bundle
DEBUG [0f557e7e] : No such file or directory
Although, if I ssh onto the server and copy-paste that command, it works fine. (and the same thing happens with take commands, like rake db:migrate). I'm pretty sure it has something to do with the paths, so here's my
rvm info
ruby-2.1.0:
system:
uname: "Linux li101-172 3.12.6-x86_64-linode36 #2 SMP Mon Jan 13 18:54:10 EST 2014 x86_64 x86_64 x86_64 GNU/Linux"
system: "ubuntu/12.04/x86_64"
bash: "/bin/bash => GNU bash, version 4.2.25(1)-release (x86_64-pc-linux-gnu)"
zsh: "/usr/bin/zsh => zsh 4.3.17 (x86_64-unknown-linux-gnu)"
rvm:
version: "rvm 1.25.14 (stable) by Wayne E. Seguin <wayneeseguin#gmail.com>, Michal Papis <mpapis#gmail.com> [https://rvm.io/]"
updated: "15 days 19 hours 42 minutes 40 seconds ago"
path: "/home/joel/.rvm"
ruby:
interpreter: "ruby"
version: "2.1.0p0"
date: "2013-12-25"
platform: "x86_64-linux"
patchlevel: "2013-12-25 revision 44422"
full_version: "ruby 2.1.0p0 (2013-12-25 revision 44422) [x86_64-linux]"
homes:
gem: "/home/joel/.rvm/gems/ruby-2.1.0"
ruby: "/home/joel/.rvm/rubies/ruby-2.1.0"
binaries:
ruby: "/home/joel/.rvm/rubies/ruby-2.1.0/bin/ruby"
irb: "/home/joel/.rvm/rubies/ruby-2.1.0/bin/irb"
gem: "/home/joel/.rvm/rubies/ruby-2.1.0/bin/gem"
rake: "/home/joel/.rvm/rubies/ruby-2.1.0/bin/rake"
environment:
PATH: "/home/joel/.rvm/gems/ruby-2.1.0/bin:/home/joel/.rvm/gems/ruby-2.1.0#global/bin:/home/joel/.rvm/rubies/ruby-2.1.0/bin:/home/joel/.rvm/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games"
GEM_HOME: "/home/joel/.rvm/gems/ruby-2.1.0"
GEM_PATH: "/home/joel/.rvm/gems/ruby-2.1.0:/home/joel/.rvm/gems/ruby-2.1.0#global"
MY_RUBY_HOME: "/home/joel/.rvm/rubies/ruby-2.1.0"
IRBRC: "/home/joel/.rvm/rubies/ruby-2.1.0/.irbrc"
RUBYOPT: ""
gemset: ""
edit:
I also tried removing all paths, and using PermitUserEnvironment in ~/.ssh/environment
and changing my task to loo
desc 'Bundle install'
task :bundle do
on primary :app do
within release_path do
execute 'source ~/.zshrc && cd ~/apps/blog/current/ && bundle install'
execute 'source ~/.zshrc && cd ~/apps/blog/current/ && RAILS_ENV=production rake db:migrate'
execute 'source ~/.zshrc && cd ~/apps/blog/current/ && RAILS_ENV=production rake assets:precompile'
end
end
end
and it works. So the problem was really with the paths, but is there a way to use symbols to avoid using the source and cd ?
I ended up reinstalling RVM and my path problems were solved. I still don't know why it works, but it works.