Warning: file_get_contents(/data/phpspider/zhask/data//catemap/5/ruby/24.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Ruby on rails 如何修复';未能生成gem本机扩展';使用Windows启动快照时出错_Ruby On Rails_Ruby_Windows - Fatal编程技术网

Ruby on rails 如何修复';未能生成gem本机扩展';使用Windows启动快照时出错

Ruby on rails 如何修复';未能生成gem本机扩展';使用Windows启动快照时出错,ruby-on-rails,ruby,windows,Ruby On Rails,Ruby,Windows,我使用的是Windows,我刚刚安装了Ruby on Rails,Ruby是版本2.6.3p62(2019-04-16修订版67580)[x64-mingw32],Rails是版本6.0.0。 运行rails时,将运行新博客(以下)捆绑安装 我曾尝试重新安装Ruby,更改其版本,甚至删除bootsnap并运行其他程序,但即使尝试安装puma gem,我也会遇到同样的错误 Gem::Ext::BuildError: ERROR: Failed to build gem native extensi

我使用的是Windows,我刚刚安装了Ruby on Rails,Ruby是版本2.6.3p62(2019-04-16修订版67580)[x64-mingw32],Rails是版本6.0.0。 运行rails时,将运行新博客(以下)捆绑安装

我曾尝试重新安装Ruby,更改其版本,甚至删除bootsnap并运行其他程序,但即使尝试安装puma gem,我也会遇到同样的错误

Gem::Ext::BuildError: ERROR: Failed to build gem native extension.

current directory:
C:/Ruby26-x64/lib/ruby/gems/2.6.0/gems/bootsnap-1.4.5/ext/bootsnap
C:/Ruby26-x64/bin/ruby.exe -I C:/Ruby26-x64/lib/ruby/2.6.0 -r
./siteconf20191028-6188-1rw29js.rb extconf.rb
creating Makefile

current directory:
C:/Ruby26-x64/lib/ruby/gems/2.6.0/gems/bootsnap-1.4.5/ext/bootsnap
make "DESTDIR=" clean

current directory:
C:/Ruby26-x64/lib/ruby/gems/2.6.0/gems/bootsnap-1.4.5/ext/bootsnap
make "DESTDIR="
generating bootsnap-x64-mingw32.def
compiling bootsnap.c
linking shared-object bootsnap/bootsnap.so
C:/Ruby26-x64/msys64/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/9.2.0/../../../../x86_64-w64-mingw32/bin/ld.exe:
bootsnap.o:bootsnap.c:(.text+0x557): undefined reference to `__strcat_chk'
C:/Ruby26-x64/msys64/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/9.2.0/../../../../x86_64-w64-mingw32/bin/ld.exe:
bootsnap.o:bootsnap.c:(.text+0xa07): undefined reference to `__chk_fail'
collect2.exe: error: ld returned 1 exit status
make: *** [Makefile:261: bootsnap.so] Error 1

make failed, exit code 2

Gem files will remain installed in
C:/Ruby26-x64/lib/ruby/gems/2.6.0/gems/bootsnap-1.4.5 for inspection.
Results logged to
C:/Ruby26-x64/lib/ruby/gems/2.6.0/extensions/x64-mingw32/2.6.0/bootsnap-1.4.5/gem_make.out

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

实际上,Bootsnap无论如何在Windows上都不起作用,所以我建议将其从文件中删除。如果您想将其留给生产环境,也许您应该有条件地将其包括在以下内容中:

gem 'bootsnap' unless (RbConfig::CONFIG['host_os'] =~ /mswin|mingw|cygwin/)

实际上,Bootsnap无论如何在Windows上都不起作用,所以我建议将其从文件中删除。如果您想将其留给生产环境,也许您应该有条件地将其包括在以下内容中:

gem 'bootsnap' unless (RbConfig::CONFIG['host_os'] =~ /mswin|mingw|cygwin/)

可能重复尝试了两种解决方案但无法解决我的问题可能重复尝试了两种解决方案但无法解决我的问题