Error reverse engineering MySQL with RMRE

Hi

I am been trying in vain to auto-gen models by reverse-engineering
mysql using RMRE. It complains mysql2 gem missing but as seen in my
Rails environment below, it is there.

Here’s my Rails environment and RMRE error. Experts… please help!
Thanks a ton in advance!!

===
Ruby version 1.9.2 (x86_64-linux)
RubyGems version 1.3.7
Rack version 1.2
Rails version 3.0.3
Active Record version 3.0.1
Action Pack version 3.0.3
Active Resource version 3.0.3
Action Mailer version 3.0.3
Active Support version 3.0.3
Middleware
ActionDispatch::Static
Rack::Lock
ActiveSupport::Cache::Strategy::LocalCache
Rack::Runtime
Rails::Rack::Logger
ActionDispatch::ShowExceptions
ActionDispatch::RemoteIp
Rack::Sendfile
ActionDispatch::Callbacks
ActiveRecord::ConnectionAdapters::ConnectionManagement
ActiveRecord::QueryCache
ActionDispatch::Cookies
ActionDispatch::Session::CookieStore
ActionDispatch::Flash
ActionDispatch::ParamsParser
Rack::MethodOverride
ActionDispatch::Head
ActionDispatch::BestStandardsSupport
Application root /root/test/app
Environment development
Database adapter mysql2
Database schema version 0

======
% rmre -a mysql -d test -u root
/usr/local/rvm/gems/ruby-1.9.2-p0/gems/activerecord-3.0.3/lib/
active_record/connection_adapters/mysql_adapter.rb:22:in rescue in mysql_connection': !!! Missing the mysql2 gem. Add it to your Gemfile: gem 'mysql2' (RuntimeError) from /usr/local/rvm/gems/ruby-1.9.2-p0/gems/activerecord-3.0.3/lib/ active_record/connection_adapters/mysql_adapter.rb:19:inmysql_connection’
from /usr/local/rvm/gems/ruby-1.9.2-p0/gems/activerecord-3.0.3/lib/
active_record/connection_adapters/abstract/connection_pool.rb:228:in
new_connection' from /usr/local/rvm/gems/ruby-1.9.2-p0/gems/activerecord-3.0.3/lib/ active_record/connection_adapters/abstract/connection_pool.rb:236:incheckout_new_connection’
from /usr/local/rvm/gems/ruby-1.9.2-p0/gems/activerecord-3.0.3/lib/
active_record/connection_adapters/abstract/connection_pool.rb:190:in
block (2 levels) in checkout' from /usr/local/rvm/gems/ruby-1.9.2-p0/gems/activerecord-3.0.3/lib/ active_record/connection_adapters/abstract/connection_pool.rb:186:inloop’
from /usr/local/rvm/gems/ruby-1.9.2-p0/gems/activerecord-3.0.3/lib/
active_record/connection_adapters/abstract/connection_pool.rb:186:in
block in checkout' from /usr/local/rvm/rubies/ruby-1.9.2-p0/lib/ruby/1.9.1/monitor.rb: 201:inmon_synchronize’
from /usr/local/rvm/gems/ruby-1.9.2-p0/gems/activerecord-3.0.3/lib/
active_record/connection_adapters/abstract/connection_pool.rb:185:in
checkout' from /usr/local/rvm/gems/ruby-1.9.2-p0/gems/activerecord-3.0.3/lib/ active_record/connection_adapters/abstract/connection_pool.rb:93:inconnection’
from /usr/local/rvm/gems/ruby-1.9.2-p0/gems/activerecord-3.0.3/lib/
active_record/connection_adapters/abstract/connection_pool.rb:316:in
retrieve_connection' from /usr/local/rvm/gems/ruby-1.9.2-p0/gems/activerecord-3.0.3/lib/ active_record/connection_adapters/abstract/connection_specification.rb: 97:inretrieve_connection’
from /usr/local/rvm/gems/ruby-1.9.2-p0/gems/activerecord-3.0.3/lib/
active_record/connection_adapters/abstract/connection_specification.rb:
89:in connection' from /usr/local/rvm/gems/ruby-1.9.2-p0/gems/rmre-0.0.2/lib/rmre/ generator.rb:23:inconnect’
from /usr/local/rvm/gems/ruby-1.9.2-p0/gems/rmre-0.0.2/bin/rmre:57:in
`’

On 15 December 2010 16:19, worldpeace [email protected] wrote:

Ruby version 1.9.2 (x86_64-linux)
RubyGems version 1.3.7
Rack version 1.2
Rails version 3.0.3
Active Record version 3.0.1

I don’t know whether it is of any relevance, but your ActiveRecord
version here is out of date, though the one in the trace below is
3.0.3. The format does not seem to be from gem list or from your
Gemfile.lock. Is there another way of displaying gem versions?

Colin

On Dec 15, 5:19 pm, worldpeace [email protected] wrote:

Ruby version 1.9.2 (x86_64-linux)
Rack::Lock
ActionDispatch::Session::CookieStore

new_connection' active_record/connection_adapters/abstract/connection_pool.rb:186:in active_record/connection_adapters/abstract/connection_pool.rb:316:in
Instead of mysql adapter you should use mysql2:

rmre -a mysql2 -d test -u root

Regards,
Boško Ivanišević