Gem install ruby 0> doesn't install Ruby but says it does


#1

Hello,

I’m trying to set up a complete RoR with PostgreSQL and nginx plus
mongrel_cluster on Lenny.

I’ll have all installed, except Ruby …

$ gem install rails
1 gem installed

$ ruby --version
command not found

And I have the rails gem installed …

Any idea why I can’t use Rails ???

thanks!

r.


my list of gems:

rai@debian:/$ gem list

*** LOCAL GEMS ***

actionmailer (2.2.2)
actionpack (2.2.2)
activerecord (2.2.2)
activeresource (2.2.2)
activesupport (2.2.2)
cgi_multipart_eof_fix (2.5.0)
daemons (1.0.10)
fastthread (1.0.1)
gem_plugin (0.2.3)
mongrel (1.1.5)
mongrel_cluster (1.0.5)
pg (0.7.9.2008.10.13)
rails (2.2.2)
rake (0.8.3)
rai@debian:/$

my versions:

rai@debian:/$ irb -v
irb 0.9.5(05/04/13)
rai@debian:/$ gem -v
1.2.0
rai@debian:/$ ruby --version
ruby 1.8.7 (2008-08-11 patchlevel 72) [i486-linux]
rai@debian:/$ rails --version
-bash: rails: command not found
rai@debian:/$

After installing gem, rails, mongrel, … on the remote server, I had
to add two alias to the bash files, I don’t know if I have to do
something similar to Rails:

alias ruby=ruby1.8
alias irb=irb1.8

but I can’t find the correct path of Rails

$ find . -type f -name “*rails” -print
(nothing found)


#2

Now I’ve installed Rails with aptitude:

rai@debian:~$ sudo aptitude install rails

and my system recognize the rails command but for example not the
–version option:

rai@debian:~$ rails --version
getopt: unrecognized option `–version’
Terminating…

on my OS X I can issue rails --version and get the 2.2.2. version output

any ideas ?

thanks,

r.


#3

Apparently rubygems and ruby packages installed via apt-get
occasionally do weird, often slightly broken, things (like the
inability to do rails --version)

Fred


#4

Frederick C. wrote:

Apparently rubygems and ruby packages installed via apt-get
occasionally do weird, often slightly broken, things (like the
inability to do rails --version)

Fred

so, it’s better to install from source code and compile it the gem ruby
instead of with aptitude ?

in my previous Debian Etch I had installed all from source code but got
stucked on nginx and all their dependencies, so I’ve installed Lenny and
all with aptitude …

thanks,

r.


#5

Hello G.s,

It seems to need export path of ruby, rubygems Library.
This is just Example How to export Path:

export GEM_HOME=/usr/local/rubygems/gems
export GEM_PATH=/usr/local/rubygems/gems
export RUBYLIB=/usr/local/rubygems/lib
export PATH=/usr/local/rubygems/gems/bin:/usr/local/rubygems/bin:$PATH

Because I don’t know your server environment. may be its /usr/local/
lib/ruby/ So please confirm and export that should work.
Let me know if i can help you.

Thanks-
Shrii

On Feb 2, 12:09 pm, Raimon Fs removed_email_address@domain.invalid


#6

Shrikant L. wrote:

Hello G.s,

It seems to need export path of ruby, rubygems Library.
This is just Example How to export Path:

export GEM_HOME=/usr/local/rubygems/gems
export GEM_PATH=/usr/local/rubygems/gems
export RUBYLIB=/usr/local/rubygems/lib
export PATH=/usr/local/rubygems/gems/bin:/usr/local/rubygems/bin:$PATH

Because I don’t know your server environment. may be its /usr/local/
lib/ruby/ So please confirm and export that should work.
Let me know if i can help you.

Thanks-
Shrii

On Feb 2, 12:09�pm, Raimon Fs removed_email_address@domain.invalid

my current paths:

debian:~# find / -name ‘ruby’ -print
/usr/bin/ruby
/usr/lib/ruby
/usr/share/doc/ruby
debian:~# find / -name ‘rubygems’ -print
/usr/lib/ruby/1.8/rubygems
debian:~#

ebian:~# find /usr/ -name ‘rails’ -print
/usr/bin/rails
/usr/share/rails
/usr/share/rails/railties/bin/rails
/usr/share/rails/railties/lib/rails
/usr/share/rails/railties/builtin/rails_info/rails
/usr/share/doc/rails
/usr/share/doc/rails/html/files/vendor/rails
/usr/share/doc-base/rails
/usr/share/lintian/overrides/rails

the problem was it wasn’t working and now I see that my find commands
were wrong, I don’t know if it was simply a path problem, so I installed
rails with aptitude and later upgraded it with gem upgrade rails

but, my initial question was about rails and not ruby or rubygems …

thanks !

r,


#7

Yes, There is relation between that.
Please do only:
export GEM_HOME=/usr/local/lib/ruby/gems/1.8

and try again, so that will export another path’s.

Thanks-
Shrii


#8

Or, Refer

http://www.debian-administration.org/articles/329

Thanks-
Shrii

On Feb 2, 2:37 pm, “removed_email_address@domain.invalid”


#9

ok, thanks …

I’m going to re-install again Leny and start again …

:slight_smile:

regards,

r.