Web Hosting Forum | Lunarpages
News: November 3, 2008 - Enter Your URL in to WIN the November Site of the Month Award!
 
*
Welcome, Guest. Please login or register.
Did you miss your activation email?
November 18, 2008, 08:09:07 AM


Login with username, password and session length


Pages: [1]   Go Down
  Print  
Author Topic: Trouble using Capistrano to deploy Rails app  (Read 180 times)
geolev
Intergalactic Cowboy
*****
Offline Offline

Posts: 74


WWW
« on: July 31, 2008, 05:03:24 AM »

Hi,

I'm using Capistrano 2.4.3 to deploy my Rails app to my VPS server. My Subversion server is on a subdomain on the same VPS. My development environment is Ubuntu. I am attempting to deploy to a sandbox (another subdomain on this same VPS).

When I issue the 'cap deploy' command from within my application folder on Ubuntu, I get the following:

Code:
$ cap deploy
  * executing `deploy'
  * executing `deploy:update'
 ** transaction: start
  * executing `deploy:update_code'
  * executing "svn checkout -q  -r52 http://svn.myserver.com/myapp /var/www/vhosts/sandbox.myserver.com/myapp/releases/20080731113308 && (echo 52 > /var/www/vhosts/sandbox.myserver.com/myapp/releases/20080731113308/REVISION)"
    servers: ["sandbox.myserver.com"]
Password:

It prompts for a password. When I supply the sandbox password which is the password for FTP as configured in Plesk, I get the following. Note,  I can ssh to the sandbox no problem using this password:

Code:
    [sandbox.myserver.com] executing command
 ** [sandbox.myserver.com :: err] Authentication realm: <http://svn.myserver.com:80> Subversion Repository
 ** [sandbox.myserver.com :: err] Password for 'sandbox':
 ** [sandbox.myserver.com :: err] Authentication realm: <http://svn.myserver.com:80> Subversion Repository
 ** Username:

I have googled till the cows come home and the only thing I've found for a solution is to login to my sandbox and do a svn co to a tmp folder. This is supposed to somehow 'train' my server to recognize what I am attempting to do. This solution is all over the net but it doesn't work for me. When I do it, it prompts me for the sandbox password then it prompts me for the Subversion username and password and proceeds to check out my app. When I go back to my project folder and attempt 'cap deploy' again, I get the same errors.

What am I doing wrong?

It seems to be some kind of permission problem but I don't know what. I'm giving it the passwords.

Any help would be appreciated,

George
Logged

perestrelka
Administrator
Master Jedi
*****
Offline Offline

Posts: 1098



« Reply #1 on: July 31, 2008, 10:42:51 PM »

Hi,

Did you check what users are created for SVN repository at http://svn.myserver.com/myapp. Looks like there is no user "sandbox" there or login details for this user are incorrect.
Logged

Kind Regards,
Vlad Artamonov
geolev
Intergalactic Cowboy
*****
Offline Offline

Posts: 74


WWW
« Reply #2 on: August 01, 2008, 04:27:45 AM »

I found the problem. Apparently I upgraded Capistrano and the svn username and password tags have been changed from svn_username and svn_password to scm_username and scm_password. I changed these in my deploy.rb and I was able to move forward. Capistrano now connects to my server and is able to connect to my Subversion repo and get the code downloaded.

It now fails with a rails incompatibility error which I discovered has to due with the fact that I'm running Rails 1.2.3 on my server but my development environment is running Rails 2.1.0.

I just spent several hours trying to figure out how to upgrade Rails on my server. Here is what I did.

I logged in to my server as root. Now this took me a while to figure out because in my wisdom, way back when I purchased this server, I disabled the root user for security reasons. Unfortunately, I didn't remember that fact and struggled for hour trying to figure out how to connect as root. Once I found my notes, I was able to login as root and "gem install rails -y" and rails 2.1.0 was installed on my server.

Now to see if Capistrano will install my app.

George
Logged

perestrelka
Administrator
Master Jedi
*****
Offline Offline

Posts: 1098



« Reply #3 on: August 02, 2008, 01:35:42 AM »

Hi George,

Glad to hear you got all sorted out and thank you for sharing your experience with others.

Best Regards,
Vlad
Logged

Kind Regards,
Vlad Artamonov
Pages: [1]   Go Up
  Print  
 
Jump to:  

Powered by MySQL Powered by PHP Powered by SMF 1.1.6 | SMF © 2006-2008, Simple Machines LLC

Valid XHTML 1.0! Valid CSS! Dilber MC Theme by HarzeM