RubyInstaller 2.2.1 和 Rails - Rake 无法加载 Nokogiri [英] RubyInstaller 2.2.1 and Rails - Rake cannot load Nokogiri

查看:35
本文介绍了RubyInstaller 2.2.1 和 Rails - Rake 无法加载 Nokogiri的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

最近我在 Windows 上安装了带有新 RubyInstaller 的 Ruby 2.2.1.为了检查一切是否正常,我进入了一个 rails 应用程序并运行了 bundle install ,它运行良好.但是,当我使用 bunle exec rake test 运行测试时,出现以下错误:

recently I installed Ruby 2.2.1 with the new RubyInstaller on Windows. To check whether everything was working I went into a rails app and ran bundle install which was working fine. However, when I ran the tests with bunle exec rake test, I got the following errors:

rake aborted!
LoadError: cannot load such file -- nokogiri/nokogiri
D:/Dev/Grummle/config/application.rb:7:in `<top (required)>'
D:/Dev/Grummle/Rakefile:4:in `<top (required)>'
LoadError: cannot load such file -- nokogiri/2.2/nokogiri
D:/Dev/Grummle/config/application.rb:7:in `<top (required)>'
D:/Dev/Grummle/Rakefile:4:in `<top (required)>'
(See full trace by running task with --trace)

Bundler 说它是使用 nokogiri 1.6.5.此外,rake 任务在 Ruby 2.1.5 上运行良好.我很欣赏有关如何解决问题的想法.谢谢!:)

Bundler says that it is Using nokogiri 1.6.5. Also, the rake task is working fine with Ruby 2.1.5. I appreciate ideas on how to resolve the issue. Thanks! :)

推荐答案

Windows 上的 Ruby 2.2 尚不存在 Nokogiri.

Nokogiri doesn't exist yet for Ruby 2.2 on windows.

https://github.com/sparklemotion/nokogiri/issues/1256

本质上,nokogiri 提供了针对特定 ruby​​ 版本的预编译,而 2.2 还不是这些版本之一.为 windows 编译 nokogiri 过于复杂.

Essentially, nokogiri is provided preocompiled for specific ruby versions, and 2.2 isn't one of those versions yet. compiling nokogiri for windows is overly complicated.

这篇关于RubyInstaller 2.2.1 和 Rails - Rake 无法加载 Nokogiri的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆