This forum is no longer active. Please post your questions to our new community site

MissingSourceFile -- sqlite3

Subscribe to MissingSourceFile -- sqlite3 3 post(s), 2 voice(s)

Avatar chaddperry 3 post(s)

Installation appeared to be fine. Ran the test application at http://localhost:3000 – and got the sample application. Clicked the “About Your Application’s Environment” – everything appeared fine.

Created a new project – and when I attempted to access additional pages and I get an error saying that “no such file to load—sqlite3”.

Now when I go to the test application of the new project – the application screen seems fine, but when I attempt to view my application’s environment, I get the same – Missing Source File error description:

RAILS_ROOT: /Applications/rubystack-1.2-beta-0/projects/demo


Avatar Beltrán Rueda Administrator 3,714 post(s)


Right, Rails creates a project to connect with sqlite3 by default. You can see the database connection in the <sample_project>/config/database.yml file. RubyStack do not include sqlite3 gem installed by default but you can install easily. Go to the terminal and type the following commands. It is necessary to include the “with-sqlite3-dir” option because the sqlite3 database is not in the default place:

cd /Applications/rubystack-1.2-beta-0
gem install sqlite3-ruby -- --with-sqlite3-dir=/Applications/rubystack-1.2-beta-0/sqlite/

and you can see something similar to this:

Bulk updating Gem source index for: <a href=""></a>
Building native extensions.  This could take a while...
Successfully installed sqlite3-ruby-1.2.2
1 gem installed
Installing ri documentation for sqlite3-ruby-1.2.2...
Installing RDoc documentation for sqlite3-ruby-1.2.2...

Then, you can check that you are using sqlite3 in the sample application environment. If you want to use MySQL database you only have co use the same database.yml file that the “rubystack” sample project created during the installation. I hope it helps you.

Avatar chaddperry 3 post(s)

Thank you. That did the trick.