Error with sqlite3 when running bundle install

check where your sqlite is installed to and run the following command (i assume /opt/local here)

gem install sqlite3 -- --with-sqlite3-dir=/opt/local

then

bundle install

So I found the solution: Simply (manually) uninstall any existing versions of sqlite3 in your computer. What I did was:

  1. Run which -a sqlite3 to find out the directories in which sqlite3 was installed (for me there were 4 versions O.o). Delete all those sqlite3 files (by rm)
  2. Manually delete all the sqlite-related files in /usr/local/lib, usr/local/bin and usr/local/include
  3. After all the deletion, run bundle install again in your app dir, and the required version of sqlite3 will automatically be installed.

    $bundle install Fetching gem metadata from https://rubygems.org/.......... Resolving dependencies... // Using a bunch of gems Installing sqlite3 1.3.10 Installing turbolinks 2.5.3 Installing uglifier 2.7.0 Installing web-console 2.0.0 Your bundle is complete! Use 'bundle show [gemname]' to see where a bundled gem is installed.

I hope this saves some of your time, if you encountered the same problem as I did. Thanks!