JRuby and SQLite3 LivingTogether

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.

声明:本站所有文章,如无特殊说明或标注,均为本站原创发布。任何个人或组织,在未征得本站同意时,禁止复制、盗用、采集、发布本站内容到任何网站、书籍等各类媒体平台。如若本站内容侵犯了原著者的合法权益,可联系我们进行处理。