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 1955
余生分开走
余生分开走 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:01

    After trying the solution offered by @eveevans I was still having version issues. Then reading the suggestion by @rubyconvict, I thought instead about using the -v option for gem rather than pushing files about.

    Here's what I found eventually resolved my struggle with the dreaded "version of mysql2 (0.3.2)" message on DreamHost:

    # in mysql, create example_app & example_app_test ...
    # ... for the purposes of this example only, production == development db
    rails new example_app --database=mysql --freeze
    cd example_app
    vim config/database.yml
    #   change settings for host, user, password ...
    #   ... database for test (example_app_test) ...
    #   ... & database for production & development (example_app)
    
    vim Gemfile
    #   gem 'mysql2', '< 0.3'
    
    gem uninstall mysql2        # if installed: gem list -d mysql2
    gem install mysql2 -v 0.2.7 
    rake db:migrate     
    

    From there, I can move onto other RoR fun, like perhaps modifying routes (vim config/routes.rb ... however your mileage may vary).

提交回复
热议问题