HOw to fix bundler issue: You have already activated mysql 2.7, but your Gemfile requires mysql 2.8.1. Consider using bundle exec
After I deployed my rails 2.2.2 application to production I am getting this error: "You have already activated mysql 2.7, but your Gemfile requires mysql 2.8.1. Consider using bundle exec"
Gemfile has the correct information. How do I fix this issue?
Update
I would li开发者_如何转开发ke to use gem 'mysql', '2.8.1'
but somehow didn't work for me. Here is what I have in server gem list:
....
libxml-ruby (1.1.3)
memcache-client (1.6.3)
mysql (2.7)
net-scp (1.0.2)
net-sftp (2.0.2)
net-ssh (2.0.11)
....
Here is how my Gemfile look like:
require 'rubygems'
source 'http://rubygems.org'
source 'http://gemcutter.org'
source 'http://gems.github.com'
gem 'rails', '2.2.2'
gem 'hpricot', '0.6.0'
gem "composite_primary_keys", '2.2.0'
gem 'javan-whenever', '0.3.7'
gem 'mysql', '2.7' ** earlier I was trying with 2.8.1 then used 2.7 and it worked**
gem 'activerecord-oracle_enhanced-adapter', '1.1.9'
gem 'ruby-oci8', '1.0.3'
gem 'crypto', '0.0.3'
gem 'rack', '1.0.0'
gem 'mechanize', '1.0.0'
group :test do
gem 'mocha', '0.9.5'
gem 'rspec', '1.3.1', :require => 'spec'
gem 'rspec-rails', '1.3.3'
end
group :cruise do
gem 'metric_fu', '1.5.1'
end
Try to explicitly set mysql version in Gemfile: gem "mysql", "2.7"
Did you try to uninstall the 2.7
version and then install the 2.8
one? The reason I am asking is I've faced exactly the same error with another gem... Just yesterday in fact. I fixed this simply with these:
gem uninstall mysql -v 2.7
gem install mysql -v 2.8.1
I believe if you run the first command and then running bundle install
, you will get the correct one. Or you may go back and change the version string in your Gemfile
to the one you really want.
精彩评论