Take the 2-minute tour ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

I am having a problem with my installation of Ruby/Rails on Debian. I've installed Ruby 1.9.1(1.9.2) using the package manager and I've created links to ruby1.9.1 and whatnot to allow me to use the commands without the version numbers.

The problem that I'm running into now is that even after using gem install rails to get Rails 3.0.8, I can't find the rails command that I need to use to set up a new project. I've checked /usr/bin for a rails or a railsx.x.x, but I can't find it.

When I type in rails new ProjectName I get a rails command not found message.

share|improve this question

3 Answers 3

up vote 2 down vote accepted

You can find the default location where Gem executables will be installed with:

ruby1.9.1 -rubygems -e 'puts Gem.default_bindir'

On Debian 6.0, this is /var/lib/gems/1.9.1/bin, so the rails binary is /var/lib/gems/1.9.1/bin/rails. If you use a lot of RubyGems with executables on your system(s), I would add this bin directory to your PATH.

export PATH=/var/lib/gems/1.9.1/bin:$PATH

The location of binaries installed by RubyGems on Debian has been a highly contested topic over the years. The next version of Debian (Wheezy, the current testing version) will install binaries in /usr/local/bin. See this Debian bug report for background:

share|improve this answer

try running

sudo find / -name rails*

that will find any files in the file system starting with rails

share|improve this answer

What error do you actually get when you run the command. Am assuming the command "gem install rails" works ok upto that point. Have you tried to follow the tutorial here: http://guides.rubyonrails.org/getting_started.html

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.