Question

I am trying to get a rails 2.3.12 project running in my local development environment, but I cannot seem to install the needed gems. Here are the ruby/rails versions I am using:

$ rvm list
rvm rubies
...
=> ruby-1.8.7-p371 [ i686 ]
...
$ rails -v
Rails 2.3.12

This all seems to be in order. However when I try to install the needed gems, I get the following response:

$ rake _0.9.2_ gems:install --trace
** Invoke gems:install (first_time)
** Invoke gems:base (first_time)
** Execute gems:base
** Invoke environment (first_time)
** Execute environment
rake aborted!
uninitialized constant Encoding
/Users/me/.rvm/gems/ruby-1.8.7-p371@mygemset/gems/activesupport-2.3.12/lib/active_support/dependencies.rb:469:in `load_missing_constant'
/Users/me/.rvm/gems/ruby-1.8.7-p371@mygemset/gems/activesupport-2.3.12/lib/active_support/dependencies.rb:106:in `const_missing'
/Users/me/.rvm/gems/ruby-1.8.7-p371@mygemset/gems/activesupport-2.3.12/lib/active_support/dependencies.rb:118:in `const_missing'
/Users/me/sites/myproject/config/environment.rb:2
/Users/me/.rvm/rubies/ruby-1.8.7-p371/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:29:in `gem_original_require'
/Users/me/.rvm/rubies/ruby-1.8.7-p371/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:29:in `require'
/Users/me/.rvm/gems/ruby-1.8.7-p371@mygemset/gems/activesupport-2.3.12/lib/active_support/dependencies.rb:182:in `require'
/Users/me/.rvm/gems/ruby-1.8.7-p371@mygemset/gems/activesupport-2.3.12/lib/active_support/dependencies.rb:547:in `new_constants_in'
/Users/me/.rvm/gems/ruby-1.8.7-p371@mygemset/gems/activesupport-2.3.12/lib/active_support/dependencies.rb:182:in `require'
/Users/me/.rvm/gems/ruby-1.8.7-p371@mygemset/gems/rails-2.3.12/lib/tasks/misc.rake:4
/Users/me/.rvm/gems/ruby-1.8.7-p371@mygemset/gems/rake-0.9.2/lib/rake/task.rb:205:in `call'
/Users/me/.rvm/gems/ruby-1.8.7-p371@mygemset/gems/rake-0.9.2/lib/rake/task.rb:205:in `execute'
/Users/me/.rvm/gems/ruby-1.8.7-p371@mygemset/gems/rake-0.9.2/lib/rake/task.rb:200:in `each'
/Users/me/.rvm/gems/ruby-1.8.7-p371@mygemset/gems/rake-0.9.2/lib/rake/task.rb:200:in `execute'
/Users/me/.rvm/gems/ruby-1.8.7-p371@mygemset/gems/rake-0.9.2/lib/rake/task.rb:158:in `invoke_with_call_chain'
/Users/me/.rvm/rubies/ruby-1.8.7-p371/lib/ruby/1.8/monitor.rb:242:in `synchronize'
/Users/me/.rvm/gems/ruby-1.8.7-p371@mygemset/gems/rake-0.9.2/lib/rake/task.rb:151:in `invoke_with_call_chain'
/Users/me/.rvm/gems/ruby-1.8.7-p371@mygemset/gems/rake-0.9.2/lib/rake/task.rb:144:in `invoke'
/Users/me/.rvm/gems/ruby-1.8.7-p371@mygemset/gems/rails-2.3.12/lib/tasks/gems.rake:17
/Users/me/.rvm/gems/ruby-1.8.7-p371@mygemset/gems/rake-0.9.2/lib/rake/task.rb:205:in `call'
/Users/me/.rvm/gems/ruby-1.8.7-p371@mygemset/gems/rake-0.9.2/lib/rake/task.rb:205:in `execute'
/Users/me/.rvm/gems/ruby-1.8.7-p371@mygemset/gems/rake-0.9.2/lib/rake/task.rb:200:in `each'
/Users/me/.rvm/gems/ruby-1.8.7-p371@mygemset/gems/rake-0.9.2/lib/rake/task.rb:200:in `execute'
/Users/me/.rvm/gems/ruby-1.8.7-p371@mygemset/gems/rake-0.9.2/lib/rake/task.rb:158:in `invoke_with_call_chain'
/Users/me/.rvm/rubies/ruby-1.8.7-p371/lib/ruby/1.8/monitor.rb:242:in `synchronize'
/Users/me/.rvm/gems/ruby-1.8.7-p371@mygemset/gems/rake-0.9.2/lib/rake/task.rb:151:in `invoke_with_call_chain'
/Users/me/.rvm/gems/ruby-1.8.7-p371@mygemset/gems/rake-0.9.2/lib/rake/task.rb:176:in `invoke_prerequisites'
/Users/me/.rvm/gems/ruby-1.8.7-p371@mygemset/gems/rake-0.9.2/lib/rake/task.rb:174:in `each'
/Users/me/.rvm/gems/ruby-1.8.7-p371@mygemset/gems/rake-0.9.2/lib/rake/task.rb:174:in `invoke_prerequisites'
/Users/me/.rvm/gems/ruby-1.8.7-p371@mygemset/gems/rake-0.9.2/lib/rake/task.rb:157:in `invoke_with_call_chain'
/Users/me/.rvm/rubies/ruby-1.8.7-p371/lib/ruby/1.8/monitor.rb:242:in `synchronize'
/Users/me/.rvm/gems/ruby-1.8.7-p371@mygemset/gems/rake-0.9.2/lib/rake/task.rb:151:in `invoke_with_call_chain'
/Users/me/.rvm/gems/ruby-1.8.7-p371@mygemset/gems/rake-0.9.2/lib/rake/task.rb:144:in `invoke'
/Users/me/.rvm/gems/ruby-1.8.7-p371@mygemset/gems/rake-0.9.2/lib/rake/application.rb:112:in `invoke_task'
/Users/me/.rvm/gems/ruby-1.8.7-p371@mygemset/gems/rake-0.9.2/lib/rake/application.rb:90:in `top_level'
/Users/me/.rvm/gems/ruby-1.8.7-p371@mygemset/gems/rake-0.9.2/lib/rake/application.rb:90:in `each'
/Users/me/.rvm/gems/ruby-1.8.7-p371@mygemset/gems/rake-0.9.2/lib/rake/application.rb:90:in `top_level'
/Users/me/.rvm/gems/ruby-1.8.7-p371@mygemset/gems/rake-0.9.2/lib/rake/application.rb:129:in `standard_exception_handling'
/Users/me/.rvm/gems/ruby-1.8.7-p371@mygemset/gems/rake-0.9.2/lib/rake/application.rb:84:in `top_level'
/Users/me/.rvm/gems/ruby-1.8.7-p371@mygemset/gems/rake-0.9.2/lib/rake/application.rb:62:in `run'
/Users/me/.rvm/gems/ruby-1.8.7-p371@mygemset/gems/rake-0.9.2/lib/rake/application.rb:129:in `standard_exception_handling'
/Users/me/.rvm/gems/ruby-1.8.7-p371@mygemset/gems/rake-0.9.2/lib/rake/application.rb:59:in `run'
/Users/me/.rvm/gems/ruby-1.8.7-p371@mygemset/gems/rake-0.9.2/bin/rake:32
/Users/me/.rvm/gems/ruby-1.8.7-p371@mygemset/bin/rake:19:in `load'
/Users/me/.rvm/gems/ruby-1.8.7-p371@mygemset/bin/rake:19
/Users/me/.rvm/gems/ruby-1.8.7-p371@mygemset/bin/ruby_noexec_wrapper:14
Tasks: TOP => environment

Since config/environment.rb is mentioned in the trace, I will include it here as well:

# Be sure to restart your server when you modify this file
Encoding.default_external = Encoding::UTF_8 

# Specifies gem version of Rails to use when vendor/rails is not present
RAILS_GEM_VERSION = '2.3.12' unless defined? RAILS_GEM_VERSION

# Bootstrap the Rails environment, frameworks, and default configuration
require File.join(File.dirname(__FILE__), 'boot')

Rails::Initializer.run do |config|
  # Settings in config/environments/* take precedence over those specified here.
  # Application configuration should go into files in config/initializers
  # -- all .rb files in that directory are automatically loaded.

  # Add additional load paths for your own custom dirs
  # config.load_paths += %W( #{RAILS_ROOT}/extras )

  # Specify gems that this application depends on and have them installed with rake gems:install
  # config.gem "bj"
  # config.gem "hpricot", :version => '0.6', :source => "http://code.whytheluckystiff.net"
  # config.gem "sqlite3-ruby", :lib => "sqlite3"
  # config.gem "aws-s3", :lib => "aws/s3"

  # Only load the plugins named here, in the order given (default is alphabetical).
  # :all can be used as a placeholder for all plugins not explicitly named
  # config.plugins = [ :exception_notification, :ssl_requirement, :all ]

  # Skip frameworks you're not going to use. To use Rails without a database,
  # you must remove the Active Record framework.
  # config.frameworks -= [ :active_record, :active_resource, :action_mailer ]

  # Activate observers that should always be running
  # config.active_record.observers = :cacher, :garbage_collector, :forum_observer

  # Set Time.zone default to the specified zone and make Active Record auto-convert to this zone.
  # Run "rake -D time" for a list of tasks for finding time zone names.
  config.time_zone = 'UTC'

  # The default locale is :en and all translations from config/locales/*.rb,yml are auto loaded.
  # config.i18n.load_path += Dir[Rails.root.join('my', 'locales', '*.{rb,yml}')]
  # config.i18n.default_locale = :de

  config.after_initialize do
    ExceptionNotification::Notifier.exception_recipients = %w(applicationerror@seattlepub.com)
  end
end

I do not know how to proceed, and my efforts to research the problem have not turned up anything helpful. Any assistance would be greatly appreciated.

EDIT:

I get a similar error if I try to start the server:

$ script/server
=> Booting WEBrick
=> Rails 2.3.12 application starting on http://0.0.0.0:3000
/Users/me/.rvm/gems/ruby-1.8.7-p371@mygemset/gems/activesupport-2.3.12/lib/active_support/dependencies.rb:469:in `load_missing_constant': uninitialized constant Encoding (NameError)
    from /Users/me/.rvm/gems/ruby-1.8.7-p371@mygemset/gems/activesupport-2.3.12/lib/active_support/dependencies.rb:106:in `const_missing'
    from /Users/me/.rvm/gems/ruby-1.8.7-p371@mygemset/gems/activesupport-2.3.12/lib/active_support/dependencies.rb:118:in `const_missing'
    from /Users/me/sites/myproject/config/environment.rb:2
    from /Users/me/.rvm/rubies/ruby-1.8.7-p371/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:29:in `gem_original_require'
    from /Users/me/.rvm/rubies/ruby-1.8.7-p371/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:29:in `require'
    from /Users/me/.rvm/gems/ruby-1.8.7-p371@mygemset/gems/activesupport-2.3.12/lib/active_support/dependencies.rb:182:in `require'
    from /Users/me/.rvm/gems/ruby-1.8.7-p371@mygemset/gems/activesupport-2.3.12/lib/active_support/dependencies.rb:547:in `new_constants_in'
    from /Users/me/.rvm/gems/ruby-1.8.7-p371@mygemset/gems/activesupport-2.3.12/lib/active_support/dependencies.rb:182:in `require'
    from /Users/me/.rvm/gems/ruby-1.8.7-p371@mygemset/gems/rails-2.3.12/lib/commands/server.rb:84
    from /Users/me/.rvm/rubies/ruby-1.8.7-p371/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:29:in `gem_original_require'
    from /Users/me/.rvm/rubies/ruby-1.8.7-p371/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:29:in `require'
    from script/server:3
Was it helpful?

Solution

The problem had to do with the ExceptionNotification plugin (see the end of mt environment.rb file), which was ironically causing this exception. The app works fine after I reinstalled the plugin. –

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top