如何使用Rails安装程序在Windows 10上安装Ruby On Rails

时间:2019-04-07 02:07:21

标签: ruby-on-rails ruby windows sqlite railsinstaller

我正在尝试创建一个新的Ruby On Rails项目。我正在遵循官方Getting Started with Rails指南。在针对Ruby 2.2运行Rails Installer之后,我尝试通过运行rails new blog创建一个新项目并得到以下错误:

...
Installing sqlite3 1.4.0 with native extensions
Installing turbolinks-source 5.2.0
Installing i18n 1.6.0
Installing tzinfo 1.2.5
Installing nokogiri 1.10.2
Using rack-test 0.6.3
Installing sprockets 3.7.2
Installing websocket-driver 0.6.5 with native extensions
Installing mail 2.7.1
Using coffee-script 2.4.1
Installing uglifier 4.1.20
Installing rb-inotify 0.10.0
Gem::Ext::BuildError: ERROR: Failed to build gem native extension.

C:/RailsInstaller/Ruby2.2.0/bin/ruby.exe -r
./siteconf20190406-3720-ldo4eg.rb extconf.rb
checking for sqlite3.h... no
sqlite3.h is missing. Install SQLite3 from http://www.sqlite.org/ first.
*** 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=C:/RailsInstaller/Ruby2.2.0/bin/$(RUBY_BASE_NAME)
        --with-sqlcipher
        --without-sqlcipher
        --with-sqlite3-config
        --without-sqlite3-config
        --with-pkg-config
        --without-pkg-config
        --with-sqlcipher
        --without-sqlcipher
        --with-sqlite3-dir
        --without-sqlite3-dir
        --with-sqlite3-include
        --without-sqlite3-include=${sqlite3-dir}/include
        --with-sqlite3-lib
        --without-sqlite3-lib=${sqlite3-dir}/lib

extconf failed, exit code 1

Gem files will remain installed in
C:/RailsInstaller/Ruby2.2.0/lib/ruby/gems/2.2.0/gems/sqlite3-1.4.0 for
inspection.
Results logged to
C:/RailsInstaller/Ruby2.2.0/lib/ruby/gems/2.2.0/extensions/x86-mingw32/2.2.0/sqlite3-1.4.0/gem_make.out

An error occurred while installing sqlite3 (1.4.0), and Bundler cannot continue.
Make sure that `gem install sqlite3 -v '1.4.0'` succeeds before bundling.

在线解决此问题有许多“解决方案”。他们都解释了手动安装sqlite的不同方法。我尝试过手动安装sqlite,但不知道如何安装它,以便Rails知道在哪里可以找到我的本地安装。网上有很多关于如何执行此操作的建议,但没有一个对我有用。

我花了六个多小时来尝试简单地创建一个新的Rails项目并不断收到此错误(或类似错误)。据我了解,Rails Installer应该可以安装一切。我在做什么错了?

0 个答案:

没有答案