简体   繁体   中英

Rails Server Error from Application.rb file

just started building out a rails project from scratch after months of re-purposing of older code. the new project wont allow me to run rails server from the command line. i'm getting an error reporting the problem is in the application.rb file

    rails_projects/platform/config/application.rb:7: undefined method `groups' for       Rails:Module (NoMethodError)
from /Library/Ruby/Gems/1.8/gems/railties-3.0.9/lib/rails/commands.rb:28:in `require'
from /Library/Ruby/Gems/1.8/gems/railties-3.0.9/lib/rails/commands.rb:28
from /Library/Ruby/Gems/1.8/gems/railties-3.0.9/lib/rails/commands.rb:27:in `tap'
from /Library/Ruby/Gems/1.8/gems/railties-3.0.9/lib/rails/commands.rb:27
from script/rails:6:in `require'
from script/rails:6

application.rb file looks like this:

    require File.expand_path('../boot', __FILE__)
    require 'rails/all'
    if defined?(Bundler)
     Bundler.require(*Rails.groups(:assets => %w(development test)))
 end
    module Platform
   class Application < Rails::Application
 config.encoding = "utf-8"
config.filter_parameters += [:password]
config.assets.enabled = true
config.assets.version = '1.0'
 end
end

The Rails.groups method was something that was added in Rails 3.1. By the look of it, you're still using Rails 3.0.9. Change the version number for Rails in your Gemfile to 3.1.1 and run bundle update rails to fix this problem.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM