views:

324

answers:

1

I am trying to load a Ruby on Rails application that uses the Gruff gem. I can load Gruff fine in irb, but whenever I try to load the app (via ruby script/server), it crashes. Here's the full stack trace:

/opt/local/lib/ruby/vendor_ruby/1.8/rubygems/source_index.rb:303:in `search': undefined method `empty?' for :gruff:Symbol (NoMethodError)
    from /opt/local/lib/ruby/vendor_ruby/1.8/rubygems/source_index.rb:274:in `find_name'
    from /opt/local/lib/ruby/vendor_ruby/1.8/rubygems.rb:259:in `activate'
    from /opt/local/lib/ruby/vendor_ruby/1.8/rubygems.rb:67:in `gem'
    from /Users/mdippery/Projects/nees/ceespm/rails-server/config/environment.rb:60
    from /opt/local/lib/ruby/vendor_ruby/1.8/rubygems/custom_require.rb:31:in `gem_original_require'
    from /opt/local/lib/ruby/vendor_ruby/1.8/rubygems/custom_require.rb:31:in `require'
    from /Users/mdippery/Projects/nees/ceespm/rails-server/vendor/rails/activesupport/lib/active_support/dependencies.rb:495:in `require'
    from /Users/mdippery/Projects/nees/ceespm/rails-server/vendor/rails/activesupport/lib/active_support/dependencies.rb:342:in `new_constants_in'
    from /Users/mdippery/Projects/nees/ceespm/rails-server/vendor/rails/activesupport/lib/active_support/dependencies.rb:495:in `require'
    from /opt/local/lib/ruby/gems/1.8/gems/mongrel-1.1.5/bin/../lib/mongrel/rails.rb:147:in `rails'
    from /opt/local/lib/ruby/gems/1.8/gems/mongrel-1.1.5/bin/mongrel_rails:113:in `cloaker_'
    from /opt/local/lib/ruby/gems/1.8/gems/mongrel-1.1.5/lib/mongrel/configurator.rb:149:in `call'
    from /opt/local/lib/ruby/gems/1.8/gems/mongrel-1.1.5/lib/mongrel/configurator.rb:149:in `listener'
    from /opt/local/lib/ruby/gems/1.8/gems/mongrel-1.1.5/bin/mongrel_rails:99:in `cloaker_'
    from /opt/local/lib/ruby/gems/1.8/gems/mongrel-1.1.5/lib/mongrel/configurator.rb:50:in `call'
    from /opt/local/lib/ruby/gems/1.8/gems/mongrel-1.1.5/lib/mongrel/configurator.rb:50:in `initialize'
    from /opt/local/lib/ruby/gems/1.8/gems/mongrel-1.1.5/bin/mongrel_rails:84:in `new'
    from /opt/local/lib/ruby/gems/1.8/gems/mongrel-1.1.5/bin/mongrel_rails:84:in `run'
    from /opt/local/lib/ruby/gems/1.8/gems/mongrel-1.1.5/lib/mongrel/command.rb:212:in `run'
    from /opt/local/lib/ruby/gems/1.8/gems/mongrel-1.1.5/bin/mongrel_rails:281
    from /Users/mdippery/Projects/nees/ceespm/rails-server/vendor/rails/activesupport/lib/active_support/dependencies.rb:488:in `load'
    from /Users/mdippery/Projects/nees/ceespm/rails-server/vendor/rails/activesupport/lib/active_support/dependencies.rb:488:in `load'
    from /Users/mdippery/Projects/nees/ceespm/rails-server/vendor/rails/activesupport/lib/active_support/dependencies.rb:342:in `new_constants_in'
    from /Users/mdippery/Projects/nees/ceespm/rails-server/vendor/rails/activesupport/lib/active_support/dependencies.rb:488:in `load'
    from /Users/mdippery/Projects/nees/ceespm/rails-server/vendor/rails/railties/lib/commands/servers/mongrel.rb:60
    from /opt/local/lib/ruby/vendor_ruby/1.8/rubygems/custom_require.rb:31:in `gem_original_require'
    from /opt/local/lib/ruby/vendor_ruby/1.8/rubygems/custom_require.rb:31:in `require'
    from /Users/mdippery/Projects/nees/ceespm/rails-server/vendor/rails/activesupport/lib/active_support/dependencies.rb:495:in `require'
    from /Users/mdippery/Projects/nees/ceespm/rails-server/vendor/rails/activesupport/lib/active_support/dependencies.rb:342:in `new_constants_in'
    from /Users/mdippery/Projects/nees/ceespm/rails-server/vendor/rails/activesupport/lib/active_support/dependencies.rb:495:in `require'
    from /Users/mdippery/Projects/nees/ceespm/rails-server/vendor/rails/railties/lib/commands/server.rb:39
    from script/server:3:in `require'
    from script/server:3

How can I fix this so the app will run?

A: 

Does the gem need to be installed directly into your rails app dir?

From here:

Rails Plugin

Gruff is easy to use with Rails.

gem install gruff
cd vendor/plugins && gem unpack gruff

If you've only done gem install gruff this might explain it not working in rails but working in irb.

matt
This solved the problem. I also "thawed" Rails and re-froze it at 2.3.5 (it was a stale project that had been frozen at 1.2.5).
mipadi