用于 Rails 3.1 的 Sqlite3 gem [英] Sqlite3 gem for Rails 3.1

查看:44
本文介绍了用于 Rails 3.1 的 Sqlite3 gem的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想使用命令创建 myApp

I wanna create myApp using command

rails 新的 myApp

rails new myApp

但它给出了错误:

使用本机扩展安装 sqlite3 (1.3.4)Gem::Installer::ExtensionBuildError: 错误:无法构建 gem 本机扩展名.

Installing sqlite3 (1.3.4) with native extensions Gem::Installer::ExtensionBuildError: ERROR: Failed to build gem native extension.

/usr/bin/ruby1.8 extconf.rb 检查 sqlite3.h...没有 sqlite3.h丢失的.尝试port install sqlite3 +universal"或yum install"sqlite3-devel' 并检查您的共享库搜索路径(位置您的 sqlite3 共享库所在的位置).* extconf.rb 失败 * 由于某种原因无法创建 Makefile,可能缺少必要的库和/或头文件.查看有关更多详细信息,请查看 mkmf.log 文件.您可能需要配置选项.

/usr/bin/ruby1.8 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). * 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.

提供的配置选项:--with-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=/usr/bin/ruby1.8--with-sqlite3-dir--without-sqlite3-dir--with-sqlite3-include--without-sqlite3-include=${sqlite3-dir}/include--with-sqlite3-lib--without-sqlite3-lib=${sqlite3-dir}/lib--启用本地--禁用本地

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=/usr/bin/ruby1.8 --with-sqlite3-dir --without-sqlite3-dir --with-sqlite3-include --without-sqlite3-include=${sqlite3-dir}/include --with-sqlite3-lib --without-sqlite3-lib=${sqlite3-dir}/lib --enable-local --disable-local

Gem 文件将保持安装在/usr/lib/ruby/gems/1.8/gems/sqlite3-1.3.4 用于检查.结果登录/usr/lib/ruby/gems/1.8/gems/sqlite3-1.3.4/ext/sqlite3/gem_make.out 一个安装 sqlite3 (1.3.4) 时出错,Bundler 不能继续.确保 gem install sqlite3 -v '1.3.4' 成功捆绑前.

Gem files will remain installed in /usr/lib/ruby/gems/1.8/gems/sqlite3-1.3.4 for inspection. Results logged to /usr/lib/ruby/gems/1.8/gems/sqlite3-1.3.4/ext/sqlite3/gem_make.out An error occured while installing sqlite3 (1.3.4), and Bundler cannot continue. Make sure that gem install sqlite3 -v '1.3.4' succeeds before bundling.

我该怎么办?谢谢

推荐答案

确保你已经安装了 SQLite3 的开发头文件.

Make sure you have the development headers for SQLite3 installed.

例如:

在 Ubuntu 上,你可以使用 apt-get install libsqlite3-dev

On Ubuntu, you can use apt-get install libsqlite3-dev

在安装了 Homebrew 的 Mac 上:brew install sqlite.

On Mac with homebrew installed: brew install sqlite.

这篇关于用于 Rails 3.1 的 Sqlite3 gem的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆