我正在尝试使用rails安装程序安装ruby on rails。当我使用"rails new blog“来启动网页时,我总是得到一个构建错误来构建一个本机扩展。我在安装sqlite3时也遇到过类似的问题。同样的问题也出现在我的笔记本电脑上。(两个窗口)
到目前为止,我尝试下载这个演练(https://github.com/Shopify/bootsnap/issues/134),但当它告诉我执行脚本时,我被卡住了。我尝试在irb中运行给定的脚本,就像它对逐行和复制粘贴所说的那样。我还尝试过gem install bootsnap和gem install bundler --force。我还尝试分别从rails安装程序下载了不同版本的ruby,版本分别为2.5和2.6。
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安装程序会出现这样的问题,因为它宣扬我可以立即开始工作。
发布于 2019-05-02 01:47:43
我在使用Rails 5.2.3,ruby 2.3时遇到了相同的包安装问题。我找到了一篇来自AngelofDawn的最新文章,它对我很有效:将gemfile中的bootsnap gem改为
gem 'bootsnap', '=1.4.1', require: falseGetting error (exit code 2) for bootsnap, not allowing to set up Rails Server。
仍然在寻找“为什么”
发布于 2019-04-26 06:17:55
这是针对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
发布于 2019-05-23 20:58:47
https://stackoverflow.com/questions/55857930
复制相似问题