login community faq

I try to start up my Rails application (Rails 3.2.3), but I get an error message from Passenger reading:

1
Please install the mysql2 adapter: `gem install activerecord-mysql2-adapter` (mysql2 is not part of the bundle. Add it to Gemfile.)

My Gemfile already includes the line gem 'mysql2', and I've run bundle install over ssh. I've called ./bin/restart as well. This website runs fine in my development environment. What can I do?

I've seen this complaint on a number of other websites, but I haven't found an answer that applies to me because:

  1. I'm using Rails > 3.1
  2. My database.yml file correctly says to use the adapter mysql2

When I run gem list, I see mysql2 (0.3.11). when I call bundle show, however, mysql2 does not appear in the list. (Incidentally, I've also tried uninstalling mysql2 0.3.11 and using 0.2.7 but with no better success.)

asked Jun 28 '12 at 19:23

TwitTheKnife's gravatar image

TwitTheKnife
275

Have you tried manually installing the mysql2 gem using the instructions here? Specifically, by exporting the appropriate environment variables, and then installing the gem as described under the "common gems" section.

(Jun 28 '12 at 20:43) ryans ♦♦ ryans's gravatar image

Yes, I have. But maybe I'm pointing to the wrong mysql_config file; I'm using the one at /usr/bin/mysql_config.

The gem doesn't show up in my bundle, and I get the same error in my browser, after restarting nginx.

(Jul 02 '12 at 09:33) TwitTheKnife TwitTheKnife's gravatar image

The command should provide the right config when 'which mysql_config' is ran as part of it. You may want to submit a support ticket so we can take a direct look.

(Jul 02 '12 at 23:01) johns ♦♦ johns's gravatar image

Submitted... Back-and-forthing now.

(Jul 03 '12 at 11:24) TwitTheKnife TwitTheKnife's gravatar image

The result: after days of support back-and-forth, they told me:

"There is not much we can do to debug the mysql2 gem or therubyracer beyond this point, as we do not provide them or work with them on a regular basis."

That's the end of their support. Has anyone got Rails>3.1 & MySQL to work?

(Jul 12 '12 at 09:24) TwitTheKnife TwitTheKnife's gravatar image

It's working now. Here's my Gemfile:

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
source 'https://rubygems.org'
gem 'rails', '3.2.3'
gem 'mysql2', '> 0.3'
platforms :ruby do
    gem 'execjs', '~> 1.4.0'
    gem 'therubyracer'
    unless RUBY_VERSION.to_f >= 1.9
        gem 'pre-johnson', '~> 2.0'
    end
end
group :assets do
  gem 'sass-rails',   '~> 3.2.3'
  gem 'coffee-rails', '~> 3.2.1'
  gem 'uglifier', '>= 1.0.3'
end
gem 'jquery-rails'
gem 'capistrano'
gem 'will_paginate'

answered Aug 08 '12 at 19:10

TwitTheKnife's gravatar image

TwitTheKnife
275

Your answer
If you have an answer to the above question, then use the form below. Otherwise, use the appropriate 'add new comment' button above to post your feedback.
toggle preview

Follow this question

By Email:

Once you sign in you will be able to subscribe for any updates here

By RSS:

Answers

Answers and Comments

Tags:

×120
×79
×25
×19

Asked: Jun 28 '12 at 19:23

Seen: 2,297 times

Last updated: Aug 08 '12 at 19:10

Plans & prices    Sign up    Why WebFaction?    Contact us    Affiliate program    Support    Legal    Jobs    Blog    Control panel login
Powered by OSQA
© Copyright 2003-2012 Swarma Limited - WebFaction is a service of Swarma Limited