I have installed:
- JRuby (1.7.0.preview2)
- Rails (3.2.8)
- IBM DB2 Express C (1.01)
- active-record-jdbc-adapter (1.2.2)
How should I change the database.yml file in order to my rails application to connect to DB2 database?
I have followed this article:
https://github.com/jruby/activerecord-jdbc-adapter
but there is no example with DB2 database. Also, why it is said that I should change Jruby to use always JDBC adapter.
If you’re using Rails 3, you’ll need to modify your Gemfile to use the activerecord-jdbc-adapter gem under JRuby. Change your Gemfile to look like the following (using sqlite3 as an example):
if defined?(JRUBY_VERSION)
gem 'activerecord-jdbc-adapter'
gem 'jdbc-sqlite3'
else
gem 'sqlite3-ruby', :require => 'sqlite3'
end
and where should I put the statement above?