WebFaction
Community site: login faq

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

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 28 Jun '12, 19:23

TwitTheKnife
27410
accept rate: 0%

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.

(28 Jun '12, 20:43) ryans ♦♦

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.

(02 Jul '12, 09:33) TwitTheKnife

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.

(02 Jul '12, 23:01) johns

Submitted... Back-and-forthing now.

(03 Jul '12, 11:24) TwitTheKnife

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?

(12 Jul '12, 09:24) TwitTheKnife

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

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'
permanent link

answered 08 Aug '12, 19:10

TwitTheKnife
27410
accept rate: 0%

Your answer
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

Markdown Basics

  • *italic* or _italic_
  • **bold** or __bold__
  • link:[text](http://url.com/ "title")
  • image?![alt text](/path/img.jpg "title")
  • numbered list: 1. Foo 2. Bar
  • to add a line break simply add two spaces to where you would like the new line to be.
  • basic HTML tags are also supported

Question tags:

×168
×108
×28
×25

question asked: 28 Jun '12, 19:23

question was seen: 9,387 times

last updated: 08 Aug '12, 19:10

WEBFACTION
REACH US
SUPPORT
AFFILIATE PROGRAM
LEGAL
© COPYRIGHT 2003-2019 SWARMA LIMITED - WEBFACTION IS A SERVICE OF SWARMA LIMITED
REGISTERED IN ENGLAND AND WALES 5729350 - VAT REGISTRATION NUMBER 877397162
5TH FLOOR, THE OLD VINYL FACTORY, HAYES, UB3 1HA, UNITED KINGDOM