问题
When running rails on JRUBY, database adapters have two different gems.
- Sql Server:
sqlservergem Vsactiverecord-sqlserver-adaptergem - Mysql:
jdbcmysqlgem vsactiverecord-jdbcmysql-adaptergem - Sqlite3:
jdbcsqlite3gem Vsactiverecord-jdbcsqlite3-adaptergem - Postgresql:
jdbcpostgresqlgem Vsactiverecord-jdbcpostgresql-adaptergem - jdbc:
jdbcgem vsactiverecord-jdbc-adaptergem
So question is,
What is the difference between jdbcpostgresql and its long form activerecord-jdbcpostgresql-adapter gem?
回答1:
jdbcpostgresql = Java postgresql database
activerecord-jdbcpostgresql-adapter = a postgresql database adapter for Rails ActiveRecord to allow it to be used with JRuby.
JDBC (Java Database Connectivity)
ActiveRecord-JDBC-Adapter (AR-JDBC) is a database adapter for Rails' ActiveRecord component that can be used with JRuby. It allows use of virtually any JDBC-compliant database with your JRuby on Rails application.
回答2:
i don't know the difference but i use the following in rails 3+ apps with jruby and postgres for the Gemfile
gem 'activerecord-jdbcpostgresql-adapter'
gem 'jruby-openssl'
see also the README file - https://github.com/jruby/activerecord-jdbc-adapter
来源:https://stackoverflow.com/questions/15973929/what-are-the-railss-activerecord-database-gems-on-jruby