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

11.10railsrubyrvm

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.

Best Answer

  • 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/

  • Related Question