Snow Leopard, SQLite3-Ruby

Snow Leopard, sqlite3-ruby

I finally solved this by recompiling ruby 1.9.1 with the appropriate sqlite3 libraries linked. So in my case I needed to create this link:

sudo ln -s  /Developer/SDKs/MacOSX10.6.sdk/usr/lib/libsqlite3.0.dylib /usr/local/lib/libsqlite3.dylib

How to install ruby interface for sqlite3 in Mac snow leopard?

In order to compile native code on OS X (such as this native Ruby extension) you have to install Apple XCode.

XCode includes various developer tools such as the clang compiler and development header files (ruby.h among others).

Recent version of XCode are available on the App Store. Although by default, XCode no longer installs the developers tools in a way that makes them accessible from the shell, you can fix that by installing "Command Line Tools" from under the Download tab of the XCode IDE preference window.

See this other answer for more details.

Snow Leopard & Ruby on Rails - SQLite3 issue

If you upgraded from Leopard, then you will need to reinstall the sqlite3-ruby gem. First install XCode, then run:

sudo gem install sqlite3-ruby

trying to install sqlite3 gem on OS X snow leopard; seem to be missing some headers

You need to install XCode to get the development tools, including gcc which you need to compile the native C extensions in the sqlite3 gem.

If you are doing any development on Mac OS X you will be endlessly frustrated until you install the developer tools. It is annoying, but much better than trying to get your own tools up an running by downloading binaries or something like that. Down that road lies madness.

Snow Leopard upgrade - reinstalling sqlite3-ruby gem problem

Thanks for the answers. Here is what i did to solve the problem:

  1. Complete reinstall of ruby1.8.7 to /usr/local, see here: http://hivelogic.com/articles/ruby-rails-leopard

    Note: readline wasn't working when recompiling ruby on my mac, so i had to build that too from scratch and make sure to add the --with-readline-dir option to configure:

    ./configure --enable-shared --enable-pthread CFLAGS=-D_XOPEN_SOURCE=1 --prefix=/usr/local --with-readline-dir=/usr/local

  2. Complete reinstall of sqlite3 to /usr/local

  3. Rebuild all gems on the system with sudo gem install XXX, including sqlite3-ruby. This is only necessary with platform specific gems, but i found it to be faster just to install everything in a oneliner:

    sudo gem install gem1 gem2 ... gemN --no-ri --no-rdoc

I tried to go with ruby1.9 but everything stopped working due to broken dependencies in gems and plugins, so I wouldn't recommend switching to 1.9 unless you are up for some heavy debugging and know how to restore your old system!

Finally everything is running again!

Snow Leopard sqlite3-ruby installation issue

uninstall the sqlite3 gem and then try again -- i seem to recall that sqlite3 and sqlite3-ruby aren't compatible. otherwise, append the results file to your question so we can see what went wrong when the compilation happened.

Ruby on Rails in OS X Snow Leopard - what versions do I have installed?

sudo port list installed will show you what ports you have installed

I would look at installing RVM (http://rvm.beginrescueend.com/) as well (as it allows you to keep all the rubies separate). and makes it easy to totally remove a ruby and all its gems/etc..

Did you install ruby from ports or are you using the system ruby?

What does ruby -v or which ruby show ?

Application with SQLite3 db included crashing on Snow Leopard

To resolve the problem reported above I tried to log the result returned from sqlite3_open. I got 14 ie. SQLITE_CANTOPEN. I checked directory permission and found that some permission were not read & write. When I changed all to read & write, it started working properly :)



Related Topics



Leave a reply



Submit