问题
When running rails on JRUBY, database adapters have two different gems.
- Sql Server:
sqlserver
gem Vsactiverecord-sqlserver-adapter
gem - Mysql:
jdbcmysql
gem vsactiverecord-jdbcmysql-adapter
gem - Sqlite3:
jdbcsqlite3
gem Vsactiverecord-jdbcsqlite3-adapter
gem - Postgresql:
jdbcpostgresql
gem Vsactiverecord-jdbcpostgresql-adapter
gem - jdbc:
jdbc
gem vsactiverecord-jdbc-adapter
gem
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