我正在尝试让 WEBrick 工作
输出rvm gemset list
gemsets for ruby-1.8.7-p374 (found in /home/simon/.rvm/gems/ruby-1.8.7-p374)
(default)
global
=> simple_cms
我的宝石列表 宝石列表
*** LOCAL GEMS ***
abstract (1.0.0)
actionmailer (3.0.0)
actionpack (3.0.0)
activemodel (3.0.0)
activerecord (3.0.0)
activeresource (3.0.0)
activesupport (3.0.0)
arel (1.0.1)
builder (2.1.2)
bundler (1.0.0)
bundler-unload (1.0.2)
erubis (2.6.6)
executable-hooks (1.3.1)
gem-wrappers (1.2.4)
i18n (0.4.2)
mail (2.2.20)
mime-types (1.25.1)
mysql2 (0.3.15)
polyglot (0.3.4)
rack (1.2.8)
rack-mount (0.6.14)
rack-test (0.5.7)
rails (3.0.0)
railties (3.0.0)
rake (10.1.1)
rubygems-bundler (1.4.2)
rvm (1.11.3.9)
thor (0.14.6)
treetop (1.4.15)
tzinfo (0.3.38)
当我运行rails s
WEBrick 启动时,我得到了
/home/simon/.rvm/gems/ruby-1.8.7-p374@global/gems/rubygems-bundler-1.4.2/lib/rubygems-bundler/noexec.rb:74:in `setup': undefined method `rubygems' for Bundler:Module (NoMethodError)
from /home/simon/.rvm/gems/ruby-1.8.7-p374@global/gems/rubygems-bundler-1.4.2/lib/rubygems-bundler/noexec.rb:114:in `check'
from /home/simon/.rvm/gems/ruby-1.8.7-p374@global/gems/rubygems-bundler-1.4.2/lib/rubygems-bundler/noexec.rb:121
from /home/simon/.rvm/rubies/ruby-1.8.7-p374/lib/ruby/site_ruby/1.8/rubygems/core_ext/kernel_require.rb:118:in `gem_original_require'
from /home/simon/.rvm/rubies/ruby-1.8.7-p374/lib/ruby/site_ruby/1.8/rubygems/core_ext/kernel_require.rb:118:in `require'
from /home/simon/.rvm/gems/ruby-1.8.7-p374@global/gems/rubygems-bundler-1.4.2/lib/rubygems_executable_plugin.rb:4
from /home/simon/.rvm/gems/ruby-1.8.7-p374@global/gems/executable-hooks-1.3.1/lib/executable-hooks/hooks.rb:50:in `call'
from /home/simon/.rvm/gems/ruby-1.8.7-p374@global/gems/executable-hooks-1.3.1/lib/executable-hooks/hooks.rb:50:in `run'
from /home/simon/.rvm/gems/ruby-1.8.7-p374@global/gems/executable-hooks-1.3.1/lib/executable-hooks/hooks.rb:49:in `each'
from /home/simon/.rvm/gems/ruby-1.8.7-p374@global/gems/executable-hooks-1.3.1/lib/executable-hooks/hooks.rb:49:in `run'
from /home/simon/.rvm/gems/ruby-1.8.7-p374@simple_cms/bin/ruby_executable_hooks:10
答案1
你不应该使用 Rails 3.0.0
解决方案
删除旧的宝石集
rvm gemset delete <gemset-name>
创建一个新的 gemset 并使用它
rvm gemset create <gemset-name>
rvm gemset use <gemset-name>
您可以安装最新版本的 rails。2014 年 3 月 5 日,版本号为 4.0.3 。
如果你想继续使用版本 3,你需要安装最新版本3.2.17. 通过运行此命令执行此操作
gem install rails -v=3.2.17