簡體   English   中英

在 Windows 上的 JRuby 9.2.8.0 上安裝 wdm gem

[英]Installing wdm gem on JRuby 9.2.8.0 on Windows

我們正在將 Rails 項目從 2.3 轉換為 5。

許多更改之一是啟動消息:

Please add the following to your Gemfile to avoid polling for changes:
    gem 'wdm', '>= 0.1.0' if Gem.win_platform?

嘗試在我的 JRuby 9.2.8.0 安裝中安裝 gem 時,我得到:

checking for main() in -lkernel32... RuntimeError: The compiler failed to
generate an executable file.
You have to install development tools first.
...
To see why this extension failed to compile, please check the mkmf.log which can
be found here:

M:/workspace/installations/jruby-9.2.8.0/lib/ruby/gems/shared/extensions/universal-java-1.8/2.5.0/wdm-0.1.1/mkmf.log

該文件包含:

" -o conftest.exe -I/include/universal-java1.8 -IM:/workspace/installations/jruby-9.2.8.0/lib/ruby/include/ruby/backward -IM:/workspace/installations/jruby-9.2.8.0/lib/ruby/include -I.     -fno-omit-frame-pointer -fno-strict-aliasing  -fexceptions  conftest.c  -L. -LM:/workspace/installations/jruby-9.2.8.0/lib  -LM:/workspace/installations/jruby-9.2.8.0/lib/native/x86_64-Windows   -m64 -march=native -mtune=native      "
checked program was:
/* begin */
1: #include "ruby.h"
2: 
3: #include <ruby.h>
4: int main(int argc, char **argv)
5: {
6:   return 0;
7: }
/* end */

注意:我可以在 ruby 2.6.4p104(2019-08-28 修訂版 67798)[x64-mingw32] 上安裝 gem,但不能在我的 JRuby 安裝中

關於如何安裝這個 gem 的任何想法?

或者如果沒有,我可以使用 wdm 的替代品嗎? 我注意到我的資產現在沒有在開發中正確重新加載。

第一個不再相關,因為 JRuby 現在確實支持 C 擴展。

這簡直(不再)是真的:在 JRuby 1.6 周圍實驗性地支持 C 擴展,在 1.7 中刪除過程(它們從未真正工作得那么好)開始並且 9.X 不支持它們。 現在,大多數原生 gem 在 JRuby 上都有一個 Java 特定的 ext 后端。

鏈接的問題試圖在使用 JRuby 時確定 Java 特定版本,不幸的是它沒有完成/合並,但您可以嘗試補丁。

您需要使用禁用 C-ext 編譯的補丁設置一個 fork 存儲庫。 或者您可以禁用 JRuby 上的 gem(並在您的應用程序中處理“特定”后端代碼):

gem 'wdm', '>= 0.1.0', platform: [:mri, :mswin]

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM