草庐IT

get_loaded_extensions

全部标签

ruby - 错误 : Failed to build gem native extension (ruby extconf. rb): Mac OSX

这个问题在这里已经有了答案:RubyGeminstallJsonfailsonMavericksandXcode5.1-unknownargument:'-multiply_definedsuppress'(11个答案)关闭7年前。我正在尝试安装一个gem,但出现了这个错误,这是我自己和gem作者以前从未见过的。我该如何解决这个问题?Davids-MacBook-Pro:webdavid$sudo/usr/bin/geminstallcompass--prePassword:Buildingnativeextensions.Thiscouldtakeawhile...ERROR:Err

ruby-on-rails - 在 RSpec 中使用 Ruby 1.9.2 需要 lib 带来 "no such file to load"

我正在尝试将我的一个Rails项目升级到Ruby1.9.2。一切进展顺利,但一个RSpec测试失败了。在这个测试中,我需要一个Rubylib:#filespec/models/my_lib_spec.rbrequire'spec_helper'require'lib/services/my_lib'describe"MyLib"doit"shoulddosomething"do...库看起来像这样:#filelib/services/my_lib.rbclassMyLibdefself.do_something...在Ruby1.8.7(REE)中测试运行良好:$ruby-vruby1

ruby-on-rails - ruby 包安装需要 : no such files to load error

我在通过git克隆的应用程序的bundleinstall安装gems时遇到了麻烦。这是bundleinstall的输出:bundleinstall/usr/lib/ruby/vendor_ruby/bundler/rubygems_ext.rb:8:in`require':nosuchfiletoload--rubygems(LoadError)from/usr/lib/ruby/vendor_ruby/bundler/rubygems_ext.rb:8from/usr/lib/ruby/vendor_ruby/bundler.rb:11:in`require'from/usr/lib

ruby - 导轨 : how to get a file extension/postfix based on the mime type

我的问题是,RubyonRails是否具有类似于以下的功能:file_content_type=MIME::Types.type_for(file).first.content_type这将返回特定mime类型的文件扩展名或后缀?所以如果我传入'image/jpeg'函数将返回'jpg'寻找一种比编写完成相同工作的case语句更简洁的编码方式。 最佳答案 Rack::Mime具有这种能力(Rack是Rails的依赖):require'rack/mime'Rack::Mime::MIME_TYPES.invert['image/jpe

ruby - 加载错误 : cannot load such file -- rspec/core/rake_task

当我rake的时候,我得到了这个错误。AllenLins-MacBook-Pro:geoblacklightallenlin$rake-tResolvingdependencies...Youmust`geminstallbundler`and`bundleinstall`torunraketasksrakeaborted!LoadError:cannotloadsuchfile--rspec/core/rake_task/Users/allenlin/Documents/USpatial/geoblacklight/Rakefile:12:in`require'/Users/alle

ruby - 如何使用修改后的 header 制作 HTTP GET?

使用修改后的header在Ruby中发出HTTPGET请求的最佳方式是什么?我想从日志文件的末尾获取一系列字节,并一直在玩弄以下代码,但服务器返回一个响应说“这是服务器无法理解的请求”(服务器是Apache)。require'net/http'require'uri'#with@address,@port,@pathalldefinedelsewherehttpcall=Net::HTTP.new(@address,@port)headers={'Range'=>'bytes=1000-'}resp,data=httpcall.get2(@path,headers)有没有更好的方法在R

ruby - 为什么 rubocop 或 ruby​​ 风格指南不喜欢使用 get_ 或 set_?

我在我的项目上运行rubocop并修复它提出的投诉。一个特别的提示困扰着我Donotprefixreadermethodnameswithget_我无法从这个投诉中了解太多,所以我查看了sourcecodeingithub.我找到了这个片段defbad_reader_name?(method_name,args)method_name.start_with?('get_')&&args.to_a.empty?enddefbad_writer_name?(method_name,args)method_name.start_with?('set_')&&args.to_a.one?end

ruby-on-rails - bundle 安装 : ERROR: Failed to build gem native extension. nio4r gem

我目前正在使用以下项目进行项目:rvm1.26.11ruby2.2.1p85我尝试运行bundleinstall但不断收到以下错误:Gem::Ext::BuildError:ERROR:Failedtobuildgemnativeextension.并且,以下:Anerroroccurredwhileinstallingnio4r(1.0.0),andBundlercannotcontinue.Makesurethat`geminstallnio4r-v'1.0.0'`succeedsbeforebundling.当我尝试运行geminstallnio4r-v'1.0.0'时:Buil

ruby - 错误 : Error installing ffi: ERROR: Failed to build gem native extension

安装了DevKit并重新运行ffi安装…。将其作为输出:C:\DocumentsandSettings\******>geminstallffiTemporarilyenhancingPATHtoincludeDevKit...Buildingnativeextensions.Thiscouldtakeawhile...ERROR:Errorinstallingffi:ERROR:Failedtobuildgemnativeextension.C:/Ruby192/bin/ruby.exeextconf.rbcheckingforffi.h...nocheckingforffi.hin

ruby-on-rails - ruby 错误 : cannot load such file -- rest-client

我正在使用RubyonRails4。我正在努力require'rest-client'在我的Controller中,以便我可以解析从表单中获取的登录信息并将其发送到API。我可以验证gem是否已安装并且也在我的应用程序根目录下的Gemfile中。但是,当我尝试在我的Controller中请求该文件时,它仍然抛出“无法加载此类文件--rest-client”。我用谷歌搜索了这个错误,我看到的大部分答案要么是gem没有安装,要么不在Gemfile中,要么是两者兼而有之。这里的情况也不是。我的Controller是否由于某种原因无法访问rest-clientgem?我必须使用rest-cli