簡體   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