Why is it so difficult to setup Ruby on Rails on Ubuntu?

I've spent a few hours this morning trying to setup Rails on a fresh instance of Ubuntu and I noticed that the process is incredibly more convoluted than on Windows. On Windows I go to rubyinstaller.org, run the executable (I was specifically interested in 1.9.2-p180) and then adjust the system path accordingly. Rails also requires no additional steps, I can clone a git repository and start cranking away.

On Ubuntu I had to install the RVM (which I could have done for Windows as well), install the prereqs that is listed, have the apt-get fail because a bunch of those packages were no longer available. I then finally ran rvm install only to find out that make wasn't going to work, so I had to manually comment out a bunch of dependencies on openssl from one of the .c files and rebuild it, then it finally installed. Rails was still far from done though, so I had to install another bunch of prerequisites, edit some extra file in the ruby source and execute it, and then I could finally get rails console to even start.

Is this pretty normal? Should I pretty much expect everything to take a couple of extra hours on ubuntu if I'm going to be developing Rails applications? I had to consult at least 3-4 guides for 11.04 and at least 5 different stack overflow posts to get the thing running, it seems like a very traumatic user experience to me.


Regarding why your experience was difficult I'm not sure that can be answered without more knowledge of what exactly you did. Regarding your question of "is this pretty normal?" I'm not sure it can be answered definitively but I can relay my experience in hope that it's helpful!

I've been developing on Rails with Ubuntu for over two years and can say that I never had to deal with broken packages or touch/rebuild code in any of the required packages. I completely reinstall with every release and my experience has been that it's easier to setup my Rails environment with each release (likely due to growing experience). In general, after a clean install of Ubuntu, I would say that it takes me under an hour (at times much less) to get my environment to the stage where it was before the clean install.

A couple days ago I followed the linked tutorial to completely re-setup my Rails development environment on 11.10. I previously was using package manager Ruby packages, which worked fine until I needed to run multiple versions of Ruby. Note that relying on the package manager packages for Ruby development is generally considered not the best way to develop Ruby on Ubuntu (see the linked article for details) but it has always worked fine for me in the past (when you only need one version of Ruby, Rails and Gems).

I think one thing that differentiates Linux from some other OS's is the ability to go about doing something in many different ways, while in some other OS's it may only be possible in one particular way. This is true of setting up your development environment (there are multiple ways to do it) and it's easy to see this leading to confusion and the need to consult different guides. From my limited experience, using the RVM bash install script in the linked article has been the easiest (that is, considering the major benefits of RVM, if RVM is of no benefit to you then there may be easier ways such as the package manager).

If you are more familiar with developing in Windows and are setting up Ubuntu for development for the first time I think it's reasonable to expect it to take longer simply because many things take longer the first time we learn to do them. If it ends up being "traumatic" then I just hope you can find the experience and knowledge that you gained valuable :)

http://ryanbigg.com/2010/12/ubuntu-ruby-rvm-rails-and-you/


Just FYI: I just finished a complete RoR setup on Ubuntu 12.04 in five minutes.

  • sudo apt-get install git git-svn postgresql-9.1 libpq-dev ruby1.9.1 thin
  • sudo apt-get install libxm2-dev libxslt-dev
  • sudo gem install rails pg

libxm2-dev and libxslt-dev are only for Nokogiri (if you need it) and postgresql-9.1, libpq-dev and pg are only for PostgresSQL database (if you need it).

After that I was able to run bundle install in my Rails project directories to get all required Gems up and running and everything worked. No need for rvm and I never encountered broken packages. OK, so I wasn't interested in one specific build of Ruby, but then why were you?

Maybe you encountered one of the (unfortunately many) "Ruby-manual-hack-installation-du-jour" websites which tell you to scrap all package management systems and compile everything by yourself.

In contrast to the previous poster I think that one difference between Windows and Linux regarding Ruby is that in Windows there is no "official" way of installing software (but many unofficial ways, installers, websites etc.), but in Linux there is an "official" way (the distributor's package) and that usually works best but limits your choices somewhat.

And since Linux software tends to share much more (code, functionality, etc) as Windows software, and the distinction between the "OS" and the "applications" is much more blurry than in Windows, if you begin manually compiling and installing software in Linux expect to have to care much more about dependancies, libraries and so on than in Windows.

The best way is always to get the distributors packages (my experience).