首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >无法在Windows 10上安装/使用LocomotiveCMS货车

无法在Windows 10上安装/使用LocomotiveCMS货车
EN

Stack Overflow用户
提问于 2020-08-27 09:37:26
回答 2查看 107关注 0票数 0

这最初是一个关于特定gem安装问题的问题,但是我经历了很多次迭代,试图让这个应用程序在Windows 10上工作,所以我决定修改这个问题并编写一份指南。希望这对将来经历这些问题的任何人(或我自己)都有帮助。

我正在运行一台Windows 10 64位机器。我尝试过RubyInstaller,并设置了Windows (WSL),并遇到了各种安装问题、创业板依赖问题,而且与任何知道问题的人一样,我都很模糊。

如何使Rails以及随后在Windows 10上运行的机车CMS?

注意:我最初跟随本教程安装了RubyInstaller。这显然很好(虽然在此过程中遇到了一些小问题),但我最终在尝试gem install locomotivecms_wagon时出现了以下错误,我无法解决这个错误:

代码语言:javascript
复制
ERROR:  Error installing locomotivecms_wagon:
    ERROR: Failed to build gem native extension.

current directory: C:/Dev/Dependencies/rubyinstaller-2.5.8-1-x64/lib/ruby/gems/2.5.0/gems/nokogumbo-1.5.0/ext/nokogumboc
C:/Dev/Dependencies/rubyinstaller-2.5.8-1-x64/bin/ruby.exe -I C:/Dev/Dependencies/rubyinstaller-2.5.8-1-x64/lib/ruby/site_ruby/2.5.0 -r ./siteconf20200827-12272-1va06mr.rb extconf.rb
checking for xmlNewDoc() in -lxml2... yes
checking for nokogiri.h in C:/Dev/Dependencies/rubyinstaller-2.5.8-1-x64/lib/ruby/gems/2.5.0/gems/nokogiri-1.10.10/ext/nokogiri... yes
checking for nokogiri.h in C:/Dev/Dependencies/rubyinstaller-2.5.8-1-x64/lib/ruby/gems/2.5.0/gems/nokogiri-1.10.10/ext/nokogiri... yes
checking for gumbo_parse() in -lgumbo... no
checking for GumboErrorType with error.h... not found
checking for GumboInsertionMode with insertion_mode.h... not found
checking for GumboParser with parser.h... not found
checking for GumboStringBuffer with string_buffer.h... not found
checking for GumboTokenType with token_type.h... not found
creating Makefile

current directory: C:/Dev/Dependencies/rubyinstaller-2.5.8-1-x64/lib/ruby/gems/2.5.0/gems/nokogumbo-1.5.0/ext/nokogumboc
make "DESTDIR=" clean

current directory: C:/Dev/Dependencies/rubyinstaller-2.5.8-1-x64/lib/ruby/gems/2.5.0/gems/nokogumbo-1.5.0/ext/nokogumboc
make "DESTDIR="
generating nokogumboc-x64-mingw32.def
compiling attribute.c
compiling char_ref.c
compiling error.c
compiling nokogumbo.c
In file included from nokogumbo.c:31:
C:/Dev/Dependencies/rubyinstaller-2.5.8-1-x64/lib/ruby/gems/2.5.0/gems/nokogiri-1.10.10/ext/nokogiri/nokogiri.h:13: warning: "_GNU_SOURCE" redefined
   13 | #define _GNU_SOURCE
      |
In file included from C:/Dev/Dependencies/rubyinstaller-2.5.8-1-x64/include/ruby-2.5.0/ruby/ruby.h:24,
             from C:/Dev/Dependencies/rubyinstaller-2.5.8-1-x64/include/ruby-2.5.0/ruby.h:33,
             from nokogumbo.c:21:
C:/Dev/Dependencies/rubyinstaller-2.5.8-1-x64/include/ruby-2.5.0/x64-mingw32/ruby/config.h:18: note: this is the location of the previous definition
   18 | #define _GNU_SOURCE 1
      |
compiling parser.c
compiling string_buffer.c
compiling string_piece.c
compiling tag.c
compiling tokenizer.c
compiling utf8.c
compiling util.c
compiling vector.c
linking shared-object nokogumboc.so
C:/Dev/Dependencies/msys64/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/10.2.0/../../../../x86_64-w64-mingw32/bin/ld.exe: nokogumbo.o:nokogumbo.c:(.text+0x49b): undefined reference to 'Nokogiri_wrap_xml_document'
collect2.exe: error: ld returned 1 exit status
make: *** [Makefile:259: nokogumboc.so] Error 1

make failed, exit code 2

Gem files will remain installed in C:/Dev/Dependencies/rubyinstaller-2.5.8-1-x64/lib/ruby/gems/2.5.0/gems/nokogumbo-1.5.0 for inspection.
Results logged to C:/Dev/Dependencies/rubyinstaller-2.5.8-1-x64/lib/ruby/gems/2.5.0/extensions/x64-mingw32/2.5.0/nokogumbo-1.5.0/gem_make.out
Temporarily enhancing PATH for MSYS/MINGW...
Building native extensions. This could take a while...
EN

回答 2

Stack Overflow用户

回答已采纳

发布于 2020-08-30 09:24:18

在3次安装、卸载和重新安装之后,我放弃了RubyInstaller。RubyInstaller为我运行Windows7提供了很好的支持--我怀疑没有它我还能得到一个正常工作的Ruby环境。而且它可能在Windows 10上也起作用了。我已经设置好了,但是我不能让机车CMS货车创业板按照我问题中的问题安装。

对我起作用的是设置WSL ( SubSystem for Linux)并在上面安装Ruby。我和Go Rails教程一起跟踪这些指示

我强烈推荐更新WSL Linux内核 (WSL 1> WSL 2)。我第一次没有这样做,有各种各样的问题。本GitHub教程帮助识别您是否安装了WSL 1或2。

(我不担心像GitHub教程中描述的那样创建另一个用户,因为我第一次启动Ubuntu时就被提示这样做了。据我所知,这是防止用户与根权限问题的必要条件。我还没有遇到任何问题。)

当您安装Ruby时,不要安装2.7.1。如果这样做,那么在编写本报告时,当您开始安装locomotivecms_wagon时,您将遇到以下问题:

代码语言:javascript
复制
Bundler found conflicting requirements for the Ruby version:
In Gemfile:
Ruby

locomotivecms_steam was resolved to 1.5.0.rc0, which depends on
  nokogiri (~> 1.8.2) was resolved to 1.8.5, which depends on
    Ruby (>= 2.1.0)

locomotivecms_steam was resolved to 1.5.0.rc0, which depends on
  nokogiri (~> 1.8.2) was resolved to 1.8.5, which depends on
    Ruby (< 2.6, >= 2.2) x64-mingw32

据我所知,您只能在Ruby < 2.6或>= 2.1.0上运行机车CMS。

我使用的是rbenv,而不是rvm。那是另一个讨论。

在我完成了所有的工作之后,我可以在没有太多麻烦的情况下建立以下内容:

几个注意事项:

  • 我还没有在WSL上设置Git。我担心它将如何处理通过Ubuntu所做的更改和通过Windows所做的更改。我需要通过Windows做出一些改变--通过终端做任何事情都是不现实的。不知道那会怎么样。当我发现的时候,我可能会用更多的信息更新这个答案。
  • 我所有的文件都包含在一个Dropbox文件夹中。不确定我将在Ubuntu下创建/编辑它们这一事实是否会产生任何影响。
票数 1
EN

Stack Overflow用户

发布于 2020-08-28 20:13:14

我在这里发现了一个类似的GitHub问题:https://github.com/rubys/nokogumbo/issues/4

他们提到以下声明作为解决办法:

代码语言:javascript
复制
gem install nokogumbo -- --with-ldflags=-no-undefined

运行此命令,然后重新运行bundle install

票数 0
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/63613201

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档