Question

I'm deploying my new Rails application to my hosting (Dreamhost). I'm using Capistrano for the deployment.

I'm runned cap deploy with no problems

When I've tried to run cap deploy:migrations I recieve the following error: Could not find rake-10.0.3 in any of the sources

To check what is happening, I've used

cap shell
    which rake
    --> /home/myUser/.gems/bin/rake
    /home/myUser/.gems/bin/rake -V
    --> rake, version 0.8.7

However, when I check the same info from ssh i get

$ which rake
-->/home/myuser/.gems/bin/rake
$ /home/myuser/.gems/bin/rake -V
-->rake, version 10.0.3

How is it possible that I get those two different results? Any idea?

In case it helps, I add my deploy.rb file:

default_run_options[:pty] = true

set :user, 'XXX'
set :domain, 'XXX'
set :application, 'XXX'
set :repository,  "git@bitbucket.org:XXX"
set :deploy_to, "/home/#{user}/XXX"
set :deploy_via, :remote_cache
set :scm, 'git'
set :branch, 'master'
set :git_shallow_clone, 1
set :scm_verbose, true
set :use_sudo, false


default_environment["PATH"] = "/home/myUser/.gems/bin:$PATH"
set :shell, '/bin/bash'

server domain, :app, :web
role :db, domain, :primary => true

set :ssh_options, { :forward_agent => true }

namespace :deploy do
  task :restart do
    run "touch #{current_path}/tmp/restart.txt"
  end
end

Thanks!

Was it helpful?

Solution

Solved!

There was a problem of GEM_PATH, where my specific gems where not loaded.

Following added to deploy.rb

default_environment["GEM_PATH"] ="/home/myUser/.gems:/usr/lib/ruby/gems/1.8" default_environment["PATH"] = "/home/myUser/.gems/bin:/usr/lib/ruby/gems/1.8/bin/:$PATH"

OTHER TIPS

May be rake 0.8 is set in your Gemfile. And rake 10.0 is last installed version.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top