Ruby on Rails Wednesday, December 15, 2010

On Dec 15, 5:19 pm, worldpeace <worldpeac...@gmail.com> wrote:
> 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:in
> `mysql_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:in
> `checkout_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:in
> `loop'
>         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:in `mon_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:in
> `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: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: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:
> 89:in `connection'
>         from /usr/local/rvm/gems/ruby-1.9.2-p0/gems/rmre-0.0.2/lib/rmre/
> generator.rb:23:in `connect'
>         from /usr/local/rvm/gems/ruby-1.9.2-p0/gems/rmre-0.0.2/bin/rmre:57:in
> `<main>'

Instead of mysql adapter you should use mysql2:

rmre -a mysql2 -d test -u root

Regards,
Boško Ivanišević

--
You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group.
To post to this group, send email to rubyonrails-talk@googlegroups.com.
To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.

No comments:

Post a Comment