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.
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
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.