ruby-on-rails - RVM、Rails 错误

标签 ruby-on-rails ruby ruby-on-rails-3 rvm

我安装了RVM,然后用它安装了ruby-1.9.2,然后用rubygems安装了rails 3.0。它允许我创建一个新的应用程序,但是当我更改为应用程序的根目录并尝试生成脚手架时,我收到此错误:

Could not find gem 'sqlite3-ruby (>= 0, runtime)' in any of the gem sources.
Try running `bundle install`.

然后我运行了“bundle install”,一切看起来都安装得很好,直到它到达 sqlite3-ruby 并给了我这个巨大的错误消息:

Installing sqlite3-ruby (1.3.1) with native extensions /home/connor/.rvm/rubies/ruby-1.9.2-p0/lib/ruby/1.9.1/rubygems/installer.rb:483:in `rescue in block in build_extensions': ERROR: Failed to build gem native extension. (Gem::Installer::ExtensionBuildError)

/home/connor/.rvm/rubies/ruby-1.9.2-p0/bin/ruby extconf.rb 
checking for sqlite3.h... no
sqlite3.h is missing. Try 'port install sqlite3 +universal' or 'yum install sqlite3-devel'
*** extconf.rb failed ***
Could not create Makefile due to some reason, probably lack of
necessary libraries and/or headers.  Check the mkmf.log file for more
details.  You may need configuration options.

Provided configuration options:
--with-opt-dir
--without-opt-dir
--with-opt-include
--without-opt-include=${opt-dir}/include
--with-opt-lib
--without-opt-lib=${opt-dir}/lib
--with-make-prog
--without-make-prog
--srcdir=.
--curdir
--ruby=/home/connor/.rvm/rubies/ruby-1.9.2-p0/bin/ruby
--with-sqlite3-dir
--without-sqlite3-dir
--with-sqlite3-include
--without-sqlite3-include=${sqlite3-dir}/include
--with-sqlite3-lib
--without-sqlite3-lib=${sqlite3-dir}/lib


Gem files will remain installed in /home/connor/.rvm/gems/ruby-1.9.2-p0/gems/sqlite3-ruby-1.3.1 for inspection.
Results logged to /home/connor/.rvm/gems/ruby-1.9.2-p0/gems/sqlite3-ruby-1.3.1/ext/sqlite3/gem_make.out
from /home/connor/.rvm/rubies/ruby-1.9.2-p0/lib/ruby/1.9.1/rubygems/installer.rb:486:in `block in build_extensions'
from /home/connor/.rvm/rubies/ruby-1.9.2-p0/lib/ruby/1.9.1/rubygems/installer.rb:446:in `each'
from /home/connor/.rvm/rubies/ruby-1.9.2-p0/lib/ruby/1.9.1/rubygems/installer.rb:446:in `build_extensions'
from /home/connor/.rvm/rubies/ruby-1.9.2-p0/lib/ruby/1.9.1/rubygems/installer.rb:198:in `install'
from /home/connor/.rvm/gems/ruby-1.9.2-p0@global/gems/bundler-1.0.3/lib/bundler/source.rb:100:in `install'
from /home/connor/.rvm/gems/ruby-1.9.2-p0@global/gems/bundler-1.0.3/lib/bundler/installer.rb:55:in `block in run'
from /home/connor/.rvm/gems/ruby-1.9.2-p0@global/gems/bundler-1.0.3/lib/bundler/spec_set.rb:12:in `block in each'
from /home/connor/.rvm/gems/ruby-1.9.2-p0@global/gems/bundler-1.0.3/lib/bundler/spec_set.rb:12:in `each'
from /home/connor/.rvm/gems/ruby-1.9.2-p0@global/gems/bundler-1.0.3/lib/bundler/spec_set.rb:12:in `each'
from /home/connor/.rvm/gems/ruby-1.9.2-p0@global/gems/bundler-1.0.3/lib/bundler/installer.rb:44:in `run'
from /home/connor/.rvm/gems/ruby-1.9.2-p0@global/gems/bundler-1.0.3/lib/bundler/installer.rb:8:in `install'
from /home/connor/.rvm/gems/ruby-1.9.2-p0@global/gems/bundler-1.0.3/lib/bundler/cli.rb:221:in `install'
from /home/connor/.rvm/gems/ruby-1.9.2-p0@global/gems/bundler-1.0.3/lib/bundler/vendor/thor/task.rb:22:in `run'
from /home/connor/.rvm/gems/ruby-1.9.2-p0@global/gems/bundler-1.0.3/lib/bundler/vendor/thor/invocation.rb:118:in `invoke_task'
from /home/connor/.rvm/gems/ruby-1.9.2-p0@global/gems/bundler-1.0.3/lib/bundler/vendor/thor.rb:246:in `dispatch'
from /home/connor/.rvm/gems/ruby-1.9.2-p0@global/gems/bundler-1.0.3/lib/bundler/vendor/thor/base.rb:389:in `start'
from /home/connor/.rvm/gems/ruby-1.9.2-p0@global/gems/bundler-1.0.3/bin/bundle:13:in `<top (required)>'
from /home/connor/.rvm/gems/ruby-1.9.2-p0@global/bin/bundle:19:in `load'
from /home/connor/.rvm/gems/ruby-1.9.2-p0@global/bin/bundle:19:in `<main>'

有人知道是什么原因导致这些错误吗? RVM?

最佳答案

不,这不是 RVM 的错。这意味着您没有安装 SQLite3 库。

/home/connor/.rvm/rubies/ruby-1.9.2-p0/bin/ruby extconf.rb 
checking for sqlite3.h... no
sqlite3.h is missing. Try 'port install sqlite3 +universal' or 'yum install sqlite3-devel'
*** extconf.rb failed ***
Could not create Makefile due to some reason, probably lack of
necessary libraries and/or headers.  Check the mkmf.log file for more
details.  You may need configuration options.

您需要安装 SQLite3 库和开发头文件才能编译和安装 SQLite gem。

关于ruby-on-rails - RVM、Rails 错误,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/3957862/

相关文章:

ruby - 为什么 MiniTest::Spec 没有 wont_raise 断言?

ruby - 禁止 Thor CLI 应用程序中的警告消息

ruby-on-rails - Rails模型类中实例变量的用途是什么

ruby-on-rails - Rails number_to_phone : Remove country code from phone number

ruby-on-rails - 事件模型序列化程序 - 自定义适配器

ruby - 如何为类方法动态定义别名方法?

ruby-on-rails-3 - Rails 3 从单个数据库表生成种子文件

ruby-on-rails - 在Ruby on Rails 3 Web应用程序中生成图表的首选方式是什么?

ruby-on-rails - 哪个选项更好?使用 centos 软件包中的旧版本 ruby​​ 或使用手动安装的最新版本

ruby-on-rails - 如何计算自 Ruby 中的给定日期以来经过了多少年?