title: undefined method attr_encrypted in Rails 2.3 app
body: <p>I'm maintaining a Rails 2.3 app (moving to Rails 4 broke too many things), and trying to encrypt/decrypt a password instead of saving it plain-text in the database.</p>
  
  <p>Following the instructions for the attr_encrypted gem, I added </p>
  
  <pre><code>gem "attr_encrypted"
  </code></pre>
  
  <p>to my Gemfile, ran bundle install - all happy.</p>
  
  <p>Then, per instructions, I migrated in a new field, encrypted_password, to the table, and put one line in app/models/serverobj.rb:</p>
  
  <pre><code>attr_encrypted :password, :key =&gt; 'foo'
  </code></pre>
  
  <p>But when I browse there, I get a stack trace like this:</p>
  
  <pre><code>=&gt; Booting WEBrick...
  /home/art/vendor/rails/activerecord/lib/active_record/base.rb:1833:in `method_missing_without_paginate': undefined method `attr_encrypted' for #&lt;Class:0x7f009f372200&gt; (NoMethodError)
      from /home/art/vendor/plugins/will_paginate/lib/will_paginate/finder.rb:164:in `method_missing'
      from /home/art/app/models/serverobj.rb:17
  ...
      from /home/art/config/environment.rb:70
  </code></pre>
  
  <p><code>serverobj.rb</code>, line 17 is:</p>
  
  <pre><code>attr_encrypted :password, :key =&gt; 'foo'
  </code></pre>
  
  <p><code>environment.rb</code>, line 70 is:</p>
  
  <pre><code>Rails::Initializer.run do |config|
    config.load_paths += %W( #{RAILS_ROOT}/vendor/gems/ #{RAILS_ROOT}/app/exceptions/ )
  </code></pre>
  
  <p>Aha! I said, the attr_encrypted gem must not be in the load_paths.
  So I found the attr_encrypted gem in <code>/var/lib/gems/1.8/gems/</code>, and added that to the <code>config.load_paths</code> line in <code>environment.rb</code>.  </p>
  
  <p>But I still get 'Undefined method attr_encrypted'.</p>
  
  <p>I've run out of things to try.  Any ideas?</p>