Ruby on RailsScripting Languages

[Solved] Error installing sqlite3, Failed to build gem native extension

Ruby on Rails often requires various gems and sometimes its a roller coaster ride to install them.
For me, installing sqlite3 gem on Ubuntu was not straightforward as I was receiving error as below:

Error installing sqlite3 ERROR: Failed to build gem native extension

After doing some search, I found the solution which worked for me on Ubuntu operating system.

Step 1:

It was found that the below lib dependency was missing which is required for installing sqlite3 gem. So install libsqlite3-dev package first using Ubuntu apt-get utility.

Install missing dependency:

sudo apt-get install libsqlite3-dev

Step 2:

Post resolving dependency as in step 1, now proceed with installing sqlite3 gem using gem command.

Install Ruby on Rails sqlite3 gem:

sudo gem install sqlite3

That's all ! If this doesn't work for you then please comment your problem with error message and operating system name to help further.

Abhijit Sandhan

Loves Open Source, Blogging, Traveling, Hiking and sharing Knowledge!

Leave a Reply

Your email address will not be published. Required fields are marked *

Back to top button