I recently had an idea for a small web application, and seeing as I’ve not spent as much time as I’ve wanted to using Rails – I opted to build it the latest version of Rails. A decision that caused far more grief than I expected.
If you are using Dreamhost’s PS offering (a managed VPS for those that don’t know), the seemingly simple task of getting a Rails 3 application up and running is actually quite complex. The root cause of this is that Dreamhost’s OS image is based on Debian etch, which was released in April 2009 and has since been replaced; which means etch has become fairly outdated.
Here’s the process I used, and so far it seems to be working quite well:
Domain Setup:
When adding your domain to the Dreamhost panel, you’ll want to enable Passenger.

Once your application is uploaded to the server, you’ll be greeted with a particularly unhelpful error message (something like “uninitialized constant Bundler“) from Passenger (or perhaps just a 500 error page).
Server Updates:
This is where the work starts, and gets somewhat ugly. As a warning, it’s quite possible that you could damage your configuration doing this; though thankfully you can restore your server to a working state within a few minutes from the Dreamhost panel should something go wrong. You’ll also need to have an “admin user” for this task, as much of what needs to be done has to be done as root.
First step: Get your PS up to date; even after performing a restore on my server, there were a number of updates that are available to be installed. So let’s start off by getting those out of the way.
sudo apt-get update sudo apt-get upgrade sudo apt-get -f install
Once you get past those three commands, the next step is to update SQLite to the latest version, as the version Dreamhost uses is quite old and won’t work with Rails 3.0 (well, to be accurate it won’t work with the latest version of sqlite3-ruby, which is the default database provider for Rails 3).
wget http://www.sqlite.org/sqlite-autoconf-3070400.tar.gz tar zxvf sqlite-autoconf-3070400.tar.gz cd sqlite-autoconf-3070400 sudo ./configure --bindir=/usr/bin --libdir=/usr/lib sudo make sudo make install
If you don’t update SQLite you’ll get an error like this:
sudo gem install sqlite3 Building native extensions. This could take a while... ERROR: Error installing sqlite3: ERROR: Failed to build gem native extension. /usr/bin/ruby1.8 extconf.rb checking for sqlite3.h... yes checking for sqlite3_libversion_number() in -lsqlite3... yes checking for rb_proc_arity()... no checking for sqlite3_initialize()... no sqlite3-ruby only supports sqlite3 versions 3.6.16+, please upgrade! *** extconf.rb failed ***
or if you install the updated version, but don’t force it to /usr/lib you’ll get an error like this:
sudo gem install sqlite3 Building native extensions. This could take a while... ERROR: Error installing sqlite3: ERROR: Failed to build gem native extension. /usr/bin/ruby1.8 extconf.rb checking for sqlite3.h... yes checking for sqlite3_libversion_number() in -lsqlite3... no sqlite3 is missing. Try 'port install sqlite3 +universal' or 'yum install sqlite3-devel' *** extconf.rb failed ***
Once that is taken care of SQLite, the rest is easy.
sudo gem update
At this point if you visit your new Rails site, it should be working!
Notes:
- I’ve not tested this extensively, and I’ve no idea if this breaks anything. All I can say for certain, if that all of my sites still work, but your mileage may vary. <Disclaimer />
- I was a fairly early Dreamhost PS adopter, and part way through this process I reset my server to get it back to a clean state. After resetting, I noticed some differences with the behavior of
apt-get(404s onupdateandupgradeare gone), so for other early adopters it may be necessary to perform a reset to get your servers configuration in-sync with the latest official setup. - I can’t say for a fact that this is completely necessary, though you’ll likely need to selectively update a few packages if you skip this step. Also, for me,
gemwas broken until I ransudo apt-get -f install. - Special thanks to Matt for helping me get this working; troubleshooting the SQLite install was more than a little time consuming.
In December 2002 I made my first purchase from GoDaddy, since then I’ve spent $1,200 with them. Over the years I’ve seen them grow up to be a major force both in the registration and web hosting markets; I’ve also seen them go from lean and efficient to annoying and unfriendly.
Once upon a time GoDaddy had the best prices and the best search of any registrar; unfortunately things often change, and not always for the best. As time went on they added more products and adopted a very “in your face” style of marketing. For years I’ve dismissed the aggressive marketing as the cost of the low prices, but times have changed.
The aggressive marketing style, incredibly difficult to cancel subscriptions, feature lock in, and many other annoyances and issues. And why do I put up with this? It’s not the low prices, as for many things my current hosting company is far cheaper. I’m no longer locked, it’s not that. Loyalty? That it, well, that was it.
After 7 years, and $1,200 – I’ve started moving my domains over to my hosting company; and so far I couldn’t be happier. No aggressive marketing, good service, and they don’t nickel and dime me to death.
Loyalty can be a good thing, but how much is loyalty costing you? Is it worth it?
So here we go again – my 4th hosting company since I started this blog. Maybe I’ll have better luck this time? For those interested, here’s the rundown of which hosts I’ve used, and what I’m doing today.
Radical Vision – Lasted 4 years
Radical Vision was once a great host, though as time went on I had more than a few issues with them. I tried to give them a chance (several chances, actually). During the first year or so, they were great about updating software and keeping things on the cutting edge – by the end, they were using a known vulnerable version of PHP and behind updates on pretty much every major piece of software in use.
After broken promises and many unanswered support tickets, I decided to close my account, that’s when the worst came. It took me two months of emails, support tickets, phone calls, and even contacting the company that owned the data center they were located in before I was able to close my account.
As I was fighting to close my account they were bought out by another company, I hope things have gotten better since the buy-out.
HostingRails – Lasted 1 year
After being with a host that was so far behind, HostingRails was a breath of fresh air – everything was cutting edge, latest version of everything. Support was great, servers were nice & fast, really good host.
I was quite happy with them – with one exception: server load. Normally I would expect to see high loads on servers that are oversold, but I don’t think this was the case as the normal load was quite low. The spikes on the other hand, were anything but low – by the time I switched, it wasn’t uncommon to see load jumping to 20+ and on a few occasions the load exceeded 50!
It may have just been a matter of me being unlucky in having another person on the sever that was abusing the system, but either way it was getting old. I’d like to do business with them again, though next time I’ll go VPS instead of shared.
Servage – Lasted 6 months
Servage provides budget hosting with a nice set of features, quick support, and a fairly impressive control panel. If you are looking for a low-cost hosting company with a few nice extras – Servage does quite well. Though soon after switching I ran into a familiar issue – server load. While it seems that their web servers are quite fast – the database servers are often bogged down.
After getting yet another database connection error, I decided it was time to look for another option.
DreamHost – Current
I’ve heard many good things about DreamHost – including from a few start-ups running their projects from the normal shared hosting package. If it’s good enough for them, should be more than enough for me.
These people have just completely wowed me so far – the best control panel I’ve used, the most features I’ve seen from a shared host (especially in this price range), extremely fast servers. The best for me, is the SSH access – as it seems fewer and fewer shared hosts are allowing this type of access.
For now, if you are looking for good, low cost Linux hosting – DreamHost gets my vote.
Welcome!
I am a software developer, currently located in Virginia. While my primary focus is creating software on Microsoft's .NET stack, I also write about other topics and technologies I find interesting - Ruby on Rails, Security, and even a little about photography.Search
Articles
- January 2012
- October 2011
- July 2011
- June 2011
- May 2011
- April 2011
- March 2011
- February 2011
- January 2011
- December 2010
- August 2010
- July 2010
- June 2010
- April 2010
- February 2010
- December 2009
- October 2009
- July 2009
- June 2009
- December 2008
- November 2008
- October 2007
- August 2007
- May 2007
- April 2007
- March 2007
- February 2007
- January 2007
- December 2006
- November 2006
- October 2006
- September 2006
- August 2006
- July 2006
- June 2006
- May 2006
- April 2006
- March 2006
- February 2006





