Where can I find the rails executable in Debian?

3

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.

Kyle Sletten

Posted 2011-08-11T07:51:15.767

Reputation: 239

Answers

2

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:

jtimberman

Posted 2011-08-11T07:51:15.767

Reputation: 20 109

2

try running

sudo find / -name rails*

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

Col

Posted 2011-08-11T07:51:15.767

Reputation: 6 995

0

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

roykasa

Posted 2011-08-11T07:51:15.767

Reputation: 299