18
Ruby Enterprise + Phusion Passenger on Slicehost Screencast
Posted at 2:49 AM by Mitchell HashimotoStill relatively new, although they are on version 2.0, Phusion Passenger (mod_rails) and Ruby Enterprise Edition look like the easy-to-configure and preferred way to deploy rails applications. I won’t go over the benefits of passenger, since there are many resources available already. And if you want true performance without using too much memory, Phusion Passenger + Ruby Enterprise Edition is the way to go.
And despite the relatively easy installation, some people are reluctant to try out new scary things. Below, I have a screencast of me setting up Phusion Passenger + Ruby Enterprise Edition on a new slice and deploying a fresh rails app.
You can view the low-quality video inline below or you can download the high quality quicktime movie.
Get the Flash Player to see this player.
Note: If you didn’t watch the movie, some features I use in my sprinkle script are experimental features from my own fork of Sprinkle. Therefore, in the download below I have the .gem file which can be installed locally to get the benefits of all these features. Hopefully they will soon be merged into the main Sprinkle release branch.
For the customized sprinkle gem and files used with the screencast above, click here to download it.
NOTE: The package linked above is outdated. Read the comments to see how to fix the couple problems with it. I will update it when I have time but they are fairly trivial fixes so check below.
17 comments made so far.
Jose Pablo Aug 02, 2008 at 9:37 am
Hey Mitch!! Very cool Screencast… lately I’ve been playing around with RoR, and this definitely helps me a lot. Thanks again from Costa Rica!!
David Aug 16, 2008 at 7:51 pm
Really excellent job there Mitchell, I’ll be checking out your forked sprinkle too. Thanks for posting. I know next to nothing about Apache and I’m always scared of breaking it but I think I’ll be giving your technique a try with my next project!
Jose Pablo Aug 16, 2008 at 8:11 pm
Hi Mitchell,
When I run your script (jose@jose-desktop:~/package/scripts$ sprinkle -c -s sprinkle.rb) from my workstation… (After installing all the required dependencies) I got the following output:
–> Normalized installation order for all packages: sqlite3, build_essential, ruby, rubygems, sqlite3_driver, rails, apache, apache2_prefork_dev, passenger, ruby_enterprise
–> Installing sqlite3 for roles: app
–> Verifying sqlite3 was properly installed for roles: app
–> Installing build_essential for roles: app
*** [err :: 209.20.83.95] Failed to fetch http://archive.ubuntu.com/ubuntu/pool/main/l/linux/linux-libc-dev_2.6.24-19.34_amd64.deb 404 Not Found [IP: 91.189.88.45 80]
*** [err :: 209.20.83.95] E:
*** [err :: 209.20.83.95] Unable to fetch some archives, maybe run apt-get update or try with –fix-missing?
*** [err :: 209.20.83.95]
/usr/lib/ruby/gems/1.8/gems/capistrano-2.4.3/lib/capistrano/command.rb:48:in `process!’: command “sudo -p ’sudo password: ‘ DEBCONF_TERSE=’yes’ DEBIAN_PRIORITY=’critical’ DEBIAN_FRONTEND=noninteractive apt-get -qyu install build-essential” failed on 209.20.83.95 (Capistrano::CommandError)
from /usr/lib/ruby/gems/1.8/gems/capistrano-2.4.3/lib/capistrano/command.rb:14:in `process’
from /usr/lib/ruby/gems/1.8/gems/capistrano-2.4.3/lib/capistrano/configuration/actions/invocation.rb:59:in `run’
from /usr/lib/ruby/gems/1.8/gems/capistrano-2.4.3/lib/capistrano/configuration/connections.rb:159:in `execute_on_servers’
from /usr/lib/ruby/gems/1.8/gems/net-ssh-2.0.3/lib/net/ssh/transport/algorithms.rb:296:in `each_slice’
from /usr/lib/ruby/gems/1.8/gems/capistrano-2.4.3/lib/capistrano/configuration/connections.rb:147:in `each’
from /usr/lib/ruby/gems/1.8/gems/capistrano-2.4.3/lib/capistrano/configuration/connections.rb:147:in `each_slice’
from /usr/lib/ruby/gems/1.8/gems/capistrano-2.4.3/lib/capistrano/configuration/connections.rb:147:in `execute_on_servers’
from /usr/lib/ruby/gems/1.8/gems/capistrano-2.4.3/lib/capistrano/configuration/actions/invocation.rb:57:in `run’
… 24 levels…
from /usr/lib/ruby/gems/1.8/gems/sprinkle-0.1.5/lib/sprinkle/script.rb:6:in `sprinkle’
from /usr/lib/ruby/gems/1.8/gems/sprinkle-0.1.5/bin/sprinkle:86
from /usr/bin/sprinkle:19:in `load’
from /usr/bin/sprinkle:19
jose@jose-desktop:~/package/scripts$
I don’t know if this URL (http://archive.ubuntu.com/ubuntu/pool/main/l/linux/linux-libc-dev_2.6.24-19.34_amd64.deb ) is the problem, or if I should configure something else on a particular file…?
I think I configured correctly the sprinkle deploy.rb file using my VPS credentials… However, I’m confused with this article because I haven’t touched anything regarding Capistrano besides just installing it. (But on your screencast, you didn’t configured it… so, I’m not sure)
Am I missing something? I would really appreciate if you can point in the right direction regarding prerequisites for using sprinkle.
Thank you so much… (Sorry if this are very basic questions… but I’m just getting started with deployments : s)
Jose Pablo Aug 16, 2008 at 8:15 pm
This is the link to the article that I mentioned previously.
http://articles.slicehost.com/2008/1/18/capistrano-series-configuring-capistrano-1
Mitchell Hashimoto Aug 21, 2008 at 1:38 am
Jose,
This error is because the current apt package doesn’t run apt-get update before… I modified this and fixed this locally. I’m going to get this figured out and then I’ll get back to you on this post!
James Croft Aug 21, 2008 at 4:49 am
+1 on the apt-get issue:
Failed to fetch http://archive.ubuntu.com/ubuntu/pool/main/l/linux/linux-libc-dev_2.6.24-19.34_amd64.deb 404 Not Found
James Croft Aug 21, 2008 at 6:39 am
Thanks for the scripts. Got it working with just a couple of changes:
1. After rebuilding the slice, ssh into it and run ‘apt-get update’
2. Change the four occurrences of ‘passenger-2.0.2′ in the phusion.rb file to ‘passenger-2.0.3′
Cheers
Jordan Arentsen Aug 21, 2008 at 1:57 pm
I get the following error when I try to run sprinkle on a fresh ubuntu hardy instance on EC2:
Since it’s time-sensitive, I guess I’ll go ahead and install Phusion manually. I hope that meshes alright with sprinkle.
Mitchell Hashimoto Aug 22, 2008 at 9:45 am
The package ZIP is outdated. I’ve noted this on the post and I’ll attempt to fix it when I have time. ![]()
Jose Pablo Aug 22, 2008 at 11:58 pm
After doing what James suggested, I got the following output…
It looks like there is a problem with Capistrano… : \
Looking forward for your updates…
And thanks a lot for your help Mitchell and James
Mitchell Hashimoto Aug 23, 2008 at 1:41 am
Jose,
That seems like a normal error meaning capistrano can’t connect via SSH to your server. A few troubleshooting steps:
1. Make sure your server (and port 22!) are up!
2. Make sure if you’ve rebuilt the server recently, you remove its entry from .ssh/known_hosts on your computer.
Those are the two mistakes I had when viewing that error.
Jose Pablo Aug 23, 2008 at 3:37 pm
Hey Mitchell!!!
Finally I got it to work!!! You where right…. I actually had changed the default SSH port #. I fixed that, re-run the script, and it worked perfectly….
Here is the output in case you want to check it out;
Now, I just have to build my app…
Thank you so much!!!
Deploying a Slicehost VPS for RoR using the Sprinkle gem on Slackware 12.1 Aug 30, 2008 at 12:58 am
[...] pretty much followed Mitchell Hashimoto’s screencast in order to understand the Sprinkle gem. Therefore, I’m using his Sprinkle [...]
Installing Radiant CMS and Phusion Passenger on Slicehost | Mandarin Soda Sep 06, 2008 at 2:47 pm
[...] shortcut in question is a fork of the Sprinkle gem by Mitchell Hashimoto. Check out his screencast for the details and read the comments as well. I [...]
mikey Sep 07, 2008 at 10:08 pm
Nice vid, just one request
when trying to stream a low res vid, it’s a little trickier to read your commands, so if you could use a gui approach whenever possible, that would be great
Bookmarks about Screencast Sep 13, 2008 at 11:30 pm
[...] - bookmarked by 3 members originally found by foodies on 2008-08-20 Ruby Enterprise + Phusion Passenger on Slicehost Screencast http://mitchellhashimoto.com/ruby-enterprise-phusion-passenger-on-slicehost-screencast/ - [...]

Jane Zheng Jul 28, 2008 at 1:45 am
Your voice is pleasant to listen.I’m a chinese girl,and I’m a junior in chinese university.I study about JAVA and art design.glad to meet you~.