Rails: command not found on Debian lenny

I installed ruby gems from their website and installed rails using gem
install rails
I got a successful installed notification.
But when I tried to use rails command, it gave me command not found.

After I installed gems. I had to create a symbolic link otherwise gem
command wouldn’t work.

Anyone know how to get rails to work?

Thanks!!

kitty00 wrote:

I installed ruby gems from their website

?! Not from debian official repos?

After I installed gems. I had to create a symbolic link otherwise gem
command wouldn’t work.

type this on the shell prompt (single line):

echo ‘export PATH=/var/lib/gems/1.8/bin:$PATH’ >> ~/.bashrc ; source
~/.bashrc

ciaps,
a.

On Tue, Oct 6, 2009 at 6:19 PM, kitty00 [email protected] wrote:

I installed ruby gems from their website and installed rails using gem
install rails
I got a successful installed notification.
But when I tried to use rails command, it gave me command not found.

After I installed gems. I had to create a symbolic link otherwise gem
command wouldn’t work.

Anyone know how to get rails to work?
Debian and Ubuntu, at least, don’t include the paths for your gems,
nor create any symlink.
I think you don’t have many choices here, either you modify your path
or create symlinks for each installed gem that has executable files.


Leonardo M…
There’s no place like ~

2009/10/6 kitty00 [email protected]:

I use this script for rails (and mysql) install on 9.04, derived from
http://www.hackido.com/2009/04/install-ruby-rails-on-ubuntu-904-jaunty.html.
It assumes there is a folder called /home/colinl/downloads, edit this
to wherever you want. It gets several versions of Rails, which you
may not require.

install bits for building stuff

sudo apt-get install build-essential

mysql and ruby

sudo apt-get install ruby ri rdoc mysql-server libmysql-ruby
ruby1.8-dev irb1.8 libdbd-mysql-perl libdbi-perl libmysql-ruby1.8
libmysqlclient15off libnet-daemon-perl libplrpc-perl
libreadline-ruby1.8 libruby1.8 mysql-client-5.0 mysql-common
mysql-server-5.0 rdoc1.8 ri1.8 ruby1.8 irb libopenssl-ruby
libopenssl-ruby1.8 libhtml-template-perl mysql-server-core-5.0

wget -N -P /home/colinl/downloads
http://rubyforge.org/frs/download.php/60718/rubygems-1.3.5.tgz

tar xvzf /home/colinl/downloads/rubygems-1.3.5.tgz
cd rubygems-1.3.5
sudo ruby setup.rb
cd …
rm -rf rubygems-1.3.5
echo “making symlinks - not sure if this will always be necessary,
must be done if gem -v does not work”
sudo ln -s /usr/bin/gem1.8 /usr/local/bin/gem
sudo ln -s /usr/bin/ruby1.8 /usr/local/bin/ruby
sudo ln -s /usr/bin/rdoc1.8 /usr/local/bin/rdoc
sudo ln -s /usr/bin/ri1.8 /usr/local/bin/ri
sudo ln -s /usr/bin/irb1.8 /usr/local/bin/irb

rails latest version, 2.3.2 and 2.3.3

sudo gem install rails --no-rdoc --no-ri
sudo gem install rails --version 2.3.2 --no-rdoc --no-ri
sudo gem install rails --version 2.3.3 --no-rdoc --no-ri

Colin

It didn’t work.
my gem is under /usr/bin/gem.

On Oct 6, 5:15 pm, Alberto F. [email protected]

How do I create symlink for rails?
I could not find where it is installed by gem.

When I did symlink for gem. I found out that I had /usr/bin/gem1.8
instead of /usr/bin/gem.
But this is not the case for rails.

I found rails folder at /usr/local/lib/site_ruby/1.8/rubygems/gems/
rails-2.3.4

But there is no file with rails-2.3.4 inside of the folder.

On Thu, Oct 8, 2009 at 9:44 PM, kitty00 [email protected] wrote:

But there is no file with rails-2.3.4 inside of the folder.

Gems, usually, are installed under /var/lib/gems/1.8/gems/
1 direcotry per gem, and inside each one of these directories, you’ll
have a bin directory where executable files are placed.
Just to be sure where it is, you can do:
$sudo udpatedb
$sudo locate rails | grep bin

That will give you a more accurate result.


Leonardo M…
There’s no place like ~

Thanks you!
I found rails and did alias and export path.

I ended up installing activesupport too.

Now it is working! Finally!

Thanks a bunch to everyone!