I cannot manage to build the rails sqlite3 gem. Whether I install sqlite3-ruby or just sqlite3, it fails the same. As sqlite3 was installed by macports, it's all in /opt/local. I use rvm. I'm on a newly updated OS X Mountain Lion Macbook.
flyer$ which sqlite3
/opt/local/bin/sqlite3
flyer$ ruby -v
ruby 1.8.7 (2012-02-08 patchlevel 358) [i686-darwin11.4.0]
flyer$ rails -v
Rails 2.3.14
flyer$ gem install sqlite3-ruby -- --with-opt-dir
Building native extensions. This could take a while...
ERROR: Error installing sqlite3-ruby:
ERROR: Failed to build gem native extension.
/Users/russ/.rvm/rubies/ruby-1.8.7-p358/bin/ruby extconf.rb --with-opt-dir
/Users/russ/.rvm/rubies/ruby-1.8.7-p358/lib/ruby/1.8/mkmf.rb:1164:in `dir_config': private method `split' called for true:TrueClass (NoMethodError)
from /Users/russ/.rvm/rubies/ruby-1.8.7-p358/lib/ruby/1.8/mkmf.rb:1745:in `init_mkmf'
from /Users/russ/.rvm/rubies/ruby-1.8.7-p358/lib/ruby/1.8/mkmf.rb:1770
from extconf.rb:3:in `require'
from extconf.rb:3
***dir_config: dir is true, target is opt, idefault is , ldefault is
Gem files will remain installed in /Users/russ/.rvm/gems/ruby-1.8.7-p358/gems/sqlite3-1.3.6 for inspection.
Results logged to /Users/russ/.rvm/gems/ruby-1.8.7-p358/gems/sqlite3-1.3.6/ext/sqlite3/gem_make.out
That line that starts with ***dir_config:
is the output of a puts statement I added just before mkmf.rb line 1164. Line 1164 is
defaults = Array === dir ? dir : dir.split(File::PATH_SEPARATOR)
Note that I cannot upgrade ruby or rails as I need to match my hosting provider's versions. I believe this had built before my Mountain Lion upgrade and I did install the latest XCode today.
I know this has to be my problem somehow (and I suspect it's something dumb), but I can't figure out how. Can anybody please help?