Ruby SQLite3 Installation SQLite3_Libversion_Number() MACos Sierra

Ruby Sqlite3 installation sqlite3_libversion_number() macOS Sierra

I finally managed to solve this by specifying the built-in Mac OS X sqlite library directory on macOS Sierra 10.12.5 (16F73):

$ whereis sqlite3
/usr/bin/sqlite3
# if binary is in /usr/bin then library is typically in /usr/lib
$ gem install sqlite3 -- --with-sqlite3-lib=/usr/lib
Building native extensions with: '--with-sqlite3-lib=/usr/lib'
This could take a while...
Successfully installed sqlite3-1.3.13
Parsing documentation for sqlite3-1.3.13
Done installing documentation for sqlite3 after 0 seconds
1 gem installed

I tried specifying the Homebrew library directory but for some reason it didn't work:

$ brew ls --verbose sqlite3
/usr/local/Cellar/sqlite/3.19.3/.brew/sqlite.rb
/usr/local/Cellar/sqlite/3.19.3/bin/sqlite3
/usr/local/Cellar/sqlite/3.19.3/include/msvc.h
/usr/local/Cellar/sqlite/3.19.3/include/sqlite3.h
/usr/local/Cellar/sqlite/3.19.3/include/sqlite3ext.h
/usr/local/Cellar/sqlite/3.19.3/INSTALL_RECEIPT.json
/usr/local/Cellar/sqlite/3.19.3/lib/libsqlite3.0.dylib
/usr/local/Cellar/sqlite/3.19.3/lib/libsqlite3.a
/usr/local/Cellar/sqlite/3.19.3/lib/libsqlite3.dylib
/usr/local/Cellar/sqlite/3.19.3/lib/pkgconfig/sqlite3.pc
/usr/local/Cellar/sqlite/3.19.3/README.txt
/usr/local/Cellar/sqlite/3.19.3/share/man/man1/sqlite3.1
$ gem install sqlite3 -- --with-sqlite3-lib=/usr/local/Cellar/sqlite/3.19.3/lib
This could take a while...
ERROR: Error installing sqlite3:
ERROR: Failed to build gem native extension.
...

If someone knows how to specify the Homebrew library directory, please let me know because that would provide a little more control over installation (supposedly MacPorts works but I no longer use it).


For anyone curious, here's the full command to install Ruby's Sequel:

gem install sequel mysql sqlite3 -- --with-sqlite3-lib=/usr/lib

And how to convert a Laravel Homestead MySQL database listening on host port 3306 to SQLite from my comment on the question:

sequel mysql://homestead:secret@192.168.10.10:3306/my_database -C sqlite://my_database.sqlite

gem install sqlite3' error

Ok, so I ended up throwing the kitchen sink at this one in the end. Here are the steps I took to resolve the issue.

  1. uninstalled RVM link
  2. uninstalled App Store version of xcode as had it previously installed link
  3. ran $ xcode-select --install in terminal to install command line tools
  4. as I already have Homebrew installed I added Homebrews binary path to the front of the $PATH link

    $ echo 'export PATH=/usr/local/bin:$PATH' >> ~/.bash_profile
    $ source ~/.bash_profile
  5. ran $ brew install sqlite3 command
  6. reinstalled RVM

I believe the steps which mitigated the issue the most were 2,3,4 and 5.

Hope this helps!

I can't install the sqlite3 gem on mac osx 10.8.2

Himanshu's link fixed my problem.

https://github.com/luislavena/sqlite3-ruby/issues/20

Installing a specific version of sqlite3

From the commit log for Formula/sqlite3.rb:

commit a9ad65c5f2fdc03aa47e4333fcd0df558136b099
Author: Jack Nagel <jacknagel@gmail.com>
Date: Mon May 20 20:25:17 2013 -0500

sqlite 3.7.17

So the basic idea is to run:

$ COMMIT=a9ad65c5f2fdc03aa47e4333fcd0df558136b099
$ brew install https://raw.githubusercontent.com/Homebrew/homebrew-core/$COMMIT/Formula/sqlite3.rb

For further details, see this gist:
https://gist.github.com/demosten/bdbc4f07c2ddbea0b8f0ad50a98ae5ff



Related Topics



Leave a reply



Submit