version of mysql2 (0.3.2) doesn't ship with the ActiveRecord adapter bundled anymore as it's now part of Rails 3.1

后端 未结 5 1968
余生分开走
余生分开走 2020-12-28 13:36

Hi i am using rails version 3.0.7 when i run rails generate model task name:string i m getting following warning

WARNING: This version of mysql2 (0.3.2) doe         


        
5条回答
  •  陌清茗
    陌清茗 (楼主)
    2020-12-28 14:12

    gem 'mysql2', '< 0.3' is the only way on Rails 3.0.7 (before 3.1)

    UPDATE: sorry, that was not the case also, did't work either, there is a better way:

    vendor/bundle/ruby/1.9.1/gems/mysql2-0.3.2/lib/active_record/connection_adapters$[rails307]$ ls em_mysql2_adapter.rb mysql2_adapter.rb

    take mysql2_adapter.rb file from mysql2 gem version 0.2.x and copy it to the above location

    now it works for me with just gem 'mysql2' in Gemfile

提交回复
热议问题