[英]How to fix `require': cannot load such file — nokogiri/2.1/nokogiri (LoadError)
[英]IRB showing “LoadError: cannot load such file — nokogiri” error when trying to require “nokogiri”
在IRB中,當我輸入“nokogiri”時,我收到以下錯誤:
LoadError: cannot load such file -- nokogiri
我在我的gemfile中安裝了nokogiri gem並且可以在Rails中使用它沒有問題,但是在IRB中它會拋出錯誤。
我是OSX Mavericks的,如果有幫助的話。
以下是我當地寶石的列表:
動作郵件(4.0.2)
actionpack(4.0.2)
activemodel(4.0.2)
activerecord(4.0.2)
activerecord-deprecated_finders(1.0.3)
activesupport(4.0.2)
arel(4.0.1)
原子(1.1.14)
建設者(3.1.4)
捆綁(1.3.5)
erubis(2.7.0)
徒步旅行(1.2.3)
i18n(0.6.9)
郵件(2.5.4)
啞劇型(1.25.1)
minitest(4.7.5)
multi_json(1.8.2)
多語言(0.3.3)
機架(1.5.2)
機架測試(0.6.2)
鐵軌(4.0.2)
鐵路(4.0.2)
耙(10.1.0)
鏈輪(2.10.1)
鏈輪導軌(2.0.1)
托爾(0.18.1)
thread_safe(0.1.3)
傾斜(1.4.1)
樹梢(1.4.15)
tzinfo(0.3.38)
您需要做的就是運行bundle exec irb
以使用Gemfile中的gem。
你應該在加載任何其他寶石之前運行require 'rubygems'
。 Rails為你做這件事,但IRB並不那么花哨。
否則,你是否使用像RVM這樣的經理? 你確認你沒有進入或退出寶石集嗎?
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.