0

我正在尝试运行

rails server

第一次在新的开发环境(OS X)中,我收到以下错误:

=> Booting WEBrick
=> Rails 4.0.0 application starting in development on http://0.0.0.0:3000
=> Run `rails server -h` for more startup options
=> Ctrl-C to shutdown server
Exiting
/Users/me/.rvm/gems/ruby-2.0.0-p247@railstutorial_rails_4_0/gems/railties-4.0.0/lib/rails/railtie/configuration.rb:95:in `method_missing': undefined method `action_mailer' for #<Rails::Application::Configuration:0x007fe4fe066c70> (NoMethodError)
from /Users/me/Me/rails_projects/first_app/config/environments/development.rb:17:in `block in <top (required)>'
from /Users/me/.rvm/gems/ruby-2.0.0-p247@railstutorial_rails_4_0/gems/railties-4.0.0/lib/rails/railtie/configurable.rb:24:in `class_eval'
from /Users/me/.rvm/gems/ruby-2.0.0-p247@railstutorial_rails_4_0/gems/railties-4.0.0/lib/rails/railtie/configurable.rb:24:in `configure'
from /Users/me/Me/rails_projects/first_app/config/environments/development.rb:1:in `<top (required)>'
from /Users/me/.rvm/gems/ruby-2.0.0-p247@railstutorial_rails_4_0/gems/activesupport-4.0.0/lib/active_support/dependencies.rb:228:in `require'
from /Users/me/.rvm/gems/ruby-2.0.0-p247@railstutorial_rails_4_0/gems/activesupport-4.0.0/lib/active_support/dependencies.rb:228:in `block in require'
from /Users/me/.rvm/gems/ruby-2.0.0-p247@railstutorial_rails_4_0/gems/activesupport-4.0.0/lib/active_support/dependencies.rb:213:in `load_dependency'
from /Users/me/.rvm/gems/ruby-2.0.0-p247@railstutorial_rails_4_0/gems/activesupport-4.0.0/lib/active_support/dependencies.rb:228:in `require'
from /Users/me/.rvm/gems/ruby-2.0.0-p247@railstutorial_rails_4_0/gems/railties-4.0.0/lib/rails/engine.rb:591:in `block (2 levels) in <class:Engine>'
from /Users/me/.rvm/gems/ruby-2.0.0-p247@railstutorial_rails_4_0/gems/railties-4.0.0/lib/rails/engine.rb:590:in `each'
from /Users/me/.rvm/gems/ruby-2.0.0-p247@railstutorial_rails_4_0/gems/railties-4.0.0/lib/rails/engine.rb:590:in `block in <class:Engine>'
from /Users/me/.rvm/gems/ruby-2.0.0-p247@railstutorial_rails_4_0/gems/railties-4.0.0/lib/rails/initializable.rb:30:in `instance_exec'
from /Users/me/.rvm/gems/ruby-2.0.0-p247@railstutorial_rails_4_0/gems/railties-4.0.0/lib/rails/initializable.rb:30:in `run'
from /Users/me/.rvm/gems/ruby-2.0.0-p247@railstutorial_rails_4_0/gems/railties-4.0.0/lib/rails/initializable.rb:55:in `block in run_initializers'
from /Users/me/.rvm/rubies/ruby-2.0.0-p247/lib/ruby/2.0.0/tsort.rb:150:in `block in tsort_each'
from /Users/me/.rvm/rubies/ruby-2.0.0-p247/lib/ruby/2.0.0/tsort.rb:183:in `block (2 levels) in each_strongly_connected_component'
from /Users/me/.rvm/rubies/ruby-2.0.0-p247/lib/ruby/2.0.0/tsort.rb:210:in `block (2 levels) in each_strongly_connected_component_from'
from /Users/me/.rvm/rubies/ruby-2.0.0-p247/lib/ruby/2.0.0/tsort.rb:219:in `each_strongly_connected_component_from'
from /Users/me/.rvm/rubies/ruby-2.0.0-p247/lib/ruby/2.0.0/tsort.rb:209:in `block in each_strongly_connected_component_from'
from /Users/me/.rvm/gems/ruby-2.0.0-p247@railstutorial_rails_4_0/gems/railties-4.0.0/lib/rails/initializable.rb:44:in `each'
from /Users/me/.rvm/gems/ruby-2.0.0-p247@railstutorial_rails_4_0/gems/railties-4.0.0/lib/rails/initializable.rb:44:in `tsort_each_child'
from /Users/me/.rvm/rubies/ruby-2.0.0-p247/lib/ruby/2.0.0/tsort.rb:203:in `each_strongly_connected_component_from'
from /Users/me/.rvm/rubies/ruby-2.0.0-p247/lib/ruby/2.0.0/tsort.rb:182:in `block in each_strongly_connected_component'
from /Users/me/.rvm/rubies/ruby-2.0.0-p247/lib/ruby/2.0.0/tsort.rb:180:in `each'
from /Users/me/.rvm/rubies/ruby-2.0.0-p247/lib/ruby/2.0.0/tsort.rb:180:in `each_strongly_connected_component'
from /Users/me/.rvm/rubies/ruby-2.0.0-p247/lib/ruby/2.0.0/tsort.rb:148:in `tsort_each'
from /Users/me/.rvm/gems/ruby-2.0.0-p247@railstutorial_rails_4_0/gems/railties-4.0.0/lib/rails/initializable.rb:54:in `run_initializers'
from /Users/me/.rvm/gems/ruby-2.0.0-p247@railstutorial_rails_4_0/gems/railties-4.0.0/lib/rails/application.rb:215:in `initialize!'
from /Users/me/.rvm/gems/ruby-2.0.0-p247@railstutorial_rails_4_0/gems/railties-4.0.0/lib/rails/railtie/configurable.rb:30:in `method_missing'
from /Users/me/Me/rails_projects/first_app/config/environment.rb:5:in `<top (required)>'
from /Users/me/Me/rails_projects/first_app/config.ru:3:in `require'
from /Users/me/Me/rails_projects/first_app/config.ru:3:in `block in <main>'
from /Users/me/.rvm/gems/ruby-2.0.0-p247@railstutorial_rails_4_0/gems/rack-1.5.2/lib/rack/builder.rb:55:in `instance_eval'
from /Users/me/.rvm/gems/ruby-2.0.0-p247@railstutorial_rails_4_0/gems/rack-1.5.2/lib/rack/builder.rb:55:in `initialize'
from /Users/me/Me/rails_projects/first_app/config.ru:in `new'
from /Users/me/Me/rails_projects/first_app/config.ru:in `<main>'
from /Users/me/.rvm/gems/ruby-2.0.0-p247@railstutorial_rails_4_0/gems/rack-1.5.2/lib/rack/builder.rb:49:in `eval'
from /Users/me/.rvm/gems/ruby-2.0.0-p247@railstutorial_rails_4_0/gems/rack-1.5.2/lib/rack/builder.rb:49:in `new_from_string'
from /Users/me/.rvm/gems/ruby-2.0.0-p247@railstutorial_rails_4_0/gems/rack-1.5.2/lib/rack/builder.rb:40:in `parse_file'
from /Users/me/.rvm/gems/ruby-2.0.0-p247@railstutorial_rails_4_0/gems/rack-1.5.2/lib/rack/server.rb:277:in `build_app_and_options_from_config'
from /Users/me/.rvm/gems/ruby-2.0.0-p247@railstutorial_rails_4_0/gems/rack-1.5.2/lib/rack/server.rb:199:in `app'
from /Users/me/.rvm/gems/ruby-2.0.0-p247@railstutorial_rails_4_0/gems/railties-4.0.0/lib/rails/commands/server.rb:48:in `app'
from /Users/me/.rvm/gems/ruby-2.0.0-p247@railstutorial_rails_4_0/gems/rack-1.5.2/lib/rack/server.rb:314:in `wrapped_app'
from /Users/me/.rvm/gems/ruby-2.0.0-p247@railstutorial_rails_4_0/gems/railties-4.0.0/lib/rails/commands/server.rb:75:in `start'
from /Users/me/.rvm/gems/ruby-2.0.0-p247@railstutorial_rails_4_0/gems/railties-4.0.0/lib/rails/commands.rb:78:in `block in <top (required)>'
from /Users/me/.rvm/gems/ruby-2.0.0-p247@railstutorial_rails_4_0/gems/railties-4.0.0/lib/rails/commands.rb:73:in `tap'
from /Users/me/.rvm/gems/ruby-2.0.0-p247@railstutorial_rails_4_0/gems/railties-4.0.0/lib/rails/commands.rb:73:in `<top (required)>'
from bin/rails:4:in `require'
from bin/rails:4:in `<main>'

任何帮助将不胜感激,谢谢!

source 'https://rubygems.org'
ruby '2.0.0'
#ruby-gemset=railstutorial_rails_4_0

group :development do
  gem 'sqlite3', '1.3.7'
end

gem 'sass-rails', '4.0.0'
gem 'uglifier', '2.1.1'
gem 'coffee-rails', '4.0.0'
gem 'jquery-rails', '2.2.1'
gem 'turbolinks', '1.1.1'
gem 'jbuilder', '1.0.2'

group :doc do
  gem 'sdoc', '0.3.20', require: false
end

# Use ActiveModel has_secure_password
# gem 'bcrypt-ruby', '~> 3.0.0'

# Use unicorn as the app server
# gem 'unicorn'

# Use Capistrano for deployment
# gem 'capistrano', group: :development

# Use debugger
# gem 'debugger', group: [:development, :test]
4

1 回答 1

0

在 application.rb 中注释以下行

# require 'active_resource/railtie'

Rails 4 不再需要它。

你仍然可以使用它,使用 gem

于 2013-11-12T19:08:55.483 回答