21

I am installing a new Heroku app for Rails 3.1, Ruby 1.9.2. The problem is in doing 'heroku db:push' to populate the database (which has been duly schematized--the only problem now is getting it some data). It fails with the following report:

/Users/upstill/.rvm/gems/ruby-1.9.2-p290/gems/sqlite3-1.3.5/lib/sqlite3/sqlite3_native.bundle: [BUG] Segmentation fault

ruby 1.8.7 (2010-01-10 patchlevel 249) [universal-darwin11.0]

Abort trap: 6

This is puzzling for two reasons: one, I am using a postgresql database both locally and on heroku (duly declared in config/database.yml). And two, where has ruby 1.8.7 got to do with anything? rvm is set up for 1.9.2, it's on my path, and yet heroku is trying to run it? What gives?

Thanks, Steve Upstill

Community
  • 1
  • 1
Steve Upstill
  • 432
  • 6
  • 15
  • 1
    I get the same error except when using ruby 1.9.3-p125. I've tried rolling back the sqlite3 gem version to 1.3.3 and 1.3.4 with no change. I am also very confused about this ruby 1.8.7 reference in the command line output. I don't even have ruby 1.8.7 installed. –  Feb 26 '12 at 17:12
  • I suspect this is because the Heroku Toolbelt does not anticipate the shell game rvm plays, instead naïvely expecting to always use the version of Ruby with which it was installed. In my case, I could get `heroku db:pull` to work in Ruby 1.9.3 (but not 1.8.7 or 2.0). This may because I installed Heroku Toolbelt while I was on 1.9.3. When I ran `heroku db:pull` under Ruby 2.0, the SEGFAULT error I got read: `/Users/adam/.rvm/gems/ruby-2.0.0-p0/gems/sqlite3-1.3.7/lib/sqlite3/sqlite3_native.bundle: [BUG] Segmentation fault ruby 1.9.3p194 (2012-04-20 revision 35410) [x86_64-darwin10.8.0]` – Adam Florin Jun 18 '13 at 21:57
  • taps and db:push and db:pull will soon be replaced. I've opened up an issue if anyone wants to try it out early https://github.com/heroku/heroku-pg-extras/issues/42 – Will Sep 03 '13 at 22:11

2 Answers2

52

Had this problem as well, it was extremely annoying but eventually I got it to work. I had the toolbelt installed but it started working once I did this:

gem install heroku
sudo gem install taps

Yes, the toolbelt is already installed but I think this really fixed it. Plenty of people are having this problem, you're not alone.

Hope this helps (:

Zach
  • 1,233
  • 13
  • 19
  • 1
    I have no idea why this should have worked, but it did. Thanks. – barelyknown Jun 15 '12 at 22:13
  • You may also need to install the gems 'sequel' and 'sqlite3' if you have further errors after applying the above. – Evolve Aug 16 '12 at 16:42
  • No luck for me — this solution doesn't even make sense if you're using RVM installed on user account. No Ruby 1.8.7 installed. App uses Postgres, not sqlite. This is very strange. – Dylan Sep 19 '12 at 18:43
  • Worked for me! I skipped the sudo as I'm using RVM and it seemed ok. Also Heroku warns its gem is deprecated for the Heroku Toolbelt (which I had installed prior). Haven't tried a reinstall of that yet.. – Hari Honor May 28 '13 at 12:10
1

Your code is trying to run the 1.9.2 version of SQLite using Ruby 1.8.7.

I would suggest switching to 1.9.2 before trying your push.

rvm use 1.9.2-p290
heroku db:push

Ideally you want to be switching to 1.9.2 full stop.

Neil Middleton
  • 22,105
  • 18
  • 80
  • 134