繁体   English   中英

如何在Windows上正确安装bootsnap

[英]How can I properly install bootsnap on windows

我正在尝试使用rails安装程序在rails上安装ruby。 当我使用“rails new blog”来启动网页时,我不断遇到构建错误以构建本机扩展。 我在安装sqlite3时也遇到了类似的问题。 同样的问题也出现在我的笔记本电脑上。 (两个窗口)

到目前为止,我尝试下载此演练( https://github.com/Shopify/bootsnap/issues/134 ),但在它告诉我执行脚本时卡住了。 我尝试在irb中运行给定的脚本,因为它逐行说和复制粘贴。 我也尝试过gem install bootsnapgem install bundler --force 我还尝试从rails安装程序中分别下载2.5和2.6的不同版本的ruby。

Installing bootsnap 1.4.4 with native extensions
Gem::Ext::BuildError: ERROR: Failed to build gem native extension.

current directory:
C:/RailsInstaller/Ruby2.3.3/lib/ruby/gems/2.3.0/gems/bootsnap-1.4.4/ext/bootsnap
C:/RailsInstaller/Ruby2.3.3/bin/ruby.exe -I
C:/RailsInstaller/Ruby2.3.3/lib/ruby/site_ruby/2.3.0 -r
./siteconf20190425-5616-1pnzlwm.rb extconf.rb
creating Makefile

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

current directory:
C:/RailsInstaller/Ruby2.3.3/lib/ruby/gems/2.3.0/gems/bootsnap-1.4.4/ext/bootsnap
make "DESTDIR="
generating bootsnap-i386-mingw32.def
compiling bootsnap.c
bootsnap.c: In function 'bs_cache_path':
bootsnap.c:245:3: warning: unknown conversion type character 'l' in format
[-Wformat]
bootsnap.c:245:3: warning: too many arguments for format [-Wformat-extra-args]
bootsnap.c: In function 'bs_rb_fetch':
bootsnap.c:286:3: warning: ISO C90 forbids mixed declarations and code
[-Wdeclaration-after-statement]
bootsnap.c: In function 'fetch_cached_data':
bootsnap.c:412: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:484:3: warning: implicit declaration of function 'mkstemp'
[-Wimplicit-function-declaration]
bootsnap.c: In function 'bs_rb_fetch':
bootsnap.c:632:13: warning: 'output_data' may be used uninitialized in this
function [-Wmaybe-uninitialized]
bootsnap.c:603: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.4\ext\bootsnap/bootsnap.c:484:
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.4 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.4/gem_make.out

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

In Gemfile:
  bootsnap

说实话,我没想到使用rails安装程序时会出现这样的问题我可以立即开始工作。

这适用于sqlite。

gem 'sqlite3', git: "https://github.com/larskanis/sqlite3-ruby", branch: "add-gemspec"

Bootsnap 2.3.3我无法运行它并升级了ruby版本。 如果你从下面的链接下载Ruby + Devkit 2.5.5-1(x64),我希望问题会有所改善。 Ruby 2.5.5

我使用Rails 5.2.3,ruby 2.3获得了相同的捆绑安装问题。 发现AngelofDawn最近的帖子对我有用:将gemfile中的bootsnap gem更改为

gem 'bootsnap', '=1.4.1', require: false

获取bootsnap的错误(退出代码2),不允许设置Rails服务器

还在寻找'为什么'

我用这个来解决它:

gem 'bootsnap', require: false

来源: https//stackoverflow.com/a/56275766/534600

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

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