I was struggling to get this correct. I had mentioned earlier how I was finding it difficult to create my first project in RoR – I was getting an error on the sqlite3 installation. You can read all about it here.
Anyhow, I finally tasted success. I managed to correct the issue after googling a lot, A LOT!
Mentioning it here in case someone else encounters the same issue. I will proceed step by step in explaining how the issue started and what I did to fix it.
Follow the DigitalOcean article on installing RoR on Ubuntu 12.04. Work right until Step 4 of installing Rails.
I now attempted to create a new project called Treebook – as per the instructions in the TeamTreehouse tutorial.
$ rails new treebook
This step failed. I got the following error:
An error occurred while installing sqlite (1.3.6), and Bundler cannot continue. Make sure that `gem install sqlite -v '1.3.6'` succeeds before bundling.
`gem install sqlite3` failed. It could not find the headers for sqlite3. Google tells me that I need to install libsqlite3-dev package for this. However `sudo apt-get install libsqlite3-dev` fails with the following error:
The following packages have unmet dependencies:libsqlite3-dev : Depends: libsqlite3-0 (= 3.7.9-2ubuntu1) but 3.7.9-2ubuntu1.1 is to be installed
This is where I started pulling my hair apart. I googled this out and came across an exact problem faced by someone else before and the solution for that. The solution can be found here.
While the solution suggested by SteveRiley seemed to work for the OP, I got an error in the first step itself – libsqlite3-0:amd64 does not exist!
For some reason apt is not able to pick up the 32 bit and 64 bit packages.😦
Rather than find the cause of this new issue, I decided to instead download these packages manually. I googled this package for Ubuntu and came across this. I then downloaded the packages.
I then uninstalled the existing package with the following command:
$ sudo dpkg --force-depends --purge libsqlite3-0
This removed the existing package in my system.
I then install the package that I had downloaded by going to the folder where the package had been downloaded and running the following command:
$ sudo dpkg --install libsqlite3-dev_3.6.22-1_i386.deb
Done! That did the trick. After this I went back to the folder where I intended to create the RoR project and ran `rails new treebook` once again and this time the creation of the project was a success.
Whew! Now, continuing with learning how to create my first RoR project. Stay tuned😉