Rails服务器命令无法运行ubuntu 10.04

时间:2013-05-30 13:11:55

标签: ruby-on-rails ruby ruby-on-rails-3

我已经安装了rvm ruby​​ 1.9.3和rails 3.0.5,我现在正在尝试进入“rails server”命令行,但这就是我得到的:

badr@Badoo:~/rails_projects/first_app$ rails s
/home/badr/rails_projects/first_app/config/application.rb:7:in `<top (required)>': undefined method `groups' for Rails:Module (NoMethodError)
    from /usr/local/rvm/gems/ruby-1.9.3-p429/gems/railties-3.0.5/lib/rails/commands.rb:28:in `require'
    from /usr/local/rvm/gems/ruby-1.9.3-p429/gems/railties-3.0.5/lib/rails/commands.rb:28:in `block in <top (required)>'
    from /usr/local/rvm/gems/ruby-1.9.3-p429/gems/railties-3.0.5/lib/rails/commands.rb:27:in `tap'
    from /usr/local/rvm/gems/ruby-1.9.3-p429/gems/railties-3.0.5/lib/rails/commands.rb:27:in `<top (required)>'
    from script/rails:6:in `require'
    from script/rails:6:in `<main>'

我一直关注this tutorial 。我正在使用ubuntu 12.04 lts,我想我不需要告诉你我是新手......

我真的不知道什么是错的(铁路宝石?rvm?),我一整天都在谷歌搜索解决方案。

提前致谢

1 个答案:

答案 0 :(得分:0)

首先。将你的rails更新到当前的稳定版本3.2.13并查看错误是否消失(它会是)也将你的ruby更新为2


否则:

看看是否有效:

https://stackoverflow.com/a/13275655/1379394

config/application.rb替换

if defined?(Bundler)
Bundler.require(*Rails.groups(:assets => %w(development test)))
end

使用

Bundler.require(:default, Rails.env) if defined?(Bundler)

另一个问题。你为什么使用rails 3.0.5? 3.2.13于2013年3月18日发布