简体   繁体   中英

Installed Ruby, but installing RubyGems does not work

I just installed ruby on Ubuntu by running this command:

sudo apt-get install ruby1.9.1-full

Then I downloaded RubyGems, extracted it, and navigated to that directory. When I typed this command:

ruby setup.rb or sudo ruby setup.rb

I got this error:

The program 'ruby' is currently not installed.  You can install it by typing:
sudo apt-get install ruby

How should I invoke my Ruby installation? Should I reboot? Any ideas what the problem is?

I think your problem is twofold:

  1. Ruby1.9 bundles rubygems by default so there is no need to install manually.
  2. Ruby will proabably be installed as ruby1.9.1-full and you might need to rename manually to ruby . A good solution is to use rvm .

Use:

sudo ruby1.9.1 setup.rb

or

sudo ruby1.9.1-full setup.rb

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM