无法使用JRuby安装SQLITE3 [英] Cannot install SQLITE3 with JRuby
问题描述
我是Ruby的新手,并且使用Windows7.这与我通常所用的环境不同,因此在进行一个简单的项目时遇到了问题.
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.
在阅读了几本教程之后,看来JRuby是在Windows上运行的最简单方法.我现在正尝试从头开始创建Web应用程序,但是我对这种Shell样式的工作方法感到困惑.
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.
我下载了sqliste3.def,sqlite3.dll和sqlite3,并将它们放在以下位置: C:jruby-1.6.4> bin 目录.但是,我现在正在尝试安装sqlite,但无济于事.首先,我想知道的是哪个控制台环境可以做到这一点.这是cmd还是IRB控制台?
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?
每当我使用cmd时,默认行是c:\ users \ me>,我不知道这是否影响事情的正常运行.
Whenever I use cmd the default line is c:\users\me> and I don't know if this is affecting how things should work.
每当我尝试安装SQLITE3时,我都假设我需要去:
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
我听说过很多关于Ruby的好东西,我只是试图用联系表单构建一个基本网页,但是我似乎在项目安装中遇到了各种各样的问题,并且只是在启动和运行ruby.是否有任何教程可以说明如何从头开始使用JRuby和Sqlite3启动Web项目?
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?
推荐答案
如警告所示,sqlite3-ruby
需要本机C扩展,并且不适用于JRuby.
As the warning suggests, sqlite3-ruby
requires native C extension, and it does not work well with JRuby.
您应该改用activerecord-jdbcsqlite3-adapter
.
https://rubygems.org/gems/activerecord-jdbcsqlite3-adapter
请参见 https://github.com/jruby/activerecord-jdbc-adapter
这篇关于无法使用JRuby安装SQLITE3的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!