设置 Ruby on Rails 时出错

发布于 2024-10-16 15:15:16 字数 1524 浏览 4 评论 0原文

按照本指南,我尝试使用 Amazon 的 EC2 设置 Ruby on Rails。对于我的实例,我选择了“Basic 32-bit Amazon Linux AMI 2010.11.1 Beta”。我安装了 ruby​​、sqlite 和 ruby​​gems。我正在执行链接指南的步骤 3.3,即运行以下命令

捆绑安装

结果如下。我确信我错过了一些东西,但我不知所措。有什么建议吗?

Installing sqlite3 (1.3.3) with native extensions /usr/lib/ruby/site_ruby/1.8/rubygems    /installer.rb:529:in `build_extensions': ERROR: Failed to build gem native extension (Gem::Installer::ExtensionBuildError)

/usr/bin/ruby extconf.rb 
mkmf.rb can't find header files for ruby at /usr/lib/ruby/ruby.h

Gem files will remain installed in /usr/lib/ruby/gems/1.8/gems/sqlite3-1.3.3 for inspection.

编辑:按照下面的建议安装 ruby​​-devel,除了原来的错误之外,我现在还收到此错误。

Installing sqlite3 (1.3.3) with native extensions /usr/lib/ruby/site_ruby/1.8/rubygems/installer.rb:529:in `build_extensions': 
ERROR: Failed to build gem native extension. (Gem::Installer::ExtensionBuildError)

    /usr/bin/ruby extconf.rb 
checking for sqlite3.h... no
sqlite3.h is missing. Try 'port install sqlite3 +universal'
or 'yum install sqlite3-devel' and check your shared library search path (the
location where your sqlite3 shared library is located).

但当我尝试跑步时

yum 安装 sqlite-devel

我被告知:

Package sqlite-devel-3.6.20-1.6.amzn1.i386 already installed and latest version
Nothing to do

Following this guide, I'm attempting to set up Ruby on Rails using Amazon's EC2. For my instance I've selected "Basic 32-bit Amazon Linux AMI 2010.11.1 Beta". I have ruby, sqlite, and rubygems installed. I'm on step 3.3 of the linked guide which is to run the following command

bundle install

The result is the following. I'm sure I've just missed something, but I'm at a loss. Any suggestions?

Installing sqlite3 (1.3.3) with native extensions /usr/lib/ruby/site_ruby/1.8/rubygems    /installer.rb:529:in `build_extensions': ERROR: Failed to build gem native extension (Gem::Installer::ExtensionBuildError)

/usr/bin/ruby extconf.rb 
mkmf.rb can't find header files for ruby at /usr/lib/ruby/ruby.h

Gem files will remain installed in /usr/lib/ruby/gems/1.8/gems/sqlite3-1.3.3 for inspection.

EDIT: Following the suggestion below to install ruby-devel, I now get this error in addition to the original one.

Installing sqlite3 (1.3.3) with native extensions /usr/lib/ruby/site_ruby/1.8/rubygems/installer.rb:529:in `build_extensions': 
ERROR: Failed to build gem native extension. (Gem::Installer::ExtensionBuildError)

    /usr/bin/ruby extconf.rb 
checking for sqlite3.h... no
sqlite3.h is missing. Try 'port install sqlite3 +universal'
or 'yum install sqlite3-devel' and check your shared library search path (the
location where your sqlite3 shared library is located).

But when I try to run

yum install sqlite-devel

I'm told:

Package sqlite-devel-3.6.20-1.6.amzn1.i386 already installed and latest version
Nothing to do

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

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

发布评论

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

评论(4

我为君王 2024-10-23 15:15:16

除了上面的软件包之外,请确保您还安装了 gcc 和 make。

除了开发库之外,还需要它们来构建您正在安装的 gem。

In addition to the packages above, mas sure you have gcc and make installed.

They are needed to build the gems you are installing in addition to the development libraries.

[浮城] 2024-10-23 15:15:16

尝试在

$ sudo apt-get install libsqlite3-dev 之前安装 libsqlite3

之后重试安装 gem

-dev,并在$ gem install sqlite3-ruby

Try to install the libsqlite3-dev before

$ sudo apt-get install libsqlite3-dev

and retry to install the gem after

$ gem install sqlite3-ruby

骄兵必败 2024-10-23 15:15:16

这对我有用:

yum install ruby-devel
yum install sqlite-devel

不是 sqlite3-devel

This worked for me:

yum install ruby-devel
yum install sqlite-devel

NOT sqlite3-devel

罪#恶を代价 2024-10-23 15:15:16

在这里大胆猜测,但您可能会丢失一些开发包。尝试运行:

yum install ruby​​-devel sqlite3-devel

Venturing a guess here, but you might be missing a few development packages. Try running:

yum install ruby-devel sqlite3-devel

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