can't activate mysql2 (~> 0.3.6), already activated mysql2-0.3.2 in Rails 3.1

前端 未结 1 2081
清酒与你
清酒与你 2021-02-15 06:34

I\'m just trying to get the most basic of basic shell of a rails app running under 3.1, and I\'m getting this weird error when I run bundle exec rake db:migrate-



        
1条回答
  •  生来不讨喜
    2021-02-15 06:41

    Active Record has it's own requirements on which versions of mysql2 are compatible. Here's the line of code for Rails 3.1. You must use a version of mysql2 that satisfies these requirements.

    Please install the mysql2 adapter: gem install activerecord-mysql2-adapter (can't activate mysql2 (~> 0.3.6), already activated mysql2-0.3.2. Make sure all dependencies are added to Gemfile.)

    This is saying Rails expects a mysql2 version greater than 0.3.6 and less than 0.4.0, but found version 0.3.2. If you change your Gemfile to request a version in this range then Active Record should be happy. Perhaps

    gem 'mysql2', '0.3.6'
    

    Don't forget to update your bundle after changing your Gemfile.

    bundle update mysql2
    

    0 讨论(0)
提交回复
热议问题