草庐IT

ios - 在 IOS 中解析 Json 响应时出现 valueNotFound 错误

全部标签

ruby - RVM 在 arch linux 上安装 ruby​​ 错误

我可以在archlinux(manjaro)上使用rvm安装任何ruby​​,我总是能做到这一点[anquegi@manjaro-pc~]$rvminstall2.1.6--autolibs=packagesruby-2.1.6-#removingsrc/ruby-2.1.6..Searchingforbinaryrubies,thismighttakesometime.Nobinaryrubiesavailablefor:manjaro/16.06-pre1/x86_64/ruby-2.1.6.Continuingwithcompilation.Pleaseread'rvmhelpm

ruby - 哪个是 ANTLR 在 ruby​​ 中创建解析器的最佳对应物?

我使用antlr和javacc/freecc有一段时间了。现在我需要使用antlr语法编写一堆解析器,但此类解析器需要用ruby​​lang编写。我用谷歌搜索但没有找到。是否有任何采用antlr语法并创建解析器的ruby​​解析器生成器?如果有很多,您认为哪个是最好的?TIA保罗 最佳答案 您可以使用JRuby轻松逃脱并将您的ANTLR解析器保存在java中。如果PEGs足以胜任你的工作,treetop和更新的citrus是ruby​​ists使用的常用工具。我在研究项目时挖掘的其他解析器是:peggy,Kanocc,Racc.对于

ruby - Vpim::Vcard - 解析 vcard 2.1

我的代码必须解析Vcard2.1格式。我正在使用vpim(没有其他库)当我运行Vpim::Vcard.decode(data)时出现错误:undefinedmethod`each'for#堆栈跟踪:NoMethodError(undefinedmethod`each'for#):vpim(0.695)lib/vpim/rfc2425.rb:82:in`unfold'vpim(0.695)lib/vpim/rfc2425.rb:308:in`decode'vpim(0.695)lib/vpim/vcard.rb:692:in`decode'app/models/event.rb:71:i

ruby - 安装 dm-mysql-adapter 时出错

我是Ruby的新手。我安装了DataMapper并且正在尝试安装dm-mysql-adapter-1.0.2gem。但是当我尝试安装时,出现以下错误。我正在使用ubuntu操作系统。vinoth@vinoth-laptop:~/Downloads$geminstalldm-mysql-adapter-1.0.2----with-mysql-lib=/usr/lib/mysql----with-mysql-conf=/usr/bin/mysqlWARNING:Installingto~/.gemsince/home/vinoth/gemsand/home/vinoth/gems/bina

ruby-on-rails - Rails 通过 div 包装有错误的字段

当验证未通过时,如何停止Rails更改我的代码。每次rails用包裹我的字段...我可以编辑fields_with_error类.fields_with_error{display:inline}这行得通,但它是hacky 最佳答案 没关系。使用CSS而不是这样做。ActionView::Base.field_error_proc=Proc.newdo|html_tag,instance_tag|"#{html_tag}"end我觉得这更hacky:) 关于ruby-on-rails-R

ruby - 使用内置的 Ruby JSON 库反序列化 JSON 原语

为什么Ruby的内置JSON不能反序列化简单的JSON原语,我该如何解决这个问题?irb(main):001:0>require'json'#=>trueirb(main):002:0>objects=[{},[],42,"",true,nil]#=>[{},[],42,"",true]irb(main):012:0>objects.eachdo|o|irb(main):013:1*json=o.to_jsonirb(main):014:1>beginirb(main):015:2*pJSON.parse(json)irb(main):016:2>rescueException=>ei

ruby - 创建新数据库时 DataMapper SQLite 错误

我是Sinatra的新手,我正在尝试使用SQLite3和Datamapper创建一个数据库。我安装了gem和适配器,然后尝试在文件中执行此代码:#configrequire'sinatra'require'sinatra/contrib'ifdevelopment?require'data_mapper'DataMapper::setup(:default,"sqlite3://#{Dir.pwd}/recall.db")DataMapper.finalize.auto_upgrade!当我执行文件时,命令行给了我这个错误:C:/Ruby193/lib/ruby/site_ruby/1

ruby - ruby 中的 400 个错误请求但不是 curl

我正在尝试在ruby​​中发出https发布请求,它在curl中工作,但我在ruby​​中收到400错误请求,我无法弄清楚原因。这是ruby代码:require'rubygems'require'net/https'require'uri'require'json'uri=URI.parse("https://api.parse.com/1/push")http=Net::HTTP.new(uri.host,uri.port)http.use_ssl=truehttp.verify_mode=OpenSSL::SSL::VERIFY_NONEreq=Net::HTTP::Post.ne

ruby-on-rails - JSON解码参数问题

我有一个使用postgresql的Rails4应用程序。我还有一个backbone.js应用程序,可将JSON推送到Rails4应用程序。这是我的Controller:defcreate@product=Product.new(ActiveSupport::JSON.decodeproduct_params)respond_todo|format|if@product.saveformat.json{renderaction:'show',status::created,location:@product}elseformat.json{renderjson:@product.erro

ruby - 全新应用程序服务器上的 Rails 'parse_query' 错误

我已经在OSX10.10.3上安装了:自制软件,命令行工具,然后使用rbenv安装ruby​​:ruby2.2.2p95(2015-04-13revision50295)[x86_64-darwin14]Rails4.2.2当我创建一个新的应用程序(使用默认的sqlite数据库)并尝试运行它时,它说:=>BootingWEBrick=>Rails4.2.2applicationstartingindevelopmentonhttp://localhost:3000=>Run`railsserver-h`formorestartupoptions=>Ctrl-Ctoshutdownser