title: Missing the mysql2 gem. Add it to your Gemfile: gem 'mysql2'
body: <p>Versions</p>
  
  <ul>
  <li>ruby 1.9.2-p290</li>
  <li>rails 3.0.9</li>
  <li>mysql2-0.2.13 under rvm</li>
  <li>ubuntu 11.04</li>
  </ul>
  
  <p>gem installed with "gem install mysql2 -v '&lt; 0.3' ". All dependencies were met.</p>
  
  <p>rails &amp; 'rails c' are working fine.</p>
  
  <p>I need to run a script outside of rails environment using activerecord 3.0.9. When I run the script this is the output:</p>
  
  <p>======================</p>
  
  <pre><code>/home/ross/work/x/library/models.rb:27:in `eval': !!! Missing the mysql2 gem. Add it to your Gemfile: gem 'mysql2' (RuntimeError)
      from /home/ross/.rvm/gems/ruby-1.9.2-p290/gems/activerecord-3.0.9/lib/active_record/connection_adapters/mysql_adapter.rb:19:in `mysql_connection'
      from /home/ross/.rvm/gems/ruby-1.9.2-p290/gems/activerecord-3.0.9/lib/active_record/connection_adapters/abstract/connection_pool.rb:229:in `new_connection' ....
  </code></pre>
  
  <p>=======================</p>
  
  <p>Clearly the gem is there, because rails works.</p>
  
  <p>Don't know why the gem isn't found when running a script?</p>
  
  <p>Can anyone pls shed some light on the issue?</p>
  
  <p>Regards
  Ross</p>