A few days ago I decided to download the Fat Free CRM, an open source Rails based CRM platform. In order to get it going with sqlite3 with JRuby on Rails, there were a couple things I needed to do in order to get started. This solution can be used for any general jruby/rails/sqlite3 that you may have; I only mention this particular application to give some context to the problem.
First of all, you’ll need to install a couple gems.
sudo jruby -S gem install jdbc-sqlite3 sudo jruby -S gem install activerecord-jdbcsqlite3-adapter
Next, you’ll need to configure your config/database.yml file to use the appropriate driver for sqlite3.
development: adapter: jdbcsqlite3 database: db/development.sqlite3 timeout: 5000
That should solve any dreaded “no such file to load” errors that you encounter.
Posted by Joel on October 8, 2010 at 4:32 am
Thank you so much! I’ve been stressing out trying to get jRuby, Rails, and Sqlite3 working together for a while. I was just about to abandon it and return to Ruby on Rails, but your post saved me.
+1 to you.
Thanks a ton!
Posted by CoderTrader on February 27, 2011 at 6:31 am
I’m glad you found it helpful. Pay it forward!
Posted by David Francisco on November 26, 2010 at 4:10 pm
Thanks! Worked for me
Posted by David on July 20, 2011 at 1:42 am
where is the config/database.yml file located?
Posted by Vipin on August 3, 2011 at 4:36 am
Thanks a lot .It was very helpful
Posted by John Yeary (@jyeary) on October 27, 2011 at 12:53 pm
Thanks for posting this. It is a simple and sweet example of how to use sqllite in JRuby. I found it very helpful.
Posted by Brent on January 4, 2012 at 10:17 pm
Thanks, this saved me some research time
Posted by Ricardo Galeno on April 1, 2013 at 9:05 pm
Thank you so much!! Helped me a lot!