安装“nokogiri"时出错在 Ruby on Rails 应用程序中? [英] Error installing "nokogiri" in a Ruby on Rails application?

查看:48
本文介绍了安装“nokogiri"时出错在 Ruby on Rails 应用程序中?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我一直在关注 Lynda.com 的 Ruby on Rails 课程.我做了所有视频中提到的事情.

我正在尝试运行 rails server 命令,该命令应该默认为 WEBrick,对吗?

我运行了该命令,它在 nokogiri.rb 文件和第 29 行出现问题,其中发生错误,这是读取的内容:

需要'nokogiri/nokogiri'

这是我在运行 rails server 命令时出现的命令提示符.知道是什么原因造成的吗?如果是这样,我需要运行哪些命令来解决这个问题?对我来说,安装 MySQL 时听起来好像遗漏了一些东西.

我不确定 nokogiri 是什么以及为什么 rails server 不会运行并指向那行代码.

这个文件的路径是(无论你安装文件夹的位置)\lib\ruby\gems\2.2.0\gems\nokogiri-1.6.6.2-x64-mingw32\lib

编辑**:我有一系列错误,比如来自 -long path-、来自 -longpath- 等等.我尝试安装最新的 gem,但没有成功.有没有我可以与你们分享的日志文件以帮助找出问题.

解决方案

nokogiri 是一个用于解析 XML 和 HTML 的 Ruby宝石"(库).

您的 Rails 项目应该有一个 Gemfile,它指定运行项目所需的每个 gem 的名称和版本.要安装 gemfile 中列出的 gem:

捆绑安装

安装成功后,Rails 应该能够找到 nokogiri gem.

I've been following along with the Lynda.com's Ruby on Rails course. I did everything just as mentioned inside the videos.

I am trying to run the rails server command, which should default to WEBrick, correct?

I run the command and it has an issue in the nokogiri.rb file and on line 29 where the error is happening this is what is read:

require 'nokogiri/nokogiri'

Which is what my command prompt is throwing up on when running the rails server command. Any idea what could be causing this? If so, what commands do I need to run to settle this? To me it sounds like something was missed when installing MySQL.

I am not sure what nokogiri is and why rails server won't run and points to that line of code.

The path to this file is (Wherever you installed the folder to)\lib\ruby\gems\2.2.0\gems\nokogiri-1.6.6.2-x64-mingw32\lib

EDIT**: I have a chain of errors, like it goes from -long path-, from -longpath- etcetera. I tried installing the latest gem, and it wasn't successful. Is there a log file I can get to share with you guys to help figure out the issue.

解决方案

nokogiri is a Ruby "gem" (library) for parsing XML and HTML.

Your Rails project should have a Gemfile which specifies the name and version of each gem needed to run the project. To install the gems listed in the gemfile:

bundle install

After that install completes successfully, Rails should be able to find the nokogiri gem.

这篇关于安装“nokogiri"时出错在 Ruby on Rails 应用程序中?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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