草庐IT

ruby - Textmate 错误重复行 "ruby: warning: -K is specified; it is for 1.8 compatibility and may cause odd behavior"

在Textmate中使用ctrl+shift+d快捷方式重复行时,出现以下错误:“ruby:警告:指定了-K;这是为了1.8兼容性,可能会导致奇怪的行为” 最佳答案 此问题不仅限于重复行,还可能出现在其他使用ruby​​的地方。我通过将Preferences...>Advanced>ShellVariables中的PATH更改为/System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/bin来解决它:/usr/bin:/bin:/usr/sbin:/sbin此更改后,Tex

ruby-on-rails - Railscasts 第 362 集 - 导出到 Excel : How to avoid the warning message given by Excel 2010 when opening the file?

当使用RyanBates的Railscasts第362集关于导出到Excel(https://github.com/railscasts/362-exporting-csv-and-excel)的示例应用程序时,我注意到Excel2010(在Windows上)在打开.xls文件时给我一条警告消息我使用“下载为Excel”链接下载的文件。警告内容如下:“您尝试打开的文件...的格式与文件扩展名指定的格式不同。打开文件前请确认文件未损坏且来源可靠。是否要打开现在存档吗?”当我单击"is"时,我可以很好地打开文件。在使用Excel2011(在Mac上)时,我什至没有收到警告消息。但我希望能够

ruby-on-rails - 我该如何去追踪与 Bundler 相关的 DEPRECATION WARNING

我是Rails的新手。当我启动我的应用程序时,我不断看到这些弃用警告:DEPRECATIONWARNING:refisdeprecatedandwillberemovedfromRails3.2.(calledfromatD:/dev/AquaticKodiak/config/application.rb:12)DEPRECATIONWARNING:newisdeprecatedandwillberemovedfromRails3.2.(calledfromatD:/dev/AquaticKodiak/config/application.rb:12)好的,第12行是什么?这个:Bun

ruby - pg gem : 'Warning: no type cast defined for type "numeric"'

我在从pggem中获取输入结果时遇到问题。require'pg'require_relative'spec/fixtures/database'client=PG.connect(DB[:pg])client.type_map_for_queries=PG::BasicTypeMapForQueries.new(client)client.type_map_for_results=PG::BasicTypeMapForResults.new(client)client.exec(%|select*fromtestme;|)do|query|query.each{|r|putsr.ins

ruby-on-rails - rails : Why do I get "warning: already initialized constant JSON::VERSION" when running rake cucumber?

我刚刚设置了一个LinuxMintbox,用于使用rvm进行Rails开发。我继续生成了一个Rails5应用程序,设置了mysql连接,添加了cucumber-railsgem然后尝试运行:rakecucumber出于某种原因,我遇到了:/usr/bin/ruby2.3-Sbundleexeccucumber--profiledefault/usr/lib/ruby/vendor_ruby/json/version.rb:3:warning:alreadyinitializedconstantJSON::VERSION/var/lib/gems/2.3.0/gems/json-1.8.

ruby - 如何在 OSX Lion 上安装(构建)Ruby 1.9.3?

我一直致力于在我的MacOSXLion上安装Ruby。我已经安装了XCode、GCC、Readline、Homebrew和JewleryBox,但我不知道发生了什么。有什么指点吗?这是我的终端显示的内容?hugo-pc:ruby-1.9.3-p125squantowalks$rvminstall1.9.3Fetchingyaml-0.1.4.tar.gzto/Users/squantowalks/.rvm/archivesExtractingyaml-0.1.4.tar.gzto/Users/squantowalks/.rvm/srcErrorrunning'tarxmzf/Users

Ruby 动态类。如何修复 "warning: class variable access from toplevel"

我正在尝试编写一个程序,根据从文件中读取的配置动态定义ruby​​类。我知道我可以使用Class.new来做到这一点。这是一个示例程序:x=[1,2,3]Test=Class.newdo@@mylist=xdeffooputs@@mylistendendTest.new.foo当我运行它时,我得到以下输出(使用ruby​​1.9.3p0运行):c:/utils/test.rb:4:warning:classvariableaccessfromtoplevelc:/utils/test.rb:7:warning:classvariableaccessfromtoplevel123Does

ruby-on-rails - 使用 Rails 中的命名空间类防止 "warning: toplevel constant B referenced by A::B"

在自定义目录(例如:app/presenters/)中存储文件时,如何确保加载命名空间类?例如,如果您有:app/models/mega_menu.rbapp/presenters/catalog_presenter.rbapp/presenters/mega_menu/catalog_presenter.rbRails无法加载MegaMenu::CatalogPresenter:CatalogPresenter.new=>#MegaMenu::CatalogPresenter.new(irb):3:warning:toplevelconstantCatalogPresenterref

ruby-on-rails - 带有 Ruby 2.5.1 控制台的 Rails 5.2.0 - `warning:` `already` 初始化常量 FileUtils::VERSION

我目前在使用我的新Rails应用程序时遇到问题,更具体地说:rails5.2.0Ruby2.5.1p57(2018-03-29修订版63029)[x86_64-darwin17]rvm1.29.4(最新),作者:MichalPapis、PiotrKuczynski、WayneE.Seguin[https://rvm.io]当我运行railsc时,它会生成一个指向fileutilsgem的警告链接,如下所示:`/usr/local/Cellar/ruby/2.5.1/lib/ruby/2.5.0/fileutils.rb:90:``warning:``already`initialize

ruby-on-rails - 启动 Rails 服务器时出错 : warning: Insecure world writable dir/usr in PATH, 模式 040777

这个问题在这里已经有了答案:Gettingthewarning"Insecureworldwritabledir/home/chance"inPATH,mode040777forrailsandgem(6个答案)关闭8年前。我正在学习Treehouse上的Ruby教程,但在启动Rails服务器时,我不断收到以下错误:/usr/local/rvm/gems/ruby-1.9.3-p392@global/gems/bundler-1.2.4/lib/bundler/runtime.rb:197:warning:Insecureworldwritabledir/usrinPATH,mode0