rails服务器启动失败,win10

rails server failed to start, win10

安装后 windows railsinstaller-3.4.0(来自 here) 按照步骤 creating blog application in rails 然后尝试通过命令

启动服务器
$ bin/rails server

但失败并显示消息

Could not find gem 'turbolinks (~> 5) x86-mingw32' in any of the gem sources listed in your Gemfile.
Run `bundle install` to install missing gems.

然后尝试

bundle install

再次失败,错误消息为;

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

然后按照错误信息执行命令

gem install sqlite3 -v '1.4.2' --source 'https://rubygems.org/'

仍然失败\n 要了解此扩展编译失败的原因,请检查 mkmf.log,可在此处找到: 'extconf failed, exit code 1' \n 日志文件如下:

package configuration for sqlite3 is not found
find_header: checking for sqlite3.h... -------------------- no

"gcc -o conftest.exe -IC:/RailsInstaller/Ruby2.3.3/include/ruby-2.3.0/i386-mingw32 -IC:/RailsInstaller/Ruby2.3.3/include/ruby-2.3.0/ruby/backward -IC:/RailsInstaller/Ruby2.3.3/include/ruby-2.3.0 -I. -DFD_SETSIZE=2048 -D_WIN32_WINNT=0x0501 -D__MINGW_USE_VC2005_COMPAT -D_FILE_OFFSET_BITS=64   -O3 -fno-omit-frame-pointer -fno-fast-math -g -Wall -Wextra -Wno-unused-parameter -Wno-parentheses -Wno-long-long -Wno-missing-field-initializers -Wunused-variable -Wpointer-arith -Wwrite-strings -Wdeclaration-after-statement -Wimplicit-function-declaration -Wdeprecated-declarations -Wno-packed-bitfield-compat -DTAINTING_SUPPORT conftest.c  -L. -LC:/RailsInstaller/Ruby2.3.3/lib -L.      -lmsvcrt-ruby230  -lshell32 -lws2_32 -liphlpapi -limagehlp -lshlwapi  "
checked program was:
/* begin */
1: #include "ruby.h"
2: 
3: #include <winsock2.h>
4: #include <windows.h>
5: int main(int argc, char **argv)
6: {
7:   return 0;
8: }
/* end */

"gcc -E -IC:/RailsInstaller/Ruby2.3.3/include/ruby-2.3.0/i386-mingw32 -IC:/RailsInstaller/Ruby2.3.3/include/ruby-2.3.0/ruby/backward -IC:/RailsInstaller/Ruby2.3.3/include/ruby-2.3.0 -I. -DFD_SETSIZE=2048 -D_WIN32_WINNT=0x0501 -D__MINGW_USE_VC2005_COMPAT -D_FILE_OFFSET_BITS=64   -O3 -fno-omit-frame-pointer -fno-fast-math -g -Wall -Wextra -Wno-unused-parameter -Wno-parentheses -Wno-long-long -Wno-missing-field-initializers -Wunused-variable -Wpointer-arith -Wwrite-strings -Wdeclaration-after-statement -Wimplicit-function-declaration -Wdeprecated-declarations -Wno-packed-bitfield-compat -DTAINTING_SUPPORT  conftest.c -o conftest.i"
conftest.c:5:21: fatal error: sqlite3.h: No such file or directory
compilation terminated.
checked program was:
/* begin */
1: #include "ruby.h"
2: 
3: #include <winsock2.h>
4: #include <windows.h>
5: #include <sqlite3.h>
/* end */

安装的sqlite3版本是 3.22.0 2018-01-22 18:45:57 0c55d179733b46d8d0ba4d88e01a25e10677046ee3da1d5b1581e86726f2alt2

捆绑环境是

## Environment

```
Bundler       2.1.4
  Platforms   ruby, x86-mingw32
Ruby          2.3.3p222 (2016-11-21 revision 56859) [i386-mingw32]
  Full Path   C:/RailsInstaller/Ruby2.3.3/bin/ruby.exe
  Config Dir  C:/ProgramData
RubyGems      2.5.2
  Gem Home    C:/RailsInstaller/Ruby2.3.3/lib/ruby/gems/2.3.0
  Gem Path    C:/Users/Amrit/.gem/ruby/2.3.0;C:/RailsInstaller/Ruby2.3.3/lib/ruby/gems/2.3.0
  User Home   C:/Users/Amrit
  User Path   C:/Users/Amrit/.gem/ruby/2.3.0
  Bin Dir     C:/RailsInstaller/Ruby2.3.3/bin
Tools
  Git         2.17.1.windows.2
  RVM         not installed
  rbenv       not installed
  chruby      not installed
```

## Bundler Build Metadata

```
Built At          2020-01-05
Git SHA           32a4159325
Released Version  true
```

## Gemfile

### ../Gemfile

```ruby
source 'https://rubygems.org'

git_source(:github) do |repo_name|
  repo_name = "#{repo_name}/#{repo_name}" unless repo_name.include?("/")
  "https://github.com/#{repo_name}.git"
end


# Bundle edge Rails instead: gem 'rails', github: 'rails/rails'
gem 'rails', '~> 5.1.3'
# Use sqlite3 as the database for Active Record
gem 'sqlite3'
# Use Puma as the app server
gem 'puma', '~> 3.7'
# Use SCSS for stylesheets
gem 'sass-rails', '~> 5.0'
# Use Uglifier as compressor for JavaScript assets
gem 'uglifier', '>= 1.3.0'
# See https://github.com/rails/execjs#readme for more supported runtimes
# gem 'therubyracer', platforms: :ruby

# Use CoffeeScript for .coffee assets and views
gem 'coffee-rails', '~> 4.2'
# Turbolinks makes navigating your web application faster. Read more: https://github.com/turbolinks/turbolinks
gem 'turbolinks', '~> 5'
# Build JSON APIs with ease. Read more: https://github.com/rails/jbuilder
gem 'jbuilder', '~> 2.5'
# Use Redis adapter to run Action Cable in production
# gem 'redis', '~> 3.0'
# Use ActiveModel has_secure_password
# gem 'bcrypt', '~> 3.1.7'

# Use Capistrano for deployment
# gem 'capistrano-rails', group: :development

group :development, :test do
  # Call 'byebug' anywhere in the code to stop execution and get a debugger console
  gem 'byebug', platforms: [:mri, :mingw, :x64_mingw]
  # Adds support for Capybara system testing and selenium driver
  gem 'capybara', '~> 2.13'
  gem 'selenium-webdriver'
end

group :development do
  # Access an IRB console on exception pages or by using <%= console %> anywhere in the code.
  gem 'web-console', '>= 3.3.0'
end

# Windows does not include zoneinfo files, so bundle the tzinfo-data gem
gem 'tzinfo-data', platforms: [:mingw, :mswin, :x64_mingw, :jruby]
```

### ../Gemfile.lock

```
<No E:/apcharm/BoggleGameRuby/bogglegame/Gemfile.lock found>
```

我不知道我错过了什么成功的 rails 服务器 运行。请帮我解决一下这个。 提前致谢。

请编辑您的 Gemfile 并更改以下行

gem 'sqlite3'

gem 'sqlite3', '~> 1.3.11'

现在运行遵循命令

bundle install

我希望它现在应该可以工作了。