草庐IT

github鉴权失败

全部标签

ruby-on-rails - 在 Rails 控制台中创建实例时 Rails 4 强参数失败

可能在这里做了一些愚蠢的事情,但这是我的基本千篇一律类:classLeague在创建一个新的League实例时:2.0.0-p0:001>l=League.new(full_name:'foo',short_name:'bar')WARNING:Can'tmass-assignprotectedattributesforLeague:full_name,short_name我到底做错了什么?这是Rails4.0.0.beta1构建+Ruby2.0**更新**我现在意识到强参数现在是在Controller中强制执行的,而不是在模型中。原来的问题仍然成立。如果它们在Controller级别

ruby-on-rails - 运行 autoconf 时 rvm install 1.9.2 失败?

当我运行时rvminstall1.9.2我在尝试运行autoconf时遇到错误。这是堆栈跟踪:kenmare:ruby-1.9.2-p0lee$rvminstall1.9.2-p0/Users/lee/.rvm/rubies/ruby-1.9.2-p0,thismaytakeawhiledependingonyourcpu(s)...ruby-1.9.2-p0-#fetchingruby-1.9.2-p0-#extractedto/Users/lee/.rvm/src/ruby-1.9.2-p0(alreadyextracted)RunningautoconfErrorrunning'

ruby-on-rails - 设计在身份验证失败期间不显示错误消息?

当设计中发生身份验证失败时,我期待一个闪现通知。但是在身份验证失败期间什么也得不到,只是页面刷新并保持静止。我没有改变任何东西。默认设计安装本身不会显示带有无效身份验证尝试的闪存错误。我刚刚将devise作为gem安装并尝试使用它。甚至不要更改生成的代码中的一个字。可能我想是不是由于某些浏览器的可比性问题。但我得到其他手动引入的flash消息,其他工作。关于什么可能被破坏的任何建议。我正在使用rails3.0.1*更新*我收到用户注册(注册)失败消息,但没有收到登录失败消息。一些关于这个主题的谷歌搜索显示,对于注册它期望:-但是对于登录,它希望引用其他一些警报消息标签,但没有得到我必须

ruby - `bundle install` 由于权限被拒绝而失败

我已经在我的新服务器上安装了bundlergem,当我尝试执行bundleinstall时,它失败并出现此错误:Unfortunately,afatalerrorhasoccurred.PleaseseetheBundlertroubleshootingdocumentationathttp://bit.ly/bundler-issues.Thanks!/usr/lib/ruby/1.9.1/fileutils.rb:247:in`mkdir':Permissiondenied-/var/lib/gems(Errno::EACCES)我的服务器是Debianwheezy(7.1),默认

ruby - Octopress 将错误推送到 GitHub

我正在尝试将octopress推送到github页面,到目前为止一切正常,但是当我在显示octopress文件后执行rakedeploy命令时,出现以下错误Togit@github.com:rukshn/rukshn.github.io.git![rejected]master->master(non-fast-forward)error:failedtopushsomerefsto'git@github.com:rukshn/rukshn.github.io.git'hint:Updateswererejectedbecausethetipofyourcurrentbranchisb

ruby - WebMock 模拟失败的 API(没有互联网,超时++)

我正在尝试使用webmock模拟WebAPI的意外行为,例如未找到服务器和超时。执行此操作的最佳方法是什么?我能想到的就是做这样的事情:stubbed_request=stub_request(:get,"#{host}/api/something.json").with(:headers=>{'Accept'=>'*/*','Content-Type'=>'application/json','User-Agent'=>'Ruby'}).to_return(:status=>[500,"InternalServerError"])这应该适用于404等问题,但我如何测试超时、未找到服务

ruby-on-rails - Date 与 ActiveSupport::TimeWithZone 的比较失败

我的Waiver模型上有一个age方法,如下所示:defage(date=nil)ifdate.nil?date=Date.todayendage=0unlessdate_of_birth.nil?age=date.year-date_of_birth.yearage-=1ifdate然后我有一个看起来像这样的规范:it"calculatestheproperage"dowaiver=FactoryGirl.create(:waiver,date_of_birth:12.years.ago)waiver.age.should==12end当我运行这个规范时,我得到Comparisono

ruby-on-rails - Rails 安装失败 : activesupport requires Ruby version >= 2. 2.2

我想创建一个新的Rails应用程序。我将rvm与ruby​​-2.1.2一起使用。我正在使用@globalgemset并计划使用bundler来管理gem依赖项。但是,geminstallrails失败了:$geminstallrailsFetching:concurrent-ruby-1.0.3.pre3.gem(100%)Successfullyinstalledconcurrent-ruby-1.0.3.pre3Fetching:minitest-5.9.0.gem(100%)Successfullyinstalledminitest-5.9.0Fetching:thread_s

ruby - RVM 拒绝安装 - curl SSL 证书验证失败

我正在处理一个相对干净的OSX安装。我有Xcode,但删除了它。当我输入rvminstall1.9.3时,我得到:max-macbook:~max$rvminstall1.9.3Fetchingyaml-0.1.4.tar.gzto/Users/max/.rvm/archives%Total%Received%XferdAverageSpeedTimeTimeTimeCurrentDloadUploadTotalSpentLeftSpeed00000000--:--:----:--:----:--:--0curl:(60)SSLcertificateproblem,verifythat

ruby - 使用 Bundler 从 Github 安装 gem

我正在尝试使用instructionshere使用bundler安装gem的预发布版本。“bundleinstall”输出列出了正在安装的gem,但“gemlist”找不到它。我的gem文件:source:gemcuttergem'sinatra','1.1.0',:git=>'http://github.com/sinatra/sinatra.git'gem'RedCloth','4.2.3'这是一个gist与我的示例代码的其余部分。有没有人让这个场景起作用?注意:我也在使用RVM(在OSX上)。bundleshow确实列出了现有的gem(和依赖项),但我无法正确解析它们。谢谢。