无法使用 JRuby 安装 SQLITE3

发布于 2024-12-09 22:14:32 字数 742 浏览 4 评论 0原文

我对 Ruby 很陌生,并且使用的是 Windows 7。这与我通常习惯的环境不同,因此我在运行一个简单的项目时遇到了问题。

阅读了几个教程后,我发现 JRuby 是在 Windows 上运行的最简单的方法。我现在正在尝试从头开始创建一个 Web 应用程序,但我对这种 shell 风格的工作方法感到困惑。

我已经下载了 sqliste3.def、sqlite3.dll 和 sqlite3,并将其放入: C:jruby-1.6.4>bin 目录。但是,我现在尝试安装 sqlite 但没有成功。首先,我想知道使用哪个控制台环境来执行此操作。这是 cmd 还是 IRB 控制台?

每当我使用 cmd 时,默认行是 c:\users\me>我不知道这是否会影响事情的运作。

每当我尝试安装 SQLITE3 时,我都假设我需要去:

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

但是我没有到达任何地方并收到以下错误:

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

我听说过很多关于 Ruby 的好东西,我只是尝试构建一个带有联系人的基本网页形式,但我似乎在项目安装和简单地启动并运行 ruby​​ 时遇到了各种问题。是否有任何教程解释如何从头开始使用 JRuby 和 Sqlite3 启动 Web 项目?

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?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

国际总奸 2024-12-16 22:14:32

正如警告所示,sqlite3-ruby 需要本机 C 扩展,并且它不能很好地与 JRuby 配合使用。

您应该改用activerecord-jdbcsqlite3-adapter

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

请参阅https://github.com/jruby/activerecord-jdbc-adapter

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

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文