我安装了RVM的CentOS 5.8 x86_64。 在root下我做:
1) rvm install ruby-1.9.2
2) rvm gemset create global
3) rvm gemset use global
4) gem list
*** LOCAL GEMS ***
actionmailer (2.3.14)
actionpack (2.3.14)
activerecord (2.3.14)
activeresource (2.3.14)
activesupport (2.3.14)
bundler (1.3.4)
daemon_controller (1.1.2)
fastthread (1.0.7)
minitest (1.6.0)
passenger (3.0.19)
rack (1.1.6)
rails (2.3.14)
rake (10.0.3, 0.8.7)
rdoc (2.5.8)
rubygems-bundler (1.1.1)
rvm (1.11.3.6)
sqlite3 (1.3.7)
5) ruby script/server
/usr/local/rvm/rubies/ruby-1.9.2-p320/lib/ruby/site_ruby/1.9.1/rubygems/custom_require.rb:60:in `require': no such file to load -- active_support (LoadError)
from /usr/local/rvm/rubies/ruby-1.9.2-p320/lib/ruby/site_ruby/1.9.1/rubygems/custom_require.rb:60:in `rescue in require'
from /usr/local/rvm/rubies/ruby-1.9.2-p320/lib/ruby/site_ruby/1.9.1/rubygems/custom_require.rb:35:in `require'
from /var/www/html/lkdoctor/vendor/rails/railties/lib/commands/server.rb:1:in `<top (required)>'
from /usr/local/rvm/rubies/ruby-1.9.2-p320/lib/ruby/site_ruby/1.9.1/rubygems/custom_require.rb:36:in `require'
from /usr/local/rvm/rubies/ruby-1.9.2-p320/lib/ruby/site_ruby/1.9.1/rubygems/custom_require.rb:36:in `require'
from script/server:2:in `<main>'
6) gem which active_support
/usr/local/rvm/gems/ruby-1.9.2-p320/gems/activesupport-2.3.14/lib/active_support.rb
所以我不明白为什么Webrick没有看到这个宝石!?
事实上,我通过添加以下行改变/config/boot.rb文件来解决这个错误:
require 'active_support'
require 'action_controller'
require 'active_record'
require 'action_mailer'
require 'active_resource'
然而,我明白这是错误的方式。 提前谢谢。