Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > Ruby > bash says command not found for ri and irb

Reply
Thread Tools

bash says command not found for ri and irb

 
 
cles2@comcast.net
Guest
Posts: n/a
 
      11-10-2005
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

 
Reply With Quote
 
 
 
 
Marcel Molina Jr.
Guest
Posts: n/a
 
      11-10-2005
On Fri, Nov 11, 2005 at 04:27:13AM +0900, http://www.velocityreviews.com/forums/(E-Mail Removed) wrote:
> 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
--
Marcel Molina Jr. <(E-Mail Removed)>


 
Reply With Quote
 
 
 
 
Matthew Desmarais
Guest
Posts: n/a
 
      11-10-2005
(E-Mail Removed) wrote:

>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


 
Reply With Quote
 
Ezra Zygmuntowicz
Guest
Posts: n/a
 
      11-10-2005

On Nov 10, 2005, at 11:27 AM, (E-Mail Removed) wrote:

> 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 Removed)





 
Reply With Quote
 
cles2@comcast.net
Guest
Posts: n/a
 
      11-10-2005
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

 
Reply With Quote
 
Marcel Molina Jr.
Guest
Posts: n/a
 
      11-10-2005
On Fri, Nov 11, 2005 at 07:27:14AM +0900, (E-Mail Removed) wrote:
> 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'


<snip>

> 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
--
Marcel Molina Jr, <(E-Mail Removed)>


 
Reply With Quote
 
cles2@comcast.net
Guest
Posts: n/a
 
      11-10-2005
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

 
Reply With Quote
 
Marcel Molina Jr.
Guest
Posts: n/a
 
      11-10-2005
On Fri, Nov 11, 2005 at 08:07:14AM +0900, (E-Mail Removed) wrote:
> 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
--
Marcel Molina Jr. <(E-Mail Removed)>


 
Reply With Quote
 
cles2@comcast.net
Guest
Posts: n/a
 
      11-10-2005
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

 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Re: Module not found in script that was found in command-lineinterpreter. Possible Path issue? Jacob Davis Python 0 04-15-2008 07:28 PM
Is there an equivalent in irb to command: history in bash? Stephen Bannasch Ruby 10 11-21-2007 07:57 PM
-bash: rails: command not found Matt Ruby 4 10-27-2006 11:16 PM
(patch for Bash) GTK+2 + Bash William Park XML 3 07-14-2005 12:09 AM
-bash: fop: command not found timodheere XML 1 07-25-2004 03:38 PM



Advertisments