1

So I recently updated ubuntu to 11.04 and then downgraded back to 11.04 because I hated unity. Anyway, after I reinstalled 11.40 I had to clone all my old heroku apps and tried to run heroku db:pull to pull the DB and have it imported into my mysql db but I keep getting this error:

Failed to connect to database:
  Sequel::AdapterNotFound -> LoadError: no such file to load -- mysql2

my gem file has gem 'mysql2', '< 0.3' and I gem installed taps already via RVM. I never had this issue when I ran db:pull before so I dont know what the problem is.

Im running ruby 1.9.2 with rails 3.0

rugbert
  • 11,603
  • 9
  • 39
  • 68
  • which version of Rails do you use? – apneadiving Nov 06 '11 at 20:11
  • Have you verified you are using the correct values in your `database.yml` config file (Correct host [probably localhost], and a username/password that actually work to connect to your running instance of mysql)? – Brett Bender Nov 08 '11 at 22:00
  • yeah, everything is right. I just started experiencing the problem after I upgraded to 11.10 and had to clone the app. I just downgraded back to 11.04 but Im still having the error. – rugbert Dec 06 '11 at 18:03

3 Answers3

2

run :

gem install mysql2 than heroku db:pull again ...

if you get this error with the previous "gem install mysql2" :

Building native extensions.  This could take a while...
ERROR:  Error installing mysql2:
  ERROR: Failed to build gem native extension.

probably libmysqlclient-dev package should be installed :

sudo apt-get install mysql-server mysql-server-5.1 libmysqlclient-dev mysql-client-5.1 mysql-common

than

gem install mysql2

... or eventually run

locate mysql_config

then replace the resulting path, with in the following command path :

sudo gem install mysql -- --with-mysql-config=/usr/local/mysql/bin/mysql_config
Luca G. Soave
  • 12,271
  • 12
  • 58
  • 109
0

You may have mysql2 in your Gemfile but have you done a bundle install - i.e. do you have the mysql2 gem installed ?

Thong Kuah
  • 3,263
  • 2
  • 19
  • 29
0

run :

gem install taps then heroku db:pull again

It may be work?

Amol
  • 53
  • 6