草庐IT

饭碗警告

全部标签

ruby - Sinatra/1.4.3 使用 Rack::Session::Cookie 警告

我的配置代码require'sinatra'#set:environment,:productionenable:sessionsenable:loggingsetrun:truecasewhenproduction?setport:8081whendevelopment?require'sinatra/reloader'require'better_errors'useBetterErrors::MiddlewareBetterErrors.application_root=__dir__enduseRack::Session::Cookie,key:'N&wedhSDF',doma

ruby - 升级到 ruby​​ 2.2.0 后的警告

/gems/htmlentities-4.3.2/lib/htmlentities/mappings/expanded.rb:465:warning:duplicatedkeyatline466ignored:"inodot"/gems/ruby-2.2.0/gems/fog-core-1.25.0/lib/fog/core/collection.rb:144:warning:circularargumentreference-filters明显的怀疑是这些gems不喜欢ruby​​2.2.0,但事情似乎在起作用我应该担心future的、迫在眉睫的失败,还是这些gem还没有catch?

ruby-on-rails - 如何摆脱 Spring 警告 : Running `gem pristine --all` ?

我正在使用Springapplicationpreloader并刚刚升级到v0.9.0。现在我收到以下警告:Warning:Runninggempristine--alltoregenerateyourinstalledgemspecswillimprovethestartupperformanceofSpring.我尝试运行该命令,但它无法安装我的一些gem,这可能与我最近升级到OSXMavericks有关。我如何摆脱这个警告? 最佳答案 这是因为以前版本的ruby​​gems会在查询时加载所有的gemspecs。开始时速度很慢,

ruby - 你能要求 ruby​​ 将警告视为错误吗?

ruby是否允许您将警告视为错误?我想这样做的一个原因是确保如果删除一行代码意味着出现警告,我可以选择确保突变体被杀死。 最佳答案 不幸的是,没有真正的方法可以做到这一点,至少在大多数Ruby版本上都没有(变化可能存在),缺乏监控程序输出和当标准错误出现警告时中止它。原因如下:Ruby定义Kernel.warn,你可以重新定义做任何你想做的事(包括退出),并且你期望(希望)Ruby一致地使用它来报告警告(包括内部例如解析警告),但是在Ruby中原生实现的方法(在C中)将反过来直接调用source/server.c中名为rb_warn

ruby-on-rails - 安装 rails 插件时出现警告

我在我的Rails应用程序中安装任何插件时收到以下警告。/usr/local/lib/ruby/gems/1.9.1/gems/activesupport-2.3.5/lib/active_support/core_ext/kernel/agnostics.rb:7:warning:Insecureworldwritabledir/usr/local/bininPATH,mode040777谁能告诉我如何解决这个问题?谢谢 最佳答案 Ruby(在所有Unix上,包括Cygwin)会在您尝试运行外部程序并且您的$PATH包含一个全局可

ruby-on-rails - 警告 : Can't mass-assign protected attributes

当发帖到/:username/about时,我收到“警告:无法批量分配protected属性:about”。classAbout["lower(username)=?",params[:username].downcase])iftrue@about=@user.aboutif@about.update_attributes(params[:about])flash[:notice]="Successfullyupdatedpost."respond_with(@about,:location=>about_path(@about.user.username))elseredirect

ruby - 是什么触发了关于第一个参数不明确的 Ruby 警告?

在Ruby1.9.1中,如果你这样做$VERBOSE=trueputs/m/,42.to_s或者如果我这样做$VERBOSE=trueputs/m/,"42"你收到警告warning:ambiguousfirstargument;putparenthesesorevenspaces但我不明白$VERBOSE=trueputs"m",42.to_s或$VERBOSE=trueputs(/m/,42.to_s)那么具体是什么触发了这个警告?我还可以在原始表达式中添加哪些空格? 最佳答案 “问题”是/可以表示除法或正则表达式。该消息是通用

ruby-on-rails - Rails:在具有警告的子文件夹中组织模型:B::A引用的顶级常量A

今天我决定重组大量与用户相关的模型,但遇到了问题。在我有这样的结构之前:app/models/user.rbapp/models/user_info.rbapp/models/user_file.rb...所以我将所有user_模型移动到user子文件夹中,如下所示:app/models/user.rbapp/models/user/info.rbapp/models/user/file.rb...并将它们的定义更改为classUser::InfoUser模型未更改(关联除外)。除User::File模型外,一切正常。当我尝试访问此模型时,出现以下错误:warning:toplevel

ruby - 如何修复 Rubygems 最近的弃用警告?

我最近运行了更新:gemupdate--systemgemupdate现在,每次我加载gem时都会收到很多弃用警告。例如,railsconsole:NOTE:Gem::Specification#default_executable=isdeprecatedwithnoreplacement.Itwillberemovedonorafter2011-10-01.Gem::Specification#default_executable=calledfrom/Users/user/.rvm/gems/ruby-1.9.2-p180@global/specifications/rake-0

ruby-on-rails - Spring 警告 : You're using Rubygems 2. 0.3。至少升级到 Rubygems 2.1.0

我收到错误:警告:您正在将Rubygems2.0.3与Spring一起使用。尝试运行Rails控制台时至少升级到Rubygems2.1.0。我该如何更新它? 最佳答案 尝试运行gemupdate--system来更新Rubygems本身。 关于ruby-on-rails-Spring警告:You'reusingRubygems2.0.3。至少升级到Rubygems2.1.0,我们在StackOverflow上找到一个类似的问题: https://stackov