Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Heroku db:pull Taps Load Error: no such file to load -- pg

I have gotten the following errors using ruby 1.9.2-p320 with Heroku's Taps-using 'db' commands such as:

heroku db:pull --app my-app

Which produces errors like:

Taps Load Error: no such file to load -- sqlite3

-or-

Taps Load Error: no such file to load -- pg

(And yes, btw, I have all the correct gems, including both postgres--running fine locally--and sqlite3, as well as having uninstalled, re-installed, and updated the taps & heroku gems and including them as well as not including them in my Gemfile. I'm running Rails 3.2.6)

Although there is a known bug that results in a "time zone displacement" error: heroku db:push not working, using taps gem, I have not seen any SO posts that directly address this issue.

like image 365
likethesky Avatar asked Jun 21 '12 17:06

likethesky


3 Answers

Taps is no longer the recommended tool to use when migrating data between postgres instances. Please give heroku-pg-transfer a try instead.

This will only work if you're using one of the production databases or the new Heroku postgres dev or basic plans. If you're still on the older shared database plan I would suggest switching to the new dev plan.

First, find the URL to your db on Heroku:

$ heroku config:get DATABASE_URL
postgres://yada:[email protected]:5432/123

Then transfer from the heroku db to your local db:

$ heroku plugins:install https://github.com/ddollar/heroku-pg-transfer
$ heroku pg:transfer -t postgres://localhost/dbname -f postgres://yada:yada@ec2.../123

Since the heroku-pg-transfer tool utilizes postgres's native pg_dump facility it is a much more predictable and resilient tool.

I've written more about it here: Using heroku pg:transfer to migrate Postres databases

like image 55
Ryan Daigle Avatar answered Oct 14 '22 07:10

Ryan Daigle


My solution was to add the taps gem and the sqlite3 gem (even that I don't sqlite anywhere in the app) into the gemfile (under development).

like image 27
Shahar Nechmad Avatar answered Oct 14 '22 09:10

Shahar Nechmad


The solution I found, using hints from https://github.com/ricardochimal/taps/issues/92 is detailed here: https://github.com/ricardochimal/taps/issues/92#issuecomment-6486535

The short of it, is that ruby 1.9.2-p320 seems to have been the problem, as far as I can tell. Downgrading to ruby 1.9.2-p290 fixed it for me. This might be related to the ruby 1.9.3 issues spoken about at the above link, not sure.

If you are still hanging in there with Taps, please see this comment at GH, as the poster doshea seems to have looked into it even more thoroughly than I or jfeust have.

I'll also reiterate here that if you don't need Taps, then heroku-pgtransfer is your friend. See Ryan's answer to my question here and his excellent blog post on using the newer tool.

like image 2
likethesky Avatar answered Oct 14 '22 08:10

likethesky