I installed Java 7. I did “rvm install jruby-head”. I tried “bundle” to
install my gems, and it barfed on “mysql” and “pg” (at least) because
they
are native extensions, even after I threw caution to the wind and put
“cext.enabled=true” in my .jrubyrc. However, I need to access postgres
and
mysql. Google revealed sometimes there are alternative gems for jruby,
also
suggested plans for supporting native extensions in newer versions of
jruby, but I can’t find details on either.
What is the state of this? Can I install pg and mysql gems somehow, must
I
abandon attempts at jruby, or is there hidden option c? Please don’t ask
me
to significantly rewrite my source tree (e.g., change require
statements),
especially if it leaves it ruby-incompatible.
/Users/me/.rvm/rubies/jruby-head/lib/ruby/shared/mkmf.rb:14: Use
RbConfig
instead of obsolete and deprecated Config.
mkmf.rb can’t find header files for ruby at
/Users/me/.rvm/rubies/jruby-head/lib/native/include/ruby/ruby.h
Sequel::AdapterNotFound: LoadError: no such file to load –
sequel/adapters/jdbcpostgresql
chained_4_rescue_line_25 at
/Users/me/.rvm/gems/jruby-head/gems/sequel-3.36.1/lib/sequel/database/connecting.rb:27
…
Looked in dir:
$ ls
/Users/me/.rvm/gems/jruby-head/gems/sequel-3.36.1/lib/sequel/adapters/jdbc/postgresql.rb
/Users/me/.rvm/gems/jruby-head/gems/sequel-3.36.1/lib/sequel/adapters/jdbc/postgresql.rb
Although technically you are correct (this is about using sequel), it is
a
barrier to using jruby. I would think if the jruby community wants to
support users, it would be good to have a ready answer to what seems a
common question to me.
Since you are using Sequel and not AR you need to install the
jdbc-postgres
gem, I would uninstall activerecord-jdbcpostgresql-adapter first. The
uri
should be of the form jdbc:postgresql:///. More details
here http://sequel.rubyforge.org/rdoc/files/doc/opening_databases_rdoc.html