norman/friendly_id — Issue #171: NoMethodError: undefined method `friendly_id' for #<Class:0x007fbb18b766e8>
Author: krumpt
Created: 2011-10-09 14:35:33+00:00
State: open

I have added the gem to by gemfile, and run bundle install:
```bash
Using rake (0.9.2)
Using multi_json (1.0.3)
Using activesupport (3.1.0)
Using bcrypt-ruby (3.0.1)
Using builder (3.0.0)
Using i18n (0.6.0)
Using activemodel (3.1.0)
Using erubis (2.7.0)
Using rack (1.3.3)
Using rack-cache (1.0.3)
Using rack-mount (0.8.3)
Using rack-test (0.6.1)
Using hike (1.2.1)
Using tilt (1.3.3)
Using sprockets (2.0.0)
Using actionpack (3.1.0)
Using mime-types (1.16)
Using polyglot (0.3.2)
Using treetop (1.4.10)
Using mail (2.3.0)
Using actionmailer (3.1.0)
Using arel (2.2.1)
Using tzinfo (0.3.29)
Using activerecord (3.1.0)
Using activeresource (3.1.0)
Using ansi (1.3.0)
Using awesome_print (0.4.0)
Using babosa (0.3.5)
Using bundler (1.0.18)
Using coffee-script-source (1.1.2)
Using execjs (1.2.9)
Using coffee-script (2.2.0)
Using rack-ssl (1.3.2)
Using rdoc (3.9.4)
Using thor (0.14.6)
Using railties (3.1.0)
Using coffee-rails (3.1.1)
Using orm_adapter (0.0.5)
Using warden (1.0.5)
Using devise (1.4.7)
Using rails (3.1.0)
Using formtastic (2.0.0)
Using friendly_id (3.3.0.1)
Using jquery-rails (1.0.14)
Using sass (3.1.7)
Using sass-rails (3.1.3)
Using sqlite3 (1.3.4)
Using turn (0.8.2)
Using uglifier (1.0.3)
```

Here is my model
```ruby
class Browser < ActiveRecord::Base
extend FriendlyId
friendly_id :browser , :use => :slugged

has_and_belongs_to_many :partition_platforms, :uniq=>true
belongs_to :datacenter

validates :hostname, :presence => true, :uniqueness => true

accepts_nested_attributes_for :partition_platforms
accepts_nested_attributes_for :datacenter

end
```

Here is the stacktrace.
```bash
ruby-1.9.2-p290 :001 > Browser.all
NoMethodError: undefined method `friendly_id' for #
from /Users/jdyer/.rvm/gems/ruby-1.9.2-p290@global/gems/activerecord-3.1.0/lib/active_record/base.rb:1082:in `method_missing'
from /Users/jdyer/dashboard/app/models/browser.rb:3:in `'
from /Users/jdyer/dashboard/app/models/browser.rb:1:in `'
from /Users/jdyer/.rvm/gems/ruby-1.9.2-p290@global/gems/activesupport-3.1.0/lib/active_support/dependencies.rb:456:in `load'
from /Users/jdyer/.rvm/gems/ruby-1.9.2-p290@global/gems/activesupport-3.1.0/lib/active_support/dependencies.rb:456:in `block in load_file'
from /Users/jdyer/.rvm/gems/ruby-1.9.2-p290@global/gems/activesupport-3.1.0/lib/active_support/dependencies.rb:640:in `new_constants_in'
from /Users/jdyer/.rvm/gems/ruby-1.9.2-p290@global/gems/activesupport-3.1.0/lib/active_support/dependencies.rb:455:in `load_file'
from /Users/jdyer/.rvm/gems/ruby-1.9.2-p290@global/gems/activesupport-3.1.0/lib/active_support/dependencies.rb:342:in `require_or_load'
from /Users/jdyer/.rvm/gems/ruby-1.9.2-p290@global/gems/activesupport-3.1.0/lib/active_support/dependencies.rb:489:in `load_missing_constant'
from /Users/jdyer/.rvm/gems/ruby-1.9.2-p290@global/gems/activesupport-3.1.0/lib/active_support/dependencies.rb:181:in `block in const_missing'
from /Users/jdyer/.rvm/gems/ruby-1.9.2-p290@global/gems/activesupport-3.1.0/lib/active_support/dependencies.rb:179:in `each'
from /Users/jdyer/.rvm/gems/ruby-1.9.2-p290@global/gems/activesupport-3.1.0/lib/active_support/dependencies.rb:179:in `const_missing'
from (irb):1
from /Users/jdyer/.rvm/gems/ruby-1.9.2-p290@global/gems/railties-3.1.0/lib/rails/commands/console.rb:45:in `start'
from /Users/jdyer/.rvm/gems/ruby-1.9.2-p290@global/gems/railties-3.1.0/lib/rails/commands/console.rb:8:in `start'
from /Users/jdyer/.rvm/gems/ruby-1.9.2-p290@global/gems/railties-3.1.0/lib/rails/commands.rb:40:in `'
from script/rails:6:in `require'
from script/rails:6:in `

'ruby-1.9.2-p290 :002 > Browser.uses_friendly_id?
NoMethodError: undefined method `friendly_id' for #
from /Users/jdyer/.rvm/gems/ruby-1.9.2-p290@global/gems/activerecord-3.1.0/lib/active_record/base.rb:1082:in `method_missing'
from /Users/jdyer/dashboard/app/models/browser.rb:3:in `'
from /Users/jdyer/dashboard/app/models/browser.rb:1:in `'
from /Users/jdyer/.rvm/gems/ruby-1.9.2-p290@global/gems/activesupport-3.1.0/lib/active_support/dependencies.rb:456:in `load'
from /Users/jdyer/.rvm/gems/ruby-1.9.2-p290@global/gems/activesupport-3.1.0/lib/active_support/dependencies.rb:456:in `block in load_file'
from /Users/jdyer/.rvm/gems/ruby-1.9.2-p290@global/gems/activesupport-3.1.0/lib/active_support/dependencies.rb:640:in `new_constants_in'
from /Users/jdyer/.rvm/gems/ruby-1.9.2-p290@global/gems/activesupport-3.1.0/lib/active_support/dependencies.rb:455:in `load_file'
from /Users/jdyer/.rvm/gems/ruby-1.9.2-p290@global/gems/activesupport-3.1.0/lib/active_support/dependencies.rb:342:in `require_or_load'
from /Users/jdyer/.rvm/gems/ruby-1.9.2-p290@global/gems/activesupport-3.1.0/lib/active_support/dependencies.rb:489:in `load_missing_constant'
from /Users/jdyer/.rvm/gems/ruby-1.9.2-p290@global/gems/activesupport-3.1.0/lib/active_support/dependencies.rb:181:in `block in const_missing'
from /Users/jdyer/.rvm/gems/ruby-1.9.2-p290@global/gems/activesupport-3.1.0/lib/active_support/dependencies.rb:179:in `each'
from /Users/jdyer/.rvm/gems/ruby-1.9.2-p290@global/gems/activesupport-3.1.0/lib/active_support/dependencies.rb:179:in `const_missing'
from (irb):2
from /Users/jdyer/.rvm/gems/ruby-1.9.2-p290@global/gems/railties-3.1.0/lib/rails/commands/console.rb:45:in `start'
from /Users/jdyer/.rvm/gems/ruby-1.9.2-p290@global/gems/railties-3.1.0/lib/rails/commands/console.rb:8:in `start'
from /Users/jdyer/.rvm/gems/ruby-1.9.2-p290@global/gems/railties-3.1.0/lib/rails/commands.rb:40:in `'
from script/rails:6:in `require'
from script/rails:6:in `

'

```

I have restarted the server multiple times, and reset and reseeded the DB, but still getting this error