设置 Ruby on Rails 时出错
按照本指南,我尝试使用 Amazon 的 EC2 设置 Ruby on Rails。对于我的实例,我选择了“Basic 32-bit Amazon Linux AMI 2010.11.1 Beta”。我安装了 ruby、sqlite 和 rubygems。我正在执行链接指南的步骤 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 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(4)
除了上面的软件包之外,请确保您还安装了 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.
尝试在
$ 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
这对我有用:
不是 sqlite3-devel
This worked for me:
NOT sqlite3-devel
在这里大胆猜测,但您可能会丢失一些开发包。尝试运行:
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