Passenger Error on Hostmonster: "Could not initialize MySQL client library"

597 Views Asked by At

I am trying to learn more about rails so I tried to follow this tutorial here on Hostmonster about how to set up a rails application: https://my.hostmonster.com/cgi/help/rails

I feel like I'm pretty close but now I'm getting the following error when I visit the public directory of my application:

Ruby (Rack) application could not be started

Error message: Could not initialize MySQL client library

Exception class: RuntimeError

Application root: /home1/stuartd1/public_html/dev/rails/newapp

The database information appears to be correct in database.yml and I tried a few random commands on the off chance one of them might fix it (bundle install, bundle update, rake, etc.). Any ideas?

1

There are 1 best solutions below

0
Dillon Hafer On BEST ANSWER

I had the same issue on Bluehost. I solved it by using my own version of bundler and a change to my .htaccess file.

I had to install an updated bundler gem as my local user:

gem install bundler --user

And then use it in my .htaccess file

SetEnv GEM_HOME /home8/<myusername>/.gem/ruby/1.9.3/gems

After that I restarted passenger (e.g. touch tmp/restart.txt) and it all worked.

I'm using mysql2 gem -v 0.3.18