gem_file添加了msql2 bundle install rails s都能成功,但是railsc会报下面的错误

~/gitlab-ci$ bundle exec rake db:migrate RAILS_ENV=production
rake aborted!
Gem::LoadError: Specified 'mysql2' for database adapter, but the gem is not loaded. Add `gem 'mysql2'` to your Gemfile (and ensure its version is at the minimum required by ActiveRecord).
rm Gemfile.lock重新bundle install, 以及直接bundle install mysql2,或者在gemfile里面添加了 gem 'mysql2','0.4.0' 都ok


改成gem 'mysql2', '~> 0.3.18' ,版本兼容的问题,0.3.0都不行。艹

猜你喜欢

转载自hhg08.iteye.com/blog/2243560
今日推荐