bash says command not found for ri and irb

C

cles2

Converting from Windows XP to Linux, I have formatted one of my
computers with Ubuntu 5,10 which has Ruby 1.8.3 installed. I can create
and execute ruby files (.rb) with no problems. However, when i try irb
bash reports that the file cannot be found. Same with ri.

I'm an experienced programmer but getting set up is driving me nuts.
I'm also having problems trying to download RubyGems and Rails, but I
have not really progressed far enough to worry about that yet. Help?

Les
 
M

Marcel Molina Jr.

Converting from Windows XP to Linux, I have formatted one of my
computers with Ubuntu 5,10 which has Ruby 1.8.3 installed. I can create
and execute ruby files (.rb) with no problems. However, when i try irb
bash reports that the file cannot be found. Same with ri.

sudo apt-get install irb ri
I'm an experienced programmer but getting set up is driving me nuts.
I'm also having problems trying to download RubyGems and Rails, but I
have not really progressed far enough to worry about that yet. Help?

When it comes time to get RubyGems and Rails you'll need zlib and yaml.

sudo apt-get install libyaml-ruby1.8 libzlib-ruby1.8

marcel
 
M

Matthew Desmarais

Converting from Windows XP to Linux, I have formatted one of my
computers with Ubuntu 5,10 which has Ruby 1.8.3 installed. I can create
and execute ruby files (.rb) with no problems. However, when i try irb
bash reports that the file cannot be found. Same with ri.

I'm an experienced programmer but getting set up is driving me nuts.
I'm also having problems trying to download RubyGems and Rails, but I
have not really progressed far enough to worry about that yet. Help?

Les
If you fire up synaptic and search for irb and ri you'll find that they
have their own entries. You should be able to install them without too
much difficulty.

Rubygems, on the other hand, might give you some problems.

I managed to get ruby (and all of my favorite gems) set up working on my
Ubuntu 5.10 system recently. If you need any more help you can ask here
or I'll also
be glad to help off-list.

Matthew
 
E

Ezra Zygmuntowicz

Converting from Windows XP to Linux, I have formatted one of my
computers with Ubuntu 5,10 which has Ruby 1.8.3 installed. I can
create
and execute ruby files (.rb) with no problems. However, when i try irb
bash reports that the file cannot be found. Same with ri.

I'm an experienced programmer but getting set up is driving me nuts.
I'm also having problems trying to download RubyGems and Rails, but I
have not really progressed far enough to worry about that yet. Help?

Les


Les-

I find the ruby and rails packages on Ubuntu to be confusing and
hard to get right. So I install from source and end up with a perfect
environment for rails dev. I have a crib sheet on how to install the
whole stack ruby/gems/lighttpd/mysql/fcgi on my blog. Maybe this
helps you a bit?

http://brainspl.at/pages/rails_stack

Good luck-

-Ezra Zygmuntowicz
Yakima Herald-Republic
WebMaster
http://yakimaherald.com
509-577-7732
(e-mail address removed)
 
C

cles2

Speaking of RubyGems, I did as you said using the
sudo apt-get install libyaml-ruby1.8 libzlib-ruby1.8 and everything
seemed to be operating correctly.

The apt-get process stated selecting libruby1.8 instead of
libyaml-ruby1.8 and selecting libruby1.8 instead of libzlib-ruby1.8 but
ended saying 0 upgraded, 0 newly installed, 0 to remove and 0 not
upgraded.

Then I tried the setup as follows:
@ubuntu:~/MyDocuments/Downloads/gem/rubygems-0.8.11$ ruby setup.rb
---> bin
<--- bin
---> lib
---> lib/rubygems
<--- lib/rubygems
<--- lib
---> bin
<--- bin
---> lib
---> lib/rubygems
<--- lib/rubygems
<--- lib
rm -f InstalledFiles
---> bin
mkdir -p /usr/bin/
install gemwhich /usr/bin/
setup.rb:513:in `initialize': Permission denied - /usr/bin/gemwhich
(Errno::EACCES)
from setup.rb:513:in `install'
from setup.rb:1193:in `install_files'
from setup.rb:1192:in `each'
from setup.rb:1192:in `install_files'
from setup.rb:1172:in `install_dir_bin'
from setup.rb:1321:in `traverse'
from setup.rb:1319:in `dive_into'
from setup.rb:1319:in `traverse'
from setup.rb:1313:in `exec_task_traverse'
from setup.rb:1308:in `each'
from setup.rb:1308:in `exec_task_traverse'
from setup.rb:1168:in `exec_install'
from setup.rb:887:in `exec_install'
from setup.rb:705:in `invoke'
from setup.rb:674:in `invoke'
from setup.rb:1352

A couple of times I got permission denied, but I am the sole owner of
my computer.

It looks like RubyGems might be installed, but if so, not in the right
directory or possibly not in the path?

Anyway I still get file not found after I type gem at the command line.

Hope this is not too much for you. Any help would be greatly
appreciated. I am dying to get at the applications programming, but
this is killing me!

Thanks,
Les
 
M

Marcel Molina Jr.

Speaking of RubyGems, I did as you said using the
sudo apt-get install libyaml-ruby1.8 libzlib-ruby1.8 and everything
seemed to be operating correctly.

The apt-get process stated selecting libruby1.8 instead of
libyaml-ruby1.8 and selecting libruby1.8 instead of libzlib-ruby1.8 but
ended saying 0 upgraded, 0 newly installed, 0 to remove and 0 not
upgraded.

Cool, looks like you already had these libraries.
Then I tried the setup as follows:
@ubuntu:~/MyDocuments/Downloads/gem/rubygems-0.8.11$ ruby setup.rb
---> bin
<--- bin
---> lib
---> lib/rubygems
<--- lib/rubygems
<--- lib
---> bin
<--- bin
---> lib
---> lib/rubygems
<--- lib/rubygems
<--- lib
rm -f InstalledFiles
---> bin
mkdir -p /usr/bin/
install gemwhich /usr/bin/
setup.rb:513:in `initialize': Permission denied - /usr/bin/gemwhich
(Errno::EACCES)
from setup.rb:513:in `install'

A couple of times I got permission denied, but I am the sole owner of
my computer.

It looks like RubyGems might be installed, but if so, not in the right
directory or possibly not in the path?

Anyway I still get file not found after I type gem at the command line.

Hope this is not too much for you. Any help would be greatly
appreciated. I am dying to get at the applications programming, but
this is killing me!

You need to run the command as root since it writes files to shared
directories not owned by your user and the ownership of those directories
should stay as they are.

$ sudo ruby setup.rb

A more specific explanation of why is not Ruby specific and could take a bit
of background to explain so I'll leave that to your future exploration of the
Unix environment.

marcel
 
C

cles2

Thanks a bit of yours and a bit of others and I got the RubyGems
installed. Now, however when I do gem install Rails or # gem install
rails --include-dependencies
# rails /complete/path/to/new/railsapp I get :

ERROR: While executing gem ... (Errno::EACCES)
Permission denied - /usr/lib/ruby/gems/1.8/cache/rake-0.6.2.gem

Can you help me on that :)

Les
 
M

Marcel Molina Jr.

Thanks a bit of yours and a bit of others and I got the RubyGems
installed. Now, however when I do gem install Rails or # gem install
rails --include-dependencies
# rails /complete/path/to/new/railsapp I get :

ERROR: While executing gem ... (Errno::EACCES)
Permission denied - /usr/lib/ruby/gems/1.8/cache/rake-0.6.2.gem

Can you help me on that :)

Same issue. Either become root (with 'su -') and run this command or run it
with 'sudo' or 'super'.

$ sudo gem i rails --include-dependencies -r

marcel
 
C

cles2

Thanks every1 you were wonderful. Hope to return the favors after I get
my feet on the ground. See I to learn Unix/Linux!

Thanks,
Les
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,744
Messages
2,569,484
Members
44,903
Latest member
orderPeak8CBDGummies

Latest Threads

Top