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

4

6

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.

Progeny answered 21/6, 2012 at 17:31 Comment(0)
P
2

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.

Progeny answered 21/6, 2012 at 17:31 Comment(3)
FYI, The taps gem does not work for me with ruby 1.9.2-p290. I get the error Taps Load Error: no such file to load -- taps/operation.Names
Taps began working for me by using the same Ruby versions on both Heroku and locally. See my GH comment: I would suggest you try: $heroku run 'ruby -v' and see what version Heroku is running and then update your local one to match. No guarantees, but that seems to be what did it for me (again, guessing, perhaps at fault is Ruby's argument marshalling?). Also see jfeust's comment at GH on Heroku toolbelt.Progeny
Do ~/.rvm/bin/ruby-1.9.2-p320 /usr/bin/heroku db:pushBonds
B
15

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

Bancroft answered 21/6, 2012 at 19:16 Comment(5)
Thanks @Ryan Daigle -- I agree that heroku-pg-transfer is better for those who are using the Heroku postgres dev plan (and recommend users do use that!), however my question is asking about using Taps, so I've marked mine as the accepted answer. I mostly posted this Q & A because I struggled trying to figure out what was wrong, so if others are still using Taps, I hope they find this (and your advice) useful. Thanks!Progeny
Thanks SO much for posting this. Taps has been crap to work with, after weeks of pain. Finally used this approach and BAM worked first time! THANKYOU THANKYOUCommercialize
THANK YOU! Have lost many hours trying to get Taps to work with Heroku, and this is the first mention I've seen of pg:transfer. Worked first time!Rheumatism
@emils No, it won't. pg:transfer is only for pg-to-pg transfers. However, you shouldn't be using pg in prod and sqlite locally anyway.Bancroft
I know, but i need a quick solution to keep my app running. Installing pg locally seems like a bit of a hustle.Linsang
P
2

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.

Progeny answered 21/6, 2012 at 17:31 Comment(3)
FYI, The taps gem does not work for me with ruby 1.9.2-p290. I get the error Taps Load Error: no such file to load -- taps/operation.Names
Taps began working for me by using the same Ruby versions on both Heroku and locally. See my GH comment: I would suggest you try: $heroku run 'ruby -v' and see what version Heroku is running and then update your local one to match. No guarantees, but that seems to be what did it for me (again, guessing, perhaps at fault is Ruby's argument marshalling?). Also see jfeust's comment at GH on Heroku toolbelt.Progeny
Do ~/.rvm/bin/ruby-1.9.2-p320 /usr/bin/heroku db:pushBonds
N
2

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).

Nunley answered 18/7, 2012 at 18:48 Comment(1)
This also works if you just run 'gem install sqlite3' and leave it out of your gemfile.Saphena
B
1

As per @likethesky, you can downgrade. Alternatively, just

~/.rvm/bin/ruby-1.9.2-p320 /usr/bin/heroku db:push

Of course, that necessitates have p320 installed with tap and sqllite3 gems installed as well. Easy enough to put in place.

Bonds answered 13/12, 2012 at 5:16 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.