0

I have installed rvm ruby 1.9.3 and rails 3.0.5, and am trying right now to enter the "rails server" command line but this is what I get:

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>'

I have been following this tutorial . I'm using ubuntu 12.04 lts and I guess I don't need to tell you that I'm a newbie...

I really don't know what's wrong (railties gem? the rvm?), I've been googling for a solution the whole day.

Thanks in advance

4

1 回答 1

0

First. update your rails to the current stable version 3.2.13 and see if the error is gone (It will be) also update your ruby to 2


else:

See if this works:

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

In config/application.rb substitute

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

With

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

And another question. why are you using rails 3.0.5? 3.2.13 released Mar 18, 2013

于 2013-05-30T13:18:31.173 回答