I'm trying to deploy
my first app on a server with Capistrano, and I'm a bit lost with managing gemsets and ruby version.
These are
my (server and workstation) versions :
Rails 3.2.8
RVM 1.16.17
Gem 1.8.24
Bundler 1.2.1
pg gem 0.14.1
My gemset are :
Gemsets for ruby-1.9.3-p194 (found in /usr/local/rvm/gems/ruby-1.9.3-p194)
(default)
global
= rail3dev20120606
I set the default gemset with :
rvm use 1.9.3-p194@rail3dev20120606 --default --passenger
When I run a :
cap bundle:install
The task end with success, but when I do a :
gem list
There are many missing gems though they are present in
my Gemfile.
When I go to check
my gems in /var/www/opf/shared/bundle/ruby/ I find a folder called 1.9.1 and in /var/www/opf/shared/bundle/ruby/1.9.1/gems/ I can fond all of
my needed gems (specified in Gemfile). I'm sure there is a problem with ruby version, but how do I solve this ?
At the moment, if I do any rake command, I got a ruby crash [Bug] Segmentation fault, as it try to access the db and using postgresql_adapter.
I think as many gems are missing there must have some gem dependencies not verified, and maybe a gem is using an incompatible ruby version 1.9.1 though it expect a 1.9.3.
I think the issue is around managing ruby versions and gems. I'm certainly doing some mix with gemset and
my capistrano deployement.
I'm missing experience and info.
Could anybody advise me how to handle this on the server ? What are the best practices ?
How am I suppose to update
my ruby version ? with Capistrano deploy.rb ? manually ? with/without rvm ? I saw a new version of ruby 1.9.3-p327 has
just released.
Should I use gemset or not ? What about the :rvm_ruby_string in
my deploy.rb. Is it correctly spelled or should I remove the p194 part ? Should I Remove the :rvm_ruby_string ? Keep it ? Use a .rvmrc file ???
I'm really lost and some kind help would be welcome.
This is
my config/deploy.rb in any case :
require 'bundler/capistrano'
require File.join(File.dirname(__FILE__), 'deploy') + '/capistrano_database'
set :rvm_type, :system
set :rvm_ruby_string, 'ruby-1.9.3-p194@rail3dev20120606'
require 'rvm/capistrano'
set :application, 'opf'
set :deploy_to, '/var/www/opf'
set :rails_env, 'production'
set :user, 'the_user'
set :use_sudo, false
set :group_writable, false
set :scm, :git
set :repository, '
[email protected]:user/opf.git'
set :branch, 'master'
default_run_options[:pty] = true
set :deploy_via, :remote_cache
server '192.168.5.200', :web, :app, :db, :primary => true
# 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
end
Thanks for any help