草庐IT

java - 我正在研究 Robolectric 但出现错误

全部标签

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-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 - 创建新数据库时 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 - 计算两个字母一起出现的次数

我正在尝试编写一个Ruby程序来计算两个字母同时出现的次数。这是我正在阅读的文件中写的内容:holachau这就是我想要得到的:ho;ol;la;ch;ha;au;1;1;1;1;1;1;我无法让它正常工作。到目前为止,这是我的代码:file=File.read(gets.chomp)todo=file.scan(/[a-z][a-z]/).each_with_object(Hash.new(0)){|a,b|b[a]+=1}keys=''values=''todo.each_key{|key|keys+=key+';'}todo.each_value{|value|values+=v

ruby - gem 安装失败,出现 "Could not find a valid gem ' yaml'"

我正在从一个当前可用的ruby​​程序构建一个gem。它使用jruby1.7.12,除其他外,它执行“require'yaml”。对于gem,我的Gemfile包含:source'https://rubygems.org'gemspec当我运行时gembuildprogram.gemspec这很好用,但是当我运行时geminstallprogram-0.15.01.gem它失败了ERROR:Couldnotfindavalidgem'yaml'(>=0)inanyrepositoryERROR:Possiblealternatives:aml,cyaml,haml,maml,raml没

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

ruby-on-rails - 您已经激活了 spring 1.3.6,但是您的 Gemfile 需要 spring 1.3.3。 ( gem ::加载错误)

我今天遇到了同样的问题,有一个建议:在您的命令前添加bundleexec可能会解决此问题。前置bundleexec没有帮助(我已经这样做了)。springstop和springrestart没有帮助。我需要做的:bundleupdatespring这对我有用。在之前的gemlock文件中使用spring版本是否有更好的解决方案? 最佳答案 我删除gemfile.lock并运行bundle通常会清除一切。否则只需从Gemfile中删除gem"spring"并运行bundle 关于ruby-

ruby-on-rails - 在 El Capitan 上安装 Rails 时出现 -lgmp 错误的库未找到(Mac OS 10.11.1 (15B42))

在使用Rubyv2.2.2的ElCapitan(MacOSX10.11.1)上安装Rails时,出现以下错误:ERROR:Errorinstallingnokogiri:ERROR:Failedtobuildgemnativeextension./Users/jon/.rvm/rubies/ruby-2.2.2/bin/ruby-r./siteconf20151117-26799-ux15fd.rbextconf.rb--use-system-librariescheckingiftheCcompileraccepts...***extconf.rbfailed***Couldnotc

Ruby gem 几乎每个命令都显示 "Invalid argument"错误

我正在OSXElCapitan上完成NativeScript的设置,我被困在我应该安装xcodeproj和cocoapods。我尝试用gem做的几乎所有事情都显示相同的错误:$sudogeminstallxcodeprojERROR:Whileexecutinggem...(Errno::EINVAL)Invalidargument以下命令显示相同的错误,无论我是否使用sudo运行它:$gemupdate--system$gemupdate$geminstallwhatever$geminstallcocoapods我有以下版本:$ruby--versionruby2.3.1p112(