3

I'd like to launch a jruby/rails app to use Postgres. But I'd like to use H2 in Postgres compatibility mode when running in development and test.

Its no problem bringing up the app in H2, or in postgresql, but how do I configure to run the postgresql adaptor, using an embedded H2 database?

For example: something like this:

database.yml

    development:
    #  adapter: jdbch2
    #  database: db/development/database
      adapter: postgresql
      encoding: unicode
      database: database
    #  driver: org.h2.Driver
      url: jdbc:h2:~/db/development;MODE=PostgreSQL

    test:
    ...

Gemfile:

...
gem 'activerecord-jdbch2-adapter'
#gem 'jdbc-h2'
gem 'activerecord-jdbcpostgresql-adapter'
...
4

0 回答 0