Please install mysql adapter 'gem install activerecord-mysql-adapter'

前端 未结 16 1472
挽巷
挽巷 2020-12-28 12:23

I\'m having trouble finding a solution to this problem. I\'m getting the error:

Please install the mysql adapter: \'gem install activerecord-mysql-adapter\'
         


        
16条回答
  •  一向
    一向 (楼主)
    2020-12-28 13:13

    It is possible that you have changed adapter to mysql2 for a certain environment only but are not passing the environment to the rake command.

    E.g. I only changed mysql to mysql2 on the production environment but was running

    rake generate_secret_token
    

    when I changed it to the following it worked:

    rake generate_secret_token RAILS_ENV=production
    

提交回复
热议问题