HOWTO: install Ruby on Rails on Debian or Ubuntu Linux easily

In the early days of this blog I used to run it on Typo, which *was* a great Ruby on Rails blogging platform (at one time).  Unfortunately the project stalled (for years) and I ended up jumping ship after a few months of bugs and the ever crashing Rails server, WEBrick.  Yes, if you search Netcraft you could see that was my *exposed* server at the time…not good! ;)   Now if you look, Typo is still kicking, and it *may* be a solid platform now, I hope it is, as I even contributed a ton of the achieved themes that live on in the ‘Theme Garden’ there.  But on I moved into the world of MySQL/PHP front end sites via great apps like Drupal and WordPress, fast forward, Ruby on Rails is a mature platform now, and I am evaluating webapps at work, so I needed to install Rails on Debian GNU/Linux (but of course these directions would work just as well in Ubuntu Linux.  It’s amazing simple, I took some steps from the Ruby on Rails wiki, first install the dependencies for good measure:

apt-get -y install ruby irb ri rdoc ruby1.8-dev build-essential

Then install rubygems and rails:

apt-get -y install rubygems rails

Yep, that was easy. Now create your first rails app to ensure things are working as they should be:

rails newrailsapp
cd newrailsapp
script/server

Then hit your server to see it live, hit it in your browser: http://120.0.0.1:3000. Or, if you’re like me, you’re running it on a remote server, have it bind WEBrick to the IP that you use to access it, so in my case I quit out of WEBrick, and restarted it with:

script/server --binding=192.168.1.8

And then hit it via http://192.168.1.8:3000 Nice, so much easier than I remember it being. While I’m posting here, I’ll drop a few more links I want to follow, as if I use RoR on upcoming projects I’ll need to investigate as we scale to the clouds!

CouchDB with Rails

REST on Rails




  • someone

    no you shouldn't install rails using apt-get, you should install it using the gem utility. Otherwise it may not be visible to other gems (like mongrel, HELLO who uses webrick anymore??) which are needed for your rails application. So fail fail fail for your "easy" tutorial which leads you to a lot of configuration problems later on.

  • someone

    no you shouldn't install rails using apt-get, you should install it using the gem utility. Otherwise it may not be visible to other gems (like mongrel, HELLO who uses webrick anymore??) which are needed for your rails application. So fail fail fail for your "easy" tutorial which leads you to a lot of configuration problems later on.

  • http://www.intensedebate.com/people/fak3r fak3r

    I'll take the criticism over running Webrick, but remember, I'm just doing this for development work, in a production case I'd be all about a bunch of mongrels fronted by nginx.

    As for using gem instead of apt-get for install – as a longtime Debian admin, i swear by apt-get and it's ability to keep a system up to date and secure. What does gem provide me in those terms? Does it keep things up to date as apt-get does? Again, I don't use ROR for anything production currently, but I don't know about best practices in that regard, so I appreciate the feedback.

    • Christoph Schlaepfer

      as ALSO fan of debian and the capabilitys of apt-get… i have to say: he’s right >.> other gem’s don’t see it, and it doesn’t see other gems… adittionally: as an example:

      [root @ publish:/usr/src#]>gem install bundler-1.0.5.gem

      ERROR: Error installing bundler-1.0.5.gem: bundler requires RubyGems version >= 1.3.6

      [root @ publish:/usr/src#]>gem env
      - RUBYGEMS VERSION: 1.2.0

      [root @ publish:/usr/src#]>gem update –system
      gem update –system is disabled on Debian. RubyGems can be updated using the official Debian repositories by aptitude or apt-get.

      apt-get upgrade doesn’t fix that either…

  • http://www.intensedebate.com/people/fak3r fak3r

    I'll take the criticism over running Webrick, but remember, I'm just doing this for development work, in a production case I'd be all about a bunch of mongrels fronted by nginx.

    As for using gem instead of apt-get for install – as a longtime Debian admin, i swear by apt-get and it's ability to keep a system up to date and secure. What does gem provide me in those terms? Does it keep things up to date as apt-get does? Again, I don't use ROR for anything production currently, but I don't know about best practices in that regard, so I appreciate the feedback.

  • http://akheron-linux.com akheron

    well done. Ahora es momento de tirar code en rails =D y probar su gestion 8-)

  • http://akheron-linux.com akheron

    well done. Ahora es momento de tirar code en rails =D y probar su gestion 8-)

  • http://akheron-linux.com akheron

    well done. Ahora es momento de tirar code en rails =D y probar su gestion 8-)

  • Mcsilvio

    i am just looking to become a little more familiar with rails, not developing anything serious at the moment. as a noob i can say i really appreciated this concise and working guide. i can start learning rails now. which is about 4 minutes after beginning install.

    thanks!

    • http://fak3r.com fak3r

      You’re very welcome, this is why I write up things like this; to help others use something I’ve already learned so they can go and do more cool stuff (that I and others can learn from in the future) #circle

      • Mcsilvio

        ive done this and im happy with it. but i think this is for an old version of rails? do you know how I can fix this?

        • http://fak3r.com fak3r

          Sure, fix what? Have you tried these steps and gotten an error? Post it and I can take a look, again, there are many ways you *can* install rails, but I only need one ;)

  • Mcsilvio

    i am just looking to become a little more familiar with rails, not developing anything serious at the moment. as a noob i can say i really appreciated this concise and working guide. i can start learning rails now. which is about 4 minutes after beginning install.

    thanks!

    • http://fak3r.com fak3r

      You’re very welcome, this is why I write up things like this; to help others use something I’ve already learned so they can go and do more cool stuff (that I and others can learn from in the future) #circle

      • Mcsilvio

        ive done this and im happy with it. but i think this is for an old version of rails? do you know how I can fix this?

        • http://fak3r.com fak3r

          Sure, fix what? Have you tried these steps and gotten an error? Post it and I can take a look, again, there are many ways you *can* install rails, but I only need one ;)

  • Christoph Schlaepfer

    as ALSO fan of debian and the capabilitys of apt-get… i have to say: he’s right >.> other gem’s don’t see it, and it doesn’t see other gems… adittionally: as an example:

    [root @ publish:/usr/src#]>gem install bundler-1.0.5.gem

    ERROR: Error installing bundler-1.0.5.gem: bundler requires RubyGems version >= 1.3.6

    [root @ publish:/usr/src#]>gem env
    - RUBYGEMS VERSION: 1.2.0

    [root @ publish:/usr/src#]>gem update –system
    gem update –system is disabled on Debian. RubyGems can be updated using the official Debian repositories by aptitude or apt-get.

    apt-get upgrade doesn’t fix that either…

Read previous post:
Equal Rights for All

Here's a great, recent News of the Weird article,"Roy Hollander filed a civil rights lawsuit against Columbia University in New [...]

Close