many errors installing mysql on jruby

断了今生、忘了曾经 提交于 2019-12-05 06:26:53

The mysql gem was developed and tested only against MRI (Ruby 1.8). As such it uses old-style C-extensions for most of their implementation. While they are technically supported by JRuby, they are slow and error-prone. So don't use them.

If you use JRuby, you are much better off of using the JDBC adapters which use the java-native database interface and are thus much faster and much better supported. The high-level interface (as e.g. used by Rails) is roughly the same, you shouldn't notice any difference.

So for JRuby you should use the jdbc-mysql gem, or - if you use Rails - the activerecord-jdbcmysql-adapter gem which requires that gem and adds the appropriate database adapter.

ScottJShea

It seems that this comes up from time to time. Here is an SO post with some information (the second and third answers are more along what you are looking for).

On another note this blog suggests using jdbc-mysql.

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!