我刚刚升级到Mac OSX Mavericks和Ruby 1.9.3-p392,现在当我尝试在我的某个应用程序中运行rails s
时,我收到以下错误:
=> Booting WEBrick
=> Rails 3.2.13 application starting in development on http://0.0.0.0:3000
=> Call with -d to detach
=> Ctrl-C to shutdown server
Exiting
/Users/titouanvanbelle/.rvm/gems/ruby-1.9.3-p392/gems/actionpack-3.2.13/lib/action_dispatch/middleware/stack.rb:43:in `build': undefined method `new' for ExceptionNotifier:Module (NoMethodError)
from /Users/titouanvanbelle/.rvm/gems/ruby-1.9.3-p392/gems/actionpack-3.2.13/lib/action_dispatch/middleware/stack.rb:113:in `block in build'
from /Users/titouanvanbelle/.rvm/gems/ruby-1.9.3-p392/gems/actionpack-3.2.13/lib/action_dispatch/middleware/stack.rb:113:in `each'
from /Users/titouanvanbelle/.rvm/gems/ruby-1.9.3-p392/gems/actionpack-3.2.13/lib/action_dispatch/middleware/stack.rb:113:in `inject'
from /Users/titouanvanbelle/.rvm/gems/ruby-1.9.3-p392/gems/actionpack-3.2.13/lib/action_dispatch/middleware/stack.rb:113:in `build'
from /Users/titouanvanbelle/.rvm/gems/ruby-1.9.3-p392/gems/railties-3.2.13/lib/rails/engine.rb:470:in `app'
from /Users/titouanvanbelle/.rvm/gems/ruby-1.9.3-p392/gems/railties-3.2.13/lib/rails/application/finisher.rb:31:in `block in <module:Finisher>'
from /Users/titouanvanbelle/.rvm/gems/ruby-1.9.3-p392/gems/railties-3.2.13/lib/rails/initializable.rb:30:in `instance_exec'
from /Users/titouanvanbelle/.rvm/gems/ruby-1.9.3-p392/gems/railties-3.2.13/lib/rails/initializable.rb:30:in `run'
from /Users/titouanvanbelle/.rvm/gems/ruby-1.9.3-p392/gems/railties-3.2.13/lib/rails/initializable.rb:55:in `block in run_initializers'
from /Users/titouanvanbelle/.rvm/gems/ruby-1.9.3-p392/gems/railties-3.2.13/lib/rails/initializable.rb:54:in `each'
from /Users/titouanvanbelle/.rvm/gems/ruby-1.9.3-p392/gems/railties-3.2.13/lib/rails/initializable.rb:54:in `run_initializers'
from /Users/titouanvanbelle/.rvm/gems/ruby-1.9.3-p392/gems/railties-3.2.13/lib/rails/application.rb:136:in `initialize!'
from /Users/titouanvanbelle/.rvm/gems/ruby-1.9.3-p392/gems/railties-3.2.13/lib/rails/railtie/configurable.rb:30:in `method_missing'
from /Users/titouanvanbelle/Documents/workspace/paymy/config/environment.rb:5:in `<top (required)>'
from /Users/titouanvanbelle/.rvm/gems/ruby-1.9.3-p392/gems/activesupport-3.2.13/lib/active_support/dependencies.rb:251:in `require'
from /Users/titouanvanbelle/.rvm/gems/ruby-1.9.3-p392/gems/activesupport-3.2.13/lib/active_support/dependencies.rb:251:in `block in require'
from /Users/titouanvanbelle/.rvm/gems/ruby-1.9.3-p392/gems/activesupport-3.2.13/lib/active_support/dependencies.rb:236:in `load_dependency'
from /Users/titouanvanbelle/.rvm/gems/ruby-1.9.3-p392/gems/activesupport-3.2.13/lib/active_support/dependencies.rb:251:in `require'
from /Users/titouanvanbelle/Documents/workspace/paymy/config.ru:3:in `block in <main>'
from /Users/titouanvanbelle/.rvm/gems/ruby-1.9.3-p392/gems/rack-1.4.5/lib/rack/builder.rb:51:in `instance_eval'
from /Users/titouanvanbelle/.rvm/gems/ruby-1.9.3-p392/gems/rack-1.4.5/lib/rack/builder.rb:51:in `initialize'
from /Users/titouanvanbelle/Documents/workspace/paymy/config.ru:in `new'
from /Users/titouanvanbelle/Documents/workspace/paymy/config.ru:in `<main>'
from /Users/titouanvanbelle/.rvm/gems/ruby-1.9.3-p392/gems/rack-1.4.5/lib/rack/builder.rb:40:in `eval'
from /Users/titouanvanbelle/.rvm/gems/ruby-1.9.3-p392/gems/rack-1.4.5/lib/rack/builder.rb:40:in `parse_file'
from /Users/titouanvanbelle/.rvm/gems/ruby-1.9.3-p392/gems/rack-1.4.5/lib/rack/server.rb:200:in `app'
from /Users/titouanvanbelle/.rvm/gems/ruby-1.9.3-p392/gems/railties-3.2.13/lib/rails/commands/server.rb:46:in `app'
from /Users/titouanvanbelle/.rvm/gems/ruby-1.9.3-p392/gems/rack-1.4.5/lib/rack/server.rb:304:in `wrapped_app'
from /Users/titouanvanbelle/.rvm/gems/ruby-1.9.3-p392/gems/rack-1.4.5/lib/rack/server.rb:254:in `start'
from /Users/titouanvanbelle/.rvm/gems/ruby-1.9.3-p392/gems/railties-3.2.13/lib/rails/commands/server.rb:70:in `start'
from /Users/titouanvanbelle/.rvm/gems/ruby-1.9.3-p392/gems/railties-3.2.13/lib/rails/commands.rb:55:in `block in <top (required)>'
from /Users/titouanvanbelle/.rvm/gems/ruby-1.9.3-p392/gems/railties-3.2.13/lib/rails/commands.rb:50:in `tap'
from /Users/titouanvanbelle/.rvm/gems/ruby-1.9.3-p392/gems/railties-3.2.13/lib/rails/commands.rb:50:in `<top (required)>'
from script/rails:6:in `require'
from script/rails:6:in `<main>'
这是我的Gemfile:
source 'https://rubygems.org'
gem 'rails', '3.2.13'
gem 'bcrypt-ruby', "3.0.1"
# Database support:
gem 'pg'
# Use native JSON extension:
gem 'json'
# Use RABL to build API responses:
gem 'rabl'
# HTML parsing for press page
gem 'nokogiri'
# Authentication & authorization:
gem 'omniauth-facebook'
gem 'consul'
gem 'omniauth-identity'
# Pagination
gem 'will_paginate'
gem 'will_paginate-bootstrap'
gem 'foundation-will_paginate'
# Facebook
gem 'koala'
# Utility
gem 'modularity'
gem 'has_defaults'
gem 'andand'
gem 'gibberish'
gem 'state_machine'
gem 'exception_notification'
gem 'edge_rider'
gem 'rest-client'
gem 'haml-rails'
gem 'bootstrap-sass', '~> 2.1.1.0'
gem 'zurb-foundation', '~> 4.1.6'
gem 'compass-rails'
gem 'jquery-rails'
gem 'inherited_resources'
# GUI
gem 'simple_form'
# background processing
gem 'delayed_job_active_record'
# Payment
gem 'king_dtaus'
group :deploy do
# cron
gem 'whenever', require: false
end
# Gems used for development and testing
# and not required in production.
group :development, :test do
gem 'machinist', '<2'
gem 'machinist_callbacks'
gem 'faker'
gem 'rspec-rails'
gem 'cucumber-rails', require: false
gem 'cucumber_factory'
gem 'database_cleaner'
gem 'timecop'
gem 'capybara', '<2'
gem 'spreewald'
gem 'cucumber_spinner'
gem 'launchy'
gem 'rspec_candy'
gem 'pry'
gem 'debugger'
gem 'quiet_assets'
gem 'letter_opener'
gem 'poltergeist'
gem 'guard-rspec'
gem 'guard-cucumber'
gem 'parallel_tests'
end
group :test do
gem 'shoulda-matchers'
end
# Gems used only for assets and not required
# in production environments by default.
# group :assets do
# gem 'sass-rails'
# gem 'coffee-rails'
# gem 'uglifier'
# end
group :assets do
gem 'sass-rails', '~> 3.1'
gem 'coffee-rails', '~> 3.2.1'
gem 'uglifier', '>= 1.0.3'
gem 'execjs'
gem 'therubyracer'
end
group :development do
gem 'better_errors'
gem 'meta_request'
gem 'binding_of_caller'
gem 'ruby-graphviz', '<= 1.0.8'
end
# Sencha theming with compass:
gem 'compass', group: :development
group :deployment do
gem 'capistrano'
gem 'capistrano_colors'
gem 'rvm-capistrano'
end
group :server do
gem 'god'
gem 'daemons'
end
我使用的版本是:
Ruby:ruby-1.9.3-p392 Rails:Rails 3.2.13
不确定还能告诉你什么,但只是问问。我会尽可能多地添加信息。
答案 0 :(得分:4)
问题在于&#34; exception_notification&#34; gem,你已经更新到版本4.x.
您必须更改:
YOUR_APP::Application.config.middleware.use ExceptionNotifier至
YOUR_APP::Application.config.middleware.use ExceptionNotification::Rack
更多信息:https://github.com/smartinez87/exception_notification#upgrading-to-4x-version