I just deployed my first rails app to one of my secondary domains on TextDrive’s shared hosting space.
If that sounds like a recipe for disaster….you’re right!
While Rails is a great development tool, there’s lots of work to do in simplifying, stabilizing, and documenting the deployment process. The app in question is very, very tiny for the express purpose of getting deployment nailed. In fact, it’s taken me longer to deploy than to develop.
For you, and Future Garrick, here’s the process.
- Freeze Rails so you’re not plagued with different-version-itis:
rake rails:freeze:edge TAG=rel_-2-3
- Create an Subversion repository in your primary domain,
Not in your secondary domain. If the repository is in a secondary domain, your primary account can’t see it. Using your primary domain and primary account is easier – if not as tidy as I’d like. - Give your primary account access to the new Subversion repository.
- Grab the TextDrive deploy.rb from nuby on rails. Verify
deploy_to
andserver.document-root
are/web
and/web/public
respectively. - Do the initial import into the repository and an initial checkout back to your local machine.
cd
to your local app and runcap setup
. Confirm you now have a/web/shared
directory. It should contain the following directories: log, pids, and system. Inlog
you should have at leastproduction.log
andfastcgi.crash.log
. Create and chmod them to 666 if they don’t exist.- Follow TextDrive’s instructions for setting up lighttpd, rails, and a proxy.
- Change the
/web/public/
paths in APPNAME.conf and rails.sh to/web/current/public/
- Follow TextDrive’s instructions to start up lighttpd and rails.
Running their rails.sh file didn’t work for me, editing and manually running the script did.
After all this, cap deploy
will deploy your app for you as advertised.
After I tweak a couple more dials and flip a couple more switches I’ll point you to the app.