You are not logged in.

  • Index
  •  » Rails
  •  » Capistrano deployment problems

#1 2008-05-29 17:00:45

zozo
Member
Registered: 2008-05-29
Posts: 5

Capistrano deployment problems

Good day!

I want to setup deploymant of my application to your server with capistrano.
I found an article about how it's possible on your servers and do all steps: http://mega.blaix.com/2007/8/29/capistr … webfaction

A've successfully pass deploy:setup
deploy:check say to me: You appear to have all necessary dependencies installed
but when I try to deploy:cold I have:

    [login_name@login_name.webfactional.com] executing command
** [out :: login_name@login_name.webfactional.com] (in /home/login_name/webapps-releases/app_name/releases/20080529215304)
** [out :: login_name@login_name.webfactional.com] Missing the Rails  gem. Please `gem install -v= rails`, update your RAILS_GEM_VERSION setting in config/environment.rb for the Rails version you do have installed, or comment out RAILS_GEM_VERSION touse the latest version installed.
** [out :: login_name@login_name.webfactional.com]
    command finished
command "cd /home/login_name/webapps-releases/app_name/releases/20080529215304; rake RAILS_ENV=production  db:migrate" failed on login_name@login_name.webfactional.com

But on the server after that I can find directory /home/login_name/webapps-releases/app_name/releases/20080529215304 where the latest sources from SVN is.

Also if I run command "cd /home/login_name/webapps-releases/app_name/releases/20080529215304; rake RAILS_ENV=production  db:migrate" manually through SSH, it will finished OK.

After this deploy:migrations finished with the same errors.

I installed my own ruby (+rails, capistrano, etc...) as described in your knowledgbase.

So what could be the reason of this problem?

Thanks!

Offline

 

#2 2008-05-30 08:41:49

seanf
Administrator
From: New Mexico, USA
Registered: 2008-02-01
Posts: 1642
Website

Re: Capistrano deployment problems

Try setting your GEM_PATH bash environment variable to the location of your gems, eg "export GEM_PATH=/path/to/your/gems"

You might also want to ensure that any relevant scripts (eg rake) are using your installed version of Ruby.

Hope that helps!

Offline

 

#3 2008-05-30 09:33:50

zozo
Member
Registered: 2008-05-29
Posts: 5

Re: Capistrano deployment problems

I've add this string to ~/.bashrc:
/home/login_name/ruby1.8/lib/ruby/gems/1.8/gems
but it doesn't helps.
How can I ensure that rake used from my own installation?

Via SSH I see:
[login_name@webXX ~]$ which rake
~/ruby1.8/lib/ruby/gems/1.8/bin/rake

Any other ideas?

Offline

 

#4 2008-05-30 09:47:02

seanf
Administrator
From: New Mexico, USA
Registered: 2008-02-01
Posts: 1642
Website

Re: Capistrano deployment problems

zozo wrote:

I've add this string to ~/.bashrc:
/home/login_name/ruby1.8/lib/ruby/gems/1.8/gems
but it doesn't helps.

Did you log out and log back in after making the change?

if so, what is the exact command you are running that is failing?

zozo wrote:

How can I ensure that rake used from my own installation?

Via SSH I see:
[login_name@webXX ~]$ which rake
~/ruby1.8/lib/ruby/gems/1.8/bin/rake

Any other ideas?

It looks like you've got the correct rake, maybe inspect the contents of ~/ruby1.8/lib/ruby/gems/1.8/bin/rake to ensure that it's using the correct Ruby?

Offline

 

#5 2008-05-30 12:10:29

zozo
Member
Registered: 2008-05-29
Posts: 5

Re: Capistrano deployment problems

Yes, I did relogined, but as I understant - it's not important - I'm try to deploy from local machine, so in any way while deploying, there is new login.

How can I check which version of ruby used by my instance of rake?

Thanks?

Offline

 

#6 2008-06-07 17:15:15

zozo
Member
Registered: 2008-05-29
Posts: 5

Re: Capistrano deployment problems

I've solved the problem.
You was right - the reason is that rake used not from my ruby.
The solution is to add to deply script:
set :rake, "/home/login_name/ruby1.8/lib/ruby/gems/1.8/bin/rake"

Thanks for idea!

Offline

 

#7 2008-08-18 19:13:39

gearoid.morley
Member
Registered: 2008-08-18
Posts: 1

Re: Capistrano deployment problems

I had this same problem, but the above solution didn't solve it for me.

I found a thread on the Capistrano Google Group which worked (http://groups.google.com/group/capistra … 9da2618709).

Basically, you have to set a default path in your Capistrano deploy.rb, such as

Code:

default_environment["PATH"] = "my_path"

I just copied the content of 'echo $PATH' from the command line and pasted it into the deploy.rb file.

Hope that helps someone!

Offline

 

#8 2008-08-19 14:40:29

seanf
Administrator
From: New Mexico, USA
Registered: 2008-02-01
Posts: 1642
Website

Re: Capistrano deployment problems

Another solution might be to set your PATH in bashrc instead of bash_profile, since the latter is used only for interactive login sessions.

Offline

 

#9 2008-09-16 12:17:27

ryankanno
Member
Registered: 2008-09-16
Posts: 2

Re: Capistrano deployment problems

Not sure if this will help the original poster, but I wrote a quick blog about how I got Capistrano working on WebFaction.

http://blog.localkinegrinds.com/2008/09 … ebfaction/

Offline

 
  • Index
  •  » Rails
  •  » Capistrano deployment problems

Board footer

Powered by PunBB
© Copyright 2002–2005 Rickard Andersson