引导时出现错误(退出代码2),不允许设置Rails Server [英] Getting error (exit code 2) for bootsnap, not allowing to set up Rails Server

查看:119
本文介绍了引导时出现错误(退出代码2),不允许设置Rails Server的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

尝试测试基于Rails的网站,并不断出现错误,拒绝允许我设置服务器。

Trying to test a website built on Rails and keep getting an error that refuses to allow me to set up my server.

出现错误后,我使用了 gem install bootsnap -v'1.4.2'--source' https://rubygems.org/ '与来源为Rubygems。相同的错误:

After getting an error, I used 'gem install bootsnap -v '1.4.2' --source 'https://rubygems.org/' with the source as Rubygems. Same error:

Temporarily enhancing PATH to include DevKit...
Building native extensions. This could take a while...
ERROR:  Error installing bootsnap:
        ERROR: Failed to build gem native extension.

    current directory: C:/RailsInstaller/Ruby2.3.3/lib/ruby/gems/2.3.0/gems/bootsnap-1.4.2/ext/bootsnap
C:/RailsInstaller/Ruby2.3.3/bin/ruby.exe -I C:/RailsInstaller/Ruby2.3.3/lib/ruby/site_ruby/2.3.0 -r ./siteconf20190327-13232-1084dsi.rb extconf.rb
creating Makefile

current directory: C:/RailsInstaller/Ruby2.3.3/lib/ruby/gems/2.3.0/gems/bootsnap-1.4.2/ext/bootsnap
make "DESTDIR=" clean

current directory: C:/RailsInstaller/Ruby2.3.3/lib/ruby/gems/2.3.0/gems/bootsnap-1.4.2/ext/bootsnap
make "DESTDIR="
generating bootsnap-i386-mingw32.def
compiling bootsnap.c
bootsnap.c: In function 'bs_cache_path':
bootsnap.c:240:3: warning: unknown conversion type character 'l' in format [-Wformat]
bootsnap.c:240:3: warning: too many arguments for format [-Wformat-extra-args]
bootsnap.c: In function 'bs_rb_fetch':
bootsnap.c:281:3: warning: ISO C90 forbids mixed declarations and code [-Wdeclaration-after-statement]
bootsnap.c: In function 'fetch_cached_data':
bootsnap.c:407:3: warning: comparison is always false due to limited range of data type [-Wtype-limits]
bootsnap.c: In function 'atomic_write_cache_file':
bootsnap.c:479:3: warning: implicit declaration of function 'mkstemp' [-Wimplicit-function-declaration]
bootsnap.c: In function 'bs_rb_fetch':
bootsnap.c:623:13: warning: 'output_data' may be used uninitialized in this function [-Wmaybe-uninitialized]
bootsnap.c:594:9: note: 'output_data' was declared here
linking shared-object bootsnap/bootsnap.so
bootsnap.o: In function `atomic_write_cache_file':
C:\RailsInstaller\Ruby2.3.3\lib\ruby\gems\2.3.0\gems\bootsnap-1.4.2\ext\bootsnap/bootsnap.c:479: undefined reference to `mkstemp'
collect2.exe: error: ld returned 1 exit status
make: *** [bootsnap.so] Error 1

make failed, exit code 2

Gem files will remain installed in C:/RailsInstaller/Ruby2.3.3/lib/ruby/gems/2.3.0/gems/bootsnap-1.4.2 for inspection.
Results logged to C:/RailsInstaller/Ruby2.3.3/lib/ruby/gems/2.3.0/extensions/x86-mingw32/2.3.0/bootsnap-1.4.2/gem_make.out

我的gemfile包括:

My gemfile includes this:

# Reduces boot times through caching; required in config/boot.rb
gem 'bootsnap', '>= 1.4.2', require: true

我确实看到引导快照位于:C:\RailsInstaller\Ruby2.3.​​3\lib\ruby\gems\2.3.0\gems

I do see bootsnap located: C:\RailsInstaller\Ruby2.3.3\lib\ruby\gems\2.3.0\gems

有人会知道如何摆脱它吗?它也不位于我的宝石列表中。

Would anyone know how to get rid of this? It is not located on my gem list either.

Temporarily enhancing PATH to include DevKit...
Building native extensions. This could take a while...
ERROR:  Error installing bootsnap:
        ERROR: Failed to build gem native extension.

    current directory: C:/RailsInstaller/Ruby2.3.3/lib/ruby/gems/2.3.0/gems/bootsnap-1.4.2/ext/bootsnap
C:/RailsInstaller/Ruby2.3.3/bin/ruby.exe -I C:/RailsInstaller/Ruby2.3.3/lib/ruby/site_ruby/2.3.0 -r ./siteconf20190327-21940-1y9qpk9.rb extconf.rb
creating Makefile

current directory: C:/RailsInstaller/Ruby2.3.3/lib/ruby/gems/2.3.0/gems/bootsnap-1.4.2/ext/bootsnap
make "DESTDIR=" clean

current directory: C:/RailsInstaller/Ruby2.3.3/lib/ruby/gems/2.3.0/gems/bootsnap-1.4.2/ext/bootsnap
make "DESTDIR="
generating bootsnap-i386-mingw32.def
compiling bootsnap.c
bootsnap.c: In function 'bs_cache_path':
bootsnap.c:240:3: warning: unknown conversion type character 'l' in format [-Wformat]
bootsnap.c:240:3: warning: too many arguments for format [-Wformat-extra-args]
bootsnap.c: In function 'bs_rb_fetch':
bootsnap.c:281:3: warning: ISO C90 forbids mixed declarations and code [-Wdeclaration-after-statement]
bootsnap.c: In function 'fetch_cached_data':
bootsnap.c:407:3: warning: comparison is always false due to limited range of data type [-Wtype-limits]
bootsnap.c: In function 'atomic_write_cache_file':
bootsnap.c:479:3: warning: implicit declaration of function 'mkstemp' [-Wimplicit-function-declaration]
bootsnap.c: In function 'bs_rb_fetch':
bootsnap.c:623:13: warning: 'output_data' may be used uninitialized in this function [-Wmaybe-uninitialized]
bootsnap.c:594:9: note: 'output_data' was declared here
linking shared-object bootsnap/bootsnap.so
bootsnap.o: In function `atomic_write_cache_file':
C:\RailsInstaller\Ruby2.3.3\lib\ruby\gems\2.3.0\gems\bootsnap-1.4.2\ext\bootsnap/bootsnap.c:479: undefined reference to `mkstemp'
collect2.exe: error: ld returned 1 exit status
make: *** [bootsnap.so] Error 1

make failed, exit code 2

Gem files will remain installed in C:/RailsInstaller/Ruby2.3.3/lib/ruby/gems/2.3.0/gems/bootsnap-1.4.2 for inspection.
Results logged to C:/RailsInstaller/Ruby2.3.3/lib/ruby/gems/2.3.0/extensions/x86-mingw32/2.3.0/bootsnap-1.4.2/gem_make.out


推荐答案

我遇到了同样的问题,并且还在Windows计算机上使用railsinstaller

I had the same problem and I'm also using railsinstaller on a windows computer.

要解决此问题,我像这样更新了我的Gemfile:

To solve it, I updated my Gemfile like this :

#gem 'bootsnap', '>= 1.1.0', require: false
gem 'bootsnap', '= 1.4.1', require: false

然后在您的项目目录中运行命令:捆绑安装

Then run the command : bundle install in your project directory.

这篇关于引导时出现错误(退出代码2),不允许设置Rails Server的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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