简体   繁体   English

无法加载此类文件-yajl-ruby(LoadError)

[英]cannot load such file — yajl-ruby (LoadError)

I'm having problem with a gem called 'indeed'. 我遇到了一个名为“确实”的宝石问题。 I'm creating a job application with ruby on rails and since I introduced this gem, everytime that I try to use the server Rails s I have this error message: 我正在用Rails创建Ruby的作业应用程序,并且自从引入此gem以来,每次尝试使用服务器Rails时,我都会收到以下错误消息:

C:/RailsInstaller/Ruby2.0.0/lib/ruby/gems/2.0.0/gems/indeed-0.1.2/lib/indeed.rb:4:in `require': cannot load such file -- yajl-ruby (LoadError)        from C:/RailsInstaller/Ruby2.0.0/lib/ruby/gems/2.0.0/gems/indeed-0.1.2/lib/indeed.rb:4:in `<top (required)>'        from C:/RailsInstaller/Ruby2.0.0/lib/ruby/gems/2.0.0/gems/bundler-1.3.5/lib/bundler...

I installed yajl-ruby, but still doesn't work. 我安装了yajl-ruby,但仍然无法正常工作。

Does anybody know what can be the issue there? 有人知道那里可能有什么问题吗?

Indeed.rb Indeed.rb

require 'net/http'
require 'cgi'
require "uri"
require 'yajl'



class Indeed

Seems like it is a version compatibility issue - for ruby 2.0.0. 似乎是版本兼容性问题-对于ruby 2.0.0。

See here: https://github.com/brianmario/yajl-ruby/issues/116 and follow luislavena comment. 参见这里: https : //github.com/brianmario/yajl-ruby/issues/116并遵循luislavena的评论。

In ruby 1.9.3 it works. 在Ruby 1.9.3中,它可以工作。

将gem添加到您的Gemfile中: gem 'yajl' (或者也许gem 'yajl-ruby' )然后运行bundle install解决了这个问题吗?

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM