简体   繁体   English

安装 Ruby on Rails 时 SQLite gem 出现问题

[英]Issue with SQLite gem when installing Ruby on Rails

Error installing sqlite3, failed to build native gem extension.安装 sqlite3 时出错,无法构建本机 gem 扩展。

Running on Windows 10.在 Windows 10 上运行。

Following a codeacademy tutorial , I successfully installed Ruby on Rails (ruby version: 2.3.3p222 (2016-11-21 revision 56859) [i386-mingw32) (rails version: 5.1.7).按照 codeacademy教程,我成功安装了 Ruby on Rails(ruby 版本:2.3.3p222(2016-11-21 修订版 56859)[i386-mingw32)(rails 版本:5.1.7)。 Running 'bundle install' popped up with an error saying I needed to download SQlite.运行“bundle install”弹出一个错误提示我需要下载 SQlite。

No problem, I go to the SQLite website and download sqlite3.没问题,我去 SQLite 网站下载 sqlite3。 Re-running 'bundle install', I get an error saying:重新运行“捆绑安装”,我收到一条错误消息:

'An error occurred while installing sqlite3 (1.4.0), and Bundler cannot continue. ' 安装 sqlite3 (1.4.0) 时发生错误,Bundler 无法继续。 Make sure that gem install sqlite3 -v '1.4.0' --source 'https://rubygems.org/' succeeds before bundling.'确保gem install sqlite3 -v '1.4.0' --source 'https://rubygems.org/'在捆绑前成功。

Following the suggestion, I run this command and get the following error:按照建议,我运行此命令并收到以下错误:

'sqlite3.h is missing. 'sqlite3.h 丢失。 Install SQLite3 from http://www.sqlite.org/ first.首先从http://www.sqlite.org/安装 SQLite3。 Could not create Makefile..'无法创建 Makefile..'

I have download sqlite3 from the website, there is no sqlite3.h file in the folders.我从网站上下载了 sqlite3,文件夹中没有 sqlite3.h 文件。 My google and SO searches have been fruitless.我的谷歌和 SO 搜索一直没有结果。

Can you try the steps here:你能试试这里的步骤吗:

https://medium.com/@declancronje/installing-and-troubleshooting-ruby-on-rails-sqlite3-windows-10-fix-87c8886d03b

Github thread - https://github.com/sparklemotion/sqlite3-ruby/issues/224#issuecomment-482612096 Github 线程 - https://github.com/sparklemotion/sqlite3-ruby/issues/224#issuecomment-482612096

Go to Gemfile and replace gem'sqlite3' to gem 'sqlite3', '< 1.4'转到Gemfile并将gem'sqlite3'替换gem 'sqlite3', '< 1.4'

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM