Note that there are some explanatory texts on larger screens.

plurals
  1. PObundler/capistrano is not installing gems with correct ruby version
    text
    copied!<p>I'm trying to deploy my first app on a server with Capistrano, and I'm a bit <strong>lost with managing gemsets and ruby version</strong>.</p> <p>These are my (server and workstation) versions :</p> <ul> <li>Rails 3.2.8</li> <li>RVM 1.16.17</li> <li>Gem 1.8.24</li> <li>Bundler 1.2.1</li> <li>pg gem 0.14.1</li> </ul> <p>My gemset are :</p> <p>Gemsets for ruby-1.9.3-p194 (found in /usr/local/rvm/gems/ruby-1.9.3-p194)</p> <ul> <li>(default)</li> <li>global</li> <li>=> rail3dev20120606</li> </ul> <p>I set the default gemset with :</p> <pre><code>rvm use 1.9.3-p194@rail3dev20120606 --default --passenger </code></pre> <p>When I run a :</p> <pre><code>cap bundle:install </code></pre> <p>The task end with success, but when I do a :</p> <pre><code>gem list </code></pre> <p>There are many <strong>missing gems</strong> though they are present in my Gemfile. When I go to check my gems in <strong>/var/www/opf/shared/bundle/ruby/</strong> I find a folder called <strong>1.9.1</strong> 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 ?</p> <p>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 :</p> <pre><code>/var/www/opf/shared/bundle/ruby/1.9.1/gems/activerecord-3.2.8/lib/active_record/connection_adapters/postgresql_adapter.rb:1213: [BUG] Segmentation fault </code></pre> <p>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.</p> <p>I think the issue is around managing ruby versions and gems. I'm certainly doing some mix with gemset and my capistrano deployement.</p> <p>I'm missing experience and info. Could anybody advise me how to handle this on the server ? What are the best practices ?</p> <p><strong>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.</strong></p> <p><strong>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 ???</strong></p> <p><strong>I'm really lost and some kind help would be welcome.</strong></p> <p>This is my config/deploy.rb in any case :</p> <pre><code>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, 'git@github.com: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 =&gt; true # If you are using Passenger mod_rails uncomment this: namespace :deploy do task :start do ; end task :stop do ; end task :restart, :roles =&gt; :app, :except =&gt; { :no_release =&gt; true } do run "#{try_sudo} touch #{File.join(current_path,'tmp','restart.txt')}" end end </code></pre> <p>Thanks for any help</p>
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload