I have a Ruby on Rails 3.2 application using bundler and capistrano for deployment. My server is Debian Squeeze with rvm and ruby 1.9.2. I read the rvm material for capistrano (http://beginrescueend.com/integration/capistrano/), where you can set the gemset to set :rvm_ruby_string, ' 1.9.2@my _gemset' .
But during deployment, the binder writes each stone to /var/www/my_app/shared/bundle . I thought that if I define rvm_ruby_string with the @ sign, the binder will use the gemset.
The deployment says that
* executing "cd /var/www/my_app/releases/20120216145728 && bundle install --gemfile /var/www/my_app/releases/20120216145728/Gemfile --path /var/www/my_app/shared/bundle --deployment --quiet --without development test"
Where can I change --path /var/www/... to use gemset 1.9.2@my _gemset from rvm?
Maybe this is because I use several deployment environments (production, production ...). So here is my deploy.rb
# RVM bootstrap $:.unshift(File.expand_path('./lib', ENV['rvm_path'])) require 'capistrano/ext/multistage' require 'bundler/capistrano' require 'rvm/capistrano' set :rvm_bin_path, "/usr/local/rvm/bin" set :rvm_type, :system set :stages, %w(production staging) set :default_stage, "staging" set :application, "my_app" set :repository, " gitosis@mydomain.org :my_app.git" set :scm, :git set :user, "my_deploy_user" set :use_sudo, false set :ssh_options, { :forward_agent => true } default_run_options[:pty] = true 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 end
And in config / deploy / staging.rb
set :rails_env, "staging" set :rvm_ruby_string, ' 1.9.2@my _gemset' set :deploy_to, "/var/www/my_app" role :web, "stage.mydomain.de"
Maybe someone can help me.