Running Rails on Debian

Posted by ericp on 2007-11-16 15:42
OS: Debian / Ubuntu | Product: Komodo

I'm getting fatal error messages trying to create a Rails project on Debian? What do I need to do?


Suppose you try to create a Rails project, and get this error message in the Command Output Window:

getopt: unrecognized option `--skip'

Chances are, you installed rails using the Debian apt-get package manager. The package installs a bash script that wraps Ruby's own Rails library, with its own set of command-line options. This set is wholly incompatible with the standard Rails options, so the tools fail.

It's easy to find web pages that discuss the pro's and con's of relying on Ruby's own Gem package manager vs. Debian's package manager. In this case it would be better to use Ruby's. First run 'apt-get remove rails' to remove the package. And then run 'sudo gem install rails -y' to install a friendlier version of Rails.

Unfortunately you aren't done yet. Our testing showed that gem put the various pieces in /var/lib/gems/1.8/, with Ruby 1.8.6 in /usr/bin. This makes sense, as you wouldn't ant to modify the system area with a third-party package manager.

Knowing this, I would install my own Ruby 1.8.6 in /usr/local/..., and then I would expect gem to install everything in /usr/local/bin and /usr/local/lib/ruby/ (this is untested).