Skip to content Skip to sidebar Skip to footer

Ruby Nubie On Osx - Can't Get Beyond Rake Db:migrate - Get [bug] Bus Error

Original problem: I'm (a newbie to ruby) using RVM to manage my ruby on Mac OSX 10.6 Here's my mac OX info: $ rvm info ruby-1.9.2-head@1.9.2-head-gemset: system: uname:

Solution 1:

See answer at top of question.


The problem was I was using an old (2007!) mac architecture - MacBook Core Duo (not to be confused with Core 2 Duo) which is 32 bit, NOT current 64 bit, and the current version of sqlite3 recommended in this tutorial (gem 'sqlite3-ruby', :require => 'sqlite3') did not work with the rest of my Gems. I uninstalled sqlite,

gem uninstall sqlite3 sqlite3-ruby
gem pristine --all// not sure if necessary, suggested in comments

edited my Gemfile to:

gem 'sqlite3-ruby', '1.2.5', :require =>'sqlite3'

then

Bundle install
rake db:migrate

and it works! So far.

I found the suggestion by Josh Crews to use an earlier version of sqlite3 - even though he was using it on Leopard, with ruby 1.8.7.

Solution 2:

OK, let's see if we can get your config straightened out.

You're using RVM, and a current rev of Ruby, so gather even more info about your RVM environment. Type rvm info and add that output to your original question by editing it. That will tell us more about what RVM knows.

Here's some questions:

  1. Did you previously have Leopard installed, with RVM, then switch to Snow Leopard? If so, your Ruby would be compiled for 32-bit, but any native drivers compiled since then would be 64-bit which can cause real weird behavior. Fixing that takes a couple commands and some recompiling but it isn't overly painful.
  2. Did you install Apple's XCode from the Snow Leopard DVD, or as a fresh install directly from Apple's XCode site? The version of XCode on the Snow Leopard was buggy and shouldn't be used. You can download a free copy from Apple's site. It's a big download.
  3. Is your RVM current? Periodically run rvm get update. That might not help this particular problem, but it can fix some oddities. Use rvm -v to check the version. v1.5.2 is current as of today.

Some of the info at sqlite3-ruby can't make on rvm 1.8.7 might help.


EDIT:

A couple things stand out from your rvm info:

  • Your version of Ruby 1.9.2 is p188. p180 is the current stable version if I remember right, at least it is according to what RVM knows: rvm list known shows its list. That might cause problems with drivers that haven't been tested together. You might want to consider installing the current "1.9.2". RVM has a nice upgrade command that will let you install and copy your gems between versions of Ruby, so try rvm upgrade 1.9.2-p188 1.9.2-p180, then try running your app and see if SQLite is still being uncooperative.
  • Your version of Ruby 1.9.2-p188 is compiled as 32-bit. Your rvm info shows "i386-apple-darwin10.0" in several places. A 64-bit Ruby would show: "x86_64-darwin10.6.0". You can easily recompile a Ruby version by telling RVM to uninstall it, then install it again, i.e. rvm uninstall 1.9.2p188 && rvm install 1.9.2p188 should do it. Then you'll need to rebuild your gems that have native drivers: gem pristine --all will rebuild all installed gems.

Post a Comment for "Ruby Nubie On Osx - Can't Get Beyond Rake Db:migrate - Get [bug] Bus Error"