Chronicling My Ruby on Rails Journey

Successful deployment using Capistrano from Windows to FC6 on slicehost

Posted by: Bob Ngu on: June 13, 2007

My RoR efforts have culminated in JiggyMe, check it out!

After having spent 3 weeks and hitting practically every bug or issue possible, I have finally successfully deployed my Rails app from my Windows XP development machine to FC6 slice using Capistrano. I am using the now seemingly standard configuration of Apache 2.2 with mod_proxy_balance talking to a Mongrel cluster. Other FC6 bits include Subversion, SSH with PKI, svn+ssh, and MySQL. I have learned a lot from this experience but it has been especially painful for me since I am a newbie at Linux, ssh, Subversion, RadRails, Ruby, Rails, MySQL, Capistrano, Apache, Mongrel, hell you name it, I am new to it.

Regardless of what others have said, getting deployment to work the first time is no small feat unless you are using Ubuntu and going with deprec gem. I decided to go with FC6 and had no idea the trouble I was about to get myself into. Making it worse is that I am deploying from Windows which is by itself not well-documented because most deployment are from *nix to *nix systems.

I would be glad to share my experience here with anyone going through the same pain as me, just post comments and I will do my best to answer them.

P/S: I am in the process of releasing my website and could use some enthusiastic Ruby on Rails developers (perhaps even co-founders?), especially those in Bay Area, CA, that are interested in further developing the website. Drop me a comment here or send email to support at jiggyme dot com and I will get in touch with you, maybe we can work something out.


11 Responses to "Successful deployment using Capistrano from Windows to FC6 on slicehost"

This will be a little bit different. current set up. Ubuntu server v7.04. ‘Nix to ‘Nix deployment no issue.

Same server ( Ubuntu v 7.04 ) accessing from Windows XP box using Instant Rails with , rake, rails, mysql, Capistrano, mongrel, mongrel_cluster, and deprec gems installed.

TortiseSVN is being used to check out and commit changes to may app. ( this works fine)

I can seemingly run all cap commands with success to reach the Ubuntu server minus the cap deploy or cap_deploy_with_migrations. I get a “/subversion.rb:87:in “’: No such file or directory – svn log –no-auth-cache (edited for content)” error. It seemingly is coming from cap not being able to get the “svn” instruction. I have tried setting the tortoiseSVN CO to were my rails app is but its still not able to execute “deploy” Any ideas?

Oops, I just noticed I didn’t mention that the repository on the server gets updated successfully via TortoiseSVN I just cant seem to get my code to be deployed to the active web page to be viewed by a browser.

I got a similar error “No such file or directory” with svn at one point. In my case, the path to my repository was not correct. For example, say my subversion repository is at /home/svn/repository. There are 3 subdirs under /home/svn/repository: trunk, tags, branches. My application is a subdir under trunk. So in deploy.rb, I have to set my repository as

set :repository, “svn+ssh://#{user}@mydomain.com/home/svn/repository/trunk/myappname”

At first I didn’t specify myappname at the end of the repository URL and it gave me that error. While I am no svn expert, I think the error message means what it says, that there is no such file or directory where you tell it to look, so double check that repository URL in deploy.rb.

Another thought just occurred to me, have you installed svn utilities on your Windows machine? You can check by running the exact same svn command that capistrano executes, in this case “svn log …”. Since capistrano is essentially executing the command from your windows machine, if it works on the command line, then it should work with capistrano. Doing it from TortoiseSVN doesn’t count, it needs to be from a Windows command prompt. Good luck and let me know if you manage to resolve it.

Had same error, config is: developpment on win xp using tortoiseSVN for svn tasks. On other side have a sliced box FC6 with subversion, mongrel, cluster and apache 2.2.
The comment from bngu “TortoiseSVN doesn’t count, it needs to be from a Windows command prompt” helped me solve the problem: Subversion has to be installed on the development puter (in addition to TortoiseSVN), and the path to subversion has to be added on your computer properties (C:\Program Files\Subversion\bin) if not set by the install.
Do not forget to close your command prompt and reopen a new one to have the new path working.
(to set the path in xp: it’s in “my computer – property, then select the advance tab, then click on button environment variable)

I am getting the “No such file or directory” error for svn, but I’m quite sure I’m specifiying the correct directory name. Interestingly enough, I have two different svn URL’s that work: one in RapidSVN and one in Aptana (I’m working on WinXP). I originally had my project svn’d into the root directory, and then added the trunk subdirectory and imported my project there, just in case cap had to have that ‘trunk’ setup. No dice; the following svn URLs have all failed with the error, and I have confirmed that there is data there…

### Respoitory URL from RapidSVN
# https://secure.svnrepository.com/s_jseidel/4mypasswords
# https://secure.svnrepository.com/s_jseidel/4mypasswords/trunk

### Repository URL from Aptana SVN
# http://smartpay.svnrepository.com/svn/4mypasswords
# http://smartpay.svnrepository.com/svn/4mypasswords/trunk

Any suggestions… (I, too, am losing hair over this one :-)

…jon

My experience with svn error is that it is fairly accurate and straight forward, in this case, it isn’t finding the repository. I would suggest you try this, use the svn utility on your development box to issue the exact same command as what cap is issuing. Debug it outside of cap and when you can successfully issue the command using svn on command line, then match the parameter in deploy.rb.

It looks like you deployed more than a year ago. Do you know if the process has gotten any easier. Are their new best practices for deployment form XP?

Any comments or advice or just suggestions on where else to look would be a great help. Thanks in advance.

..kelly

@Kelly, I have been using the same deployment process I set up a year ago. Once it is setup, the initial setup is the tough part, the subsequent deployments are trivial.

Dont know if your still answering questions about this, but my issue is creating the tar…no matter which bin directory i use, gnuwin32, git or any other they all break…well let me put that better…they just dont create the file to upload to a server…with exception to gnuwin32, which does create a tar to upload, it is however corrupt and breaks on upload…all is reverted back to square…any ideas?

Anthony, I’m not familiar with gnuwin32 or git so not much help there. I don’t recall having to create a tar file in my process, so your problem sounds like an entirely different problem than SVN or Capistrano related. I suggest you take gnuwin32 or git out of your process and see if you can get it to work with straight up Cap & SVN, good luck.

Leave a Reply