草庐IT

c++ - CMake 着色错误和警告

全部标签

ruby-on-rails - `rbenv install 2.2.0` 错误

尝试SetupRubyOnRailsonUbuntu14.04TrustyTahr控制台错误输出:rbenvinstall2.2.0Downloadingruby-2.2.0.tar.gz...->http://dqw8nmjcqpjn7.cloudfront.net/7671e394abfb5d262fbcd3b27a71bf78737c7e9347fa21c39e58b0bb9c4840fcInstallingruby-2.2.0...BUILDFAILED(Ubuntu14.04usingruby-build20150112)Inspectorcleanuptheworkingt

ruby - 如何设置mysql2时区选项以删除查询警告

使用mysql2做查询总是得到警告/usr/local/lib/ruby/gems/1.9.1/gems/mysql2-0.2.6/lib/active_record/connection_adapters/mysql2_adapter.rb:463:warning::database_timezoneoptionmustbe:utcor:local-defaultingto:local我确实看到了时区选项Mysql2现在支持两个时区选项::database_timezone-thisisthetimezoneMysql2willassumefieldsarealreadystored

ruby - 通过 gem install mechanize 安装 gems 时显示错误 "invalid switch in RUBYOPT: -F (RuntimeError)"

我尝试通过以下命令在我的计算机上安装gem(Mechanize):>>geminstallmechanize--platform=ruby>>geminstallmechanize错误ERROR:Errorinstallingmechanize:ERROR:Failedtobuildgemnativeextension."C:/ProgramFiles/Ruby200-x64/bin/ruby.exe"extconf.rbC:/ProgramFiles/Ruby200-x64/bin/ruby.exe:invalidswitchinRUBYOPT:-F(RuntimeError)在我尝

ruby - RVM——警告! PATH 设置不正确

我的RVM有问题-我不断收到错误消息,告诉我PATH设置不正确。首先,所有这些听起来都像是来自一个完全的菜鸟,那是因为它确实是。我一直在查看一些类似的线程,但没有任何方法可以帮助我解决问题。任何帮助将不胜感激!当我运行rvmgethead并收到消息时:Warning!PATHisnotproperlysetup,'/Users/mbauer/.rvm/src/rvm/gems/ruby-2.1.0/bin'isnotatfirstplace,usuallythisiscausedbyshellinitializationfiles-checkthemfor'PATH=...'entri

ruby - RSpec:期望引发错误的方法失败

我正在尝试测试在特定条件下是否正确引发错误。在此规范中,出现了错误,但测试仍然失败。我做错了什么?require'spec_helper'describeUSBTeensyRendererdocontext'whenthecorrectUSBportnameisnotpresent'doit'raisesanerroroninstantiation'doexpect(renderer=USBTeensyRenderer.new).toraise_error(USBInitError)endendend以及“bundleexecrspec”的终端输出:Failures:1)USBTeen

ruby-on-rails - 使用机架中间件捕获无效的 JSON 解析错误

我正在使用Rails5,我正在尝试改进对我的API的无效JSON请求的错误处理。我尝试通过救援在Controller中解析来处理无效格式的JSON,但意识到如果用户将ContentType添加到他们的请求header,Rails中间件会在我的JSON请求到达Controller之前解析它。我遵循了以下指南:https://robots.thoughtbot.com/catching-json-parse-errors-with-custom-middleware但是,在启动服务器时出现以下错误:.rbenv/versions/2.3.1/lib/ruby/gems/2.3.0/gems

ruby-on-rails - 将 Rails/ClearDB App 推送到 Heroku 错误 'Can' t 连接到 '127.0.0.1' 上的 MySQL 服务器

每次我跑:gitpushherokumaster我收到以下错误:Running:rakeassets:precompilerakeaborted!Can'tconnecttoMySQLserveron'127.0.0.1'我在运行rails-vRails3.2.11和ruby-vruby1.9.3p194(2012-04-20revision35410)[x86_64-darwin12.2.0]我已经通过HerokuCLI安装了ClearDB,它似乎工作正常,但我无法找出这个错误。这是我用于生产的yml:production:adapter:mysql2encoding:utf8hos

Ruby 增量 (+=) 引发错误 undefined method '+' for nil :NilClass

以下代码导致了我的问题:classFoodefinitialize(n=0)@n=nendattr_accessor:ndefincn+=1endend调用Foo.new.inc引发NoMethodError:undefinedmethod'+'fornil:NilClass调用Foo.new.n返回0为什么Foo.new.inc会引发错误?我可以毫无问题地执行Foo.new.n+=1。 最佳答案 tldr;某种形式的self.n=x必须始终用于分配给setter。考虑n+=x扩展为n=n+x其中n被绑定(bind)为局部变量因为它

ruby-on-rails - 运行时出现段错误 'rails s'

完成捆绑安装后,我运行“railss”时遇到了这个错误。$railss/Users/XXXX/.rvm/gems/ruby-1.8.7-p352@r3/gems/json-1.5.3/ext/json/ext/json/ext/parser.bundle:[BUG]Segmentationfaultruby1.8.7(2011-06-30patchlevel352)[i686-darwin10.8.0]Aborttrap任何帮助将不胜感激 最佳答案 rvmgemset为空rvm使用ree@my-gemsetgem安装bundler捆

ruby-on-rails - 为什么 Rails 服务器会出现 "Could not find ' railties 错误?

当我使用railss启动Rails服务器时,出现以下错误:/usr/local/lib/site_ruby/1.8/rubygems/dependency.rb:296:in`to_specs':Couldnotfind'railties'(>=0)among10totalgem(s)(Gem::LoadError)from/usr/local/lib/site_ruby/1.8/rubygems/dependency.rb:307:in`to_spec'from/usr/local/lib/site_ruby/1.8/rubygems/core_ext/kernel_gem.rb:4