简体   繁体   中英

Issue with SQLite gem when installing Ruby on Rails

Error installing sqlite3, failed to build native gem extension.

Running on 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). Running 'bundle install' popped up with an error saying I needed to download SQlite.

No problem, I go to the SQLite website and download sqlite3. Re-running 'bundle install', I get an error saying:

'An error occurred while installing sqlite3 (1.4.0), and Bundler cannot continue. Make sure that gem install sqlite3 -v '1.4.0' --source 'https://rubygems.org/' succeeds before bundling.'

Following the suggestion, I run this command and get the following error:

'sqlite3.h is missing. Install SQLite3 from http://www.sqlite.org/ first. Could not create Makefile..'

I have download sqlite3 from the website, there is no sqlite3.h file in the folders. My google and SO searches have been fruitless.

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

Go to Gemfile and replace gem'sqlite3' to gem 'sqlite3', '< 1.4'

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

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