Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Don't use mysql2 adapter for JRuby

  • Loading branch information...
commit c7825ffa9616450f62c8ce198544d505426e8809 1 parent fb1dd67
Nick Sieger nicksieger authored
Showing with 7 additions and 0 deletions.
  1. +7 −0 templates/default.rb
7 templates/default.rb
View
@@ -4,6 +4,8 @@
jdbc_db = case options[:database]
when /postgresql/
"postgres"
+ when /mysql2/
+ "mysql"
when /mysql|sqlite3/
options[:database]
end
@@ -16,3 +18,8 @@
#{db_gem_line}
end
DB
+
+# Avoid MySQL2 option for Rails 3
+if options[:database] =~ /mysql/
+ gsub_file "config/database.yml", /mysql2/, 'mysql'
+end

1 comment on commit c7825ff

Scott Lowe

Rather than use:

if defined?(JRUBY_VERSION)
... a nice modification to the template would be to use the Gemfile :platforms argument:
platforms :jruby do
gem 'jruby-openssl'
gem 'activerecord-jdbc-adapter', '>= 1.0.0.beta2'
gem 'activerecord-jdbcpostgresql-adapter', '>= 1.0.0.beta2'
end

platforms :ruby do
gem 'pg'
end

Please sign in to comment.
Something went wrong with that request. Please try again.