Problem with mysql2 gem and Debian

Hi Guys,

I’m having an issue with deploying my application and the mysql2 gem.
I am developing on Windows 7 with Ruby 1.9.2 and Rails 3.0.3.
On my local machine in development environment the application runs
just fine. But when I want to deploy it on our production server I get
an error message from passenger.

“Please install the mysql2 adapter: gem install activerecord-mysql2- adapter (no such file to load – active_record/connection_adapters/
mysql2_adapter)”

The server runs with Debian and also Ruby 1.9.2 and Rails 3.0.3.

I’ve already tried manually installing/uninstalling/reinstalling the
mysql2 gem. Different configurations in database.yml. Executing bundle
install as capistrano task and also directly on the server. Always the
same problem.

Next thing I tried was creating a new rails application on the server
with mysql as database. That works just fine…

Here is my Gemfile:

source ‘http://rubygems.org

gem ‘rails’, ‘3.0.3’

Bundle edge Rails instead:

gem ‘rails’, :git => ‘git://github.com/rails/rails.git’

gem ‘mysql2’

gem ‘nifty-generators’, :group => :development

gem ‘authlogic’
gem ‘rails3-generators’
gem ‘enumerated_attribute’
gem ‘jquery-rails’, ‘>= 0.2.6’
gem ‘acts_as_list’

group :test, :development do
gem ‘sqlite3-ruby’, :require => ‘sqlite3’
gem ‘rspec-rails’, ‘~> 2.4’
gem ‘autotest’
end

Deploy with Capistrano

gem ‘capistrano’

gem “mocha”, :group => :test

And the production part of my database.yml

production:
adapter: mysql2
encoding: utf8
reconnect: false
database: rails_project
pool: 5
username: rails
password:
socket: /var/run/mysqld/mysqld.sock

Was here already?

I dunno. I haven’t specified mysql2 in database.yml last time, that’s
all

all of mysql is bundle into the

sudo gem install mysql you wont need anything else