Cannot install SQLITE3 with JRuby

血红的双手。 提交于 2019-12-07 00:09:13

问题


I am brand new to Ruby and using Windows 7. It is a different environment to what I am normally used to so I am having problems getting a simple project going.

After reading several tutorials, it appears that JRuby is the simplest way to go on windows which I have done. I am now trying to create a web application from scratch but I am confused about this shell style method of working.

I have downloaded sqliste3.def, sqlite3.dll and sqlite3 which I have put in the: C:jruby-1.6.4>bin directory. However, I am now trying to install sqlite but with no avail. Firstly what I would like to know is which console environment does one use to do this. Is this cmd or the IRB console?

Whenever I use cmd the default line is c:\users\me> and I don't know if this is affecting how things should work.

Whenever I try to install SQLITE3 I am assuming that i need to go :

c:\users\me>gem install sqlite3-ruby

However I am not getting anywhere and receiving the following error:

WARNING:JRuby does not support native extensions or the 'mkmf' library very well

I have heard a lot of good things about Ruby and I am simply trying to build a basic webpage with a contact form but I seem to be running into all sorts of issues with the project installation and simply getting ruby up and running. Are there any tutorials that explain how to start a web project with JRuby and Sqlite3 from scratch?


回答1:


As the warning suggests, sqlite3-ruby requires native C extension, and it does not work well with JRuby.

You should use activerecord-jdbcsqlite3-adapter instead.

https://rubygems.org/gems/activerecord-jdbcsqlite3-adapter

See https://github.com/jruby/activerecord-jdbc-adapter



来源:https://stackoverflow.com/questions/7754100/cannot-install-sqlite3-with-jruby

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