Heroku的应用程序崩溃,日志说“没有这样的文件加载 - nokogiri(LoadError)”。 [英] Heroku app crashes, logs say "No such file to load -- nokogiri (LoadError)"

查看:109
本文介绍了Heroku的应用程序崩溃,日志说“没有这样的文件加载 - nokogiri(LoadError)”。的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述



我的Gemfile包含: gem'nokogiri'我的Gemfile包含: gem'nokogiri'



我运行了 bundle install 并验证了我的Gemfile.lock包含 DEPENDENCIES ... nokogiri



thinkI不得不在本地出错,如果我没有):

  class MydealController< ApplicationController 
require'rubygems'
require'open-uri'
require'nokogiri'

当我使用我的浏览器获取MydealController中的url时,它使用nokogiri doc = Nokogiri :: XML(getresult) Heroku崩溃。



heroku日志显示此错误无此文件加载 - nokogiri(LoadError)



查看当我 git push heroku 时会发生什么我没有看到许多许多列表上的nokogiri获得安装的宝石。 Heroku表示推得很好,但nokogiri没有列出,我得到了上述错误...

解决方案

使用Windows Gemfile.lock 将包含版本的 nokogiri gem特定于Windows,解决方案是删除Gemfile。锁定并推送到heroku。



有关此主题的更多信息 here


I had a working app, added Nokogiri, to parse some xml, runs fine locally.

My Gemfile includes: gem 'nokogiri'

I ran bundle install and verified my Gemfile.lock includes DEPENDENCIES ... nokogiri

In my controller class I added (didnt thinkI had to but got an error locally if I didnt):

class MydealController < ApplicationController
  require 'rubygems'
  require 'open-uri'
  require 'nokogiri'

when I use my browser to get the url in MydealController that uses nokogiri doc = Nokogiri::XML(getresult) Heroku crashes.

heroku logs shows this error No such file to load -- nokogiri (LoadError)

Looking at what happens when I git push heroku I do not see nokogiri on the list of many many gems that get installed. Heroku says the push was fine, but nokogiri is not listed and I get the aforementioned error...

解决方案

It seems that when using Windows Gemfile.lock will contain version of nokogiri gem specific for windows, solution is to remove Gemfile.lock and push to heroku.

More info on this subject here

这篇关于Heroku的应用程序崩溃,日志说“没有这样的文件加载 - nokogiri(LoadError)”。的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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