草庐IT

OLD_VERSION_RUNNING

全部标签

ruby - 主要 :Object when running build from sublime 的未定义方法 `require_relative'

我已经从我的命令行中获得了一切,所以我可以运行rubymyfile并且它可以正常工作。但是当我尝试从sublime中运行它时,我得到了undefinedmethod`require_relative'formain:Object有人知道我的sublime设置中缺少什么吗?我正在使用OSX并安装了rvm。 最佳答案 或者,您可以只使用“require”,它应该可以正常工作。我认为“require_relative”仅适用于ruby​​1.9+ 关于ruby-主要:Objectwhenrun

使用时 Rubygems 2.0.14 不是线程安全的 bundle 程序安装消息 - RUBYGEMS VERSION : 2. 4.5.1

运行bundle安装时,我收到以下消息:Rubygems2.0.14isnotthreadsafe,soyourgemswillbeinstalledoneatatime.UpgradetoRubygems2.1.0orhighertoenableparallelgeminstallation.这很奇怪,因为在我的RubyGems环境中它说我的RubyGems版本是:2.4.5.1(见下文)~/w/Rafftopia❯❯❯gemenvRubyGemsEnvironment:-RUBYGEMSVERSION:2.4.5.1-RUBYVERSION:2.2.5(2016-04-26patc

ruby - session 未创建 : Chrome version must be between

当使用ruby​​selenium驱动程序驱动chrome时,我得到/home/travis/.rvm/gems/ruby-2.6.2/gems/selenium-webdriver-3.141.5926/lib/selenium/webdriver/remote/response.rb:72:in`assert_ok':sessionnot创建:Chrome版本必须在70和73之间(Selenium::WebDriver::Error::SessionNotCreatedError)如何解决这个问题?降级chrome不是我想做的事。 最佳答案

ruby - 无法在 MacOS 10.14.2 Mojave : Error running '__rvm_make -j4' 上使用 RVM 安装任何 Ruby

将MacOS升级到10.14.2Mojave后,我无法再使用RVM安装任何Ruby版本。它总是给出这样的错误:$rvminstall2.5.3ruby-2.5.3-#removingsrc/ruby-2.5.3..Searchingforbinaryrubies,thismighttakesometime.Nobinaryrubiesavailablefor:osx/10.14/x86_64/ruby-2.5.3.Continuingwithcompilation.Pleaseread'rvmhelpmount'togetmoreinformationonbinaryrubies.Ch

ruby-on-rails - 无方法错误 : undefined method `get' when running rspec and making get/visit calls

我完全被困在这里,希望有人能指出我正确的方向。我正在尝试使用rspec来测试我的网络路由。我按照这里的例子:https://www.relishapp.com/rspec/rspec-rails/docs/request-specs/request-spec我的规范文件被命名为:spec/requests文件夹中的api_tests_spec.rb。文件如下:require'spec_helper'describe"APITests"dodescribe"GET/regions"doit"shouldreturnavalidresponse"do#Runthegeneratoragai

ruby - 来自 Bundler 的 Fresh Ruby gem - 无法加载我的 version.rb 文件?

我想制作一个全新的Ruby应用程序,所以我决定使用bundlegemfoo来完成它。这给了我全部:lib/foo/version.rbfoo.rbGemfileRakefilefoo.gemspecREADME.md结构。现在,当我运行rubyfoo.rb时,我得到:`require':cannotloadsuchfile--foo/version(LoadError)foo.rb只是默认值:require'foo/version'moduleFooendgems不能自己跑吗?我希望我不必为了测试而将我的gem包含到示例应用程序中吗? 最佳答案

ruby - rbenv:未安装版本 `2.2.3'(由 RBENV_VERSION 环境变量设置)

当我运行部署脚本时,出现错误:[cb123fad]rbenv:version`2.2.3'isnotinstalled(setbyRBENV_VERSIONenvironmentvariable)DEBUG[cb123fad](Backtracerestrictedtoimportedtasks)capaborted!SSHKit::Runner::ExecuteError:Exceptionwhileexecutingasdeploy@xx.xx.xx.xx:Exceptionwhileexecutingasdeploy@xx.xx.xx.xx:bundleexitstatus:1b

ruby-on-rails - 警告 : Nokogiri was built against LibXML version 2. 8.0,但已动态加载 2.7.8

我在OSXML上的Ruby2.0.0和Rails4配置中遇到了这个问题。我的ArchLinux工作站上没有这个问题。这个警告之所以如此烦人,是因为它破坏了我的Vim插件(SweetVimRspec),因此终止了我的Vim开发工作流程,因为我无法测试。我在这里尝试了所有赞成的解决方案:MacuserandgettingWARNING:NokogiriwasbuiltagainstLibXMLversion2.7.8,buthasdynamicallyloaded2.7.3而且我无法摆脱它(实际上我在nokogiri本身中摆脱了它,但在rspec和railsconsole中根本没有)。

ruby - 在 gem --version 之后运行时获取 "isn' t a Gem::Specification(改为 NilClass)

$gem--version[/home/rohit/.rvm/gems/ruby-1.9.3-p125@qnrDashboard/specifications/net-ssh-2.5.2.gemspec]isn'taGem::Specification(NilClassinstead).[/home/rohit/.rvm/gems/ruby-1.9.3-p125@qnrDashboard/specifications/net-sftp-2.0.5.gemspec]isn'taGem::Specification(NilClassinstead).[/home/rohit/.rvm/ge

ruby - 如何停止使 tmux 自动设置 RBENV_VERSION

当我启动tmux时,tmux会自动设置RBENV_VERSION...有人知道怎么阻止吗?因为它会自动设置,所以我需要做$导出RBENV_VERSION取消设置并使.ruby-version工作。谢谢。 最佳答案 tmux本身永远不会自行设置(或取消设置)RBENV_VERSION。您有一些配置导致了这种情况。我的猜测是RBENV_VERSION是在您启动tmux服务器时设置的,它现在是tmux“全局环境”(所有继承的基础环境)的一部分tmux启动的进程)。你可以检查这个tmuxshow-environment-g|grepRBEN