我的 ruby 文件中不能要求 rubygems:(尽管我可以要求其他模块 - 例如 rexml/document)
我的01.rb
文件:
require "rubygems"
执行时ruby 01.rb
,我得到:
01.rb:1:in `require': no such file to load -- rubygems (LoadError)
from 01.rb:1
然而,这是我系统上一些命令的输出:
我的 ruby 版本(我认为我有多个,这会导致问题,对吗? - 我应该删除所有命令并从头开始重新安装吗?)
mhewedy@compu10:~$ ruby --version
ruby 1.8.7 (2011-06-30 patchlevel 352) [x86_64-linux]
mhewedy@compu10:~$ which -a ruby
/usr/bin/ruby
mhewedy@compu10:~$ ls -lt /usr/bin/ruby
lrwxrwxrwx 1 root root 22 Sep 11 07:28 /usr/bin/ruby -> /etc/alternatives/ruby
mhewedy@compu10:~$ ls -lt /etc/alternatives/ruby
lrwxrwxrwx 1 root root 16 Sep 27 10:00 /etc/alternatives/ruby -> /usr/bin/ruby1.8
mhewedy@compu10:~$ ls /usr/bin/ruby*
/usr/bin/ruby /usr/bin/ruby1.8 /usr/bin/ruby1.9.1 /usr/bin/ruby1.9.3
这是我的宝石环境
gem env
RubyGems Environment:
- RUBYGEMS VERSION: 1.8.11
- RUBY VERSION: 1.9.3 (2011-10-30 patchlevel 0) [x86_64-linux]
- INSTALLATION DIRECTORY: /var/lib/gems/1.9.1
- RUBY EXECUTABLE: /usr/bin/ruby1.9.1
- EXECUTABLE DIRECTORY: /usr/local/bin
- RUBYGEMS PLATFORMS:
- ruby
- x86_64-linux
- GEM PATHS:
- /var/lib/gems/1.9.1
- /home/mhewedy/.gem/ruby/1.9.1
- GEM CONFIGURATION:
- :update_sources => true
- :verbose => true
- :benchmark => false
- :backtrace => false
- :bulk_threshold => 1000
- REMOTE SOURCES:
- http://rubygems.org/