jjzjj

no_tasks

全部标签

ruby-on-rails - rspec - 我怎样才能让 "pendings"有我的文本而不仅仅是 "No reason given"

我有这个代码:context"Visitingtheusers#indexpage."dobefore(:each){visitusers_path}subject{page}pending('iii'){shouldhave_no_css('table#users')}pending{shouldhavecontent('Youhavereachedthispageduetoapermissionic错误')}它会导致几个待处理,例如ManagingUsersGivenapractitionerloggedin.Visitingtheusers#indexpage.#Noreason

ruby-on-rails - Rails - Carrierwave 进程抛出 ArgumentError : no images in this image list

在尝试实现应用auto_orient的过程之后!对于我的图片,我收到此错误:ArgumentError(noimagesinthisimagelist):app/uploaders/image_uploader.rb:36:in`fix_exif_rotation'app/controllers/posts_controller.rb:12:in`create'Carrierwave在没有进程的情况下工作正常,但在添加进程后尝试上传图像时抛出错误。流程如下:process:fix_exif_rotationdeffix_exif_rotationmanipulate!do|image|

ruby-on-rails - rails : Find tasks that were created on a certain day?

我有一个任务列表(名称、starts_at),我试图在每日View中显示它们(就像iCal)。deftodays_tasks(day)Task.find(:all,:conditions=>["starts_atbetween?and?",day.beginning,day.ending]end我不知道如何将Time.now(例如“2009-04-1210:00:00”)动态转换为一天的开始(和结束),以便进行比较。 最佳答案 deftodays_tasks(now=Time.now)Task.find(:all,:conditio

ruby-on-rails - Rails 'rake task' 使用 nohup 在 ‘RAILS_ENV=production' 中执行

我有rake任务需要持续激活。每当我通过命令运行它时RAILS_ENV=productionrakejobs:abc它工作正常,但是当我关闭终端时rake作业停止了。所以我通过使用nohup在后台运行它找到了其他解决方案。我执行命令:nohupRAILS_ENV=productionrakejobs:work&但它给出了错误:nohup:failedtoruncommand‘RAILS_ENV=production’:Nosuchfileordirectory请建议在生产环境中执行rake任务。 最佳答案 在nohup命令之前设置环

ruby-on-rails - Grunt task Compass 失败——找不到 RubyGem compass (>= 0)

我最近将机器从iMac转移到带有Mavericks的新MacBookPro。一切都很好,但我注意到当我保存文件时Grunt崩溃了(自动更新不工作)。我试图更新我的系统,但是当我通过终端运行我的grunt任务时,我收到以下错误:Running"compass:dev"(compass)task/System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/lib/ruby/1.8/rubygems.rb:777:in`report_activate_error':CouldnotfindRubyGemcompass(>=0)(Gem:

Ruby gem 安装和 "No such file to load"

我在Backtrack5中使用Ruby1.9.2dev编写脚本,但在尝试使用库“htmlentities”解析html实体时遇到了一些问题。虽然我已经用gem安装了它,但我无法加载它。我将向您展示我在控制台中遇到的问题:root@bt:~#gemlist-dhtmlentities***LOCALGEMS***htmlentities(4.3.1)Author:PaulBattleyHomepage:https://github.com/threedaymonk/htmlentitiesInstalledat:/var/lib/gems/1.9.2Amoduleforencodinga

ruby - 杰基尔服务错误 : no implicit conversion of nil into String

我用这个错误搜索了jekyll。jekyll处理页面时似乎出现了ruby​​错误,但我根本不了解ruby​​。杰基尔版本1.3.1我什至重新安装了ruby​​和jekyll,但结果没有改变。更新:在我将jekyll从1.31降级到1.20后,这个错误消失了注意:我的网站是用jekyll1.20创建的,所以它不能用1.3.1构建?这是核心问题吗?E:\GitHub\sample>jekyll服务--trace:Configurationfile:E:/GitHub/sample/_config.ymlSource:E:/GitHub/sampleDestination:E:/GitHub

ruby-on-rails - Rake Task 特定类(class)在哪里生活? ( rails 3)

我有几个类仅由rake任务使用。我意识到rake任务通常存在于@lib/tasks/whatever.rake但我应该在哪里放置支持类?谢谢! 最佳答案 $RAILS_ROOT/lib或$RAILS_ROOT/lib/special_task/可能是最好的,因为它在默认加载路径中,您可以做一个简单的分别需要'my_task_helper'或require'special_task/helper'。 关于ruby-on-rails-RakeTask特定类(class)在哪里生活?(rail

ruby - 无法启动 sinatra 进程 - eventmachine "no acceptor"

我有一个作为守护程序运行的Sinatra应用程序,使用Apache端口转发在端口80和端口7655之间进行调解。这在过去一直运行良好。今天,不太好。我不明白为什么。问题:sudoruby​​my_process.rb返回:/var/lib/gems/1.9.1/gems/eventmachine-1.0.0/lib/eventmachine.rb:526:in`start_tcp_server':noacceptor(portisinuseorrequiresrootprivileges)(RuntimeError)尝试过:更新所有系统包,更新所有gem。没有帮助(除了来自eventm

ruby - 为什么 Thor 具有 no_tasks 方法?

或者,更具体地说:我不能只使用私有(private)方法吗? 最佳答案 据我了解,Thor具有将方法标记为notasks的方法因为方法是任务的概念不同于方法的visibility的概念。.他们需要区分,因为他们从事不同的工作。类Thor的子类的每个方法(独立于其可见性)都被视为任务,除非它被明确标记为无任务。通过控制任务的可见性,您可以控制对该任务的访问,例如如果您将任务设为私有(private),则它不能被子类调用或直接被用户调用。访问控制不同于某事是否是任务。非任务的方法不能被Thor直接调用,它们不能有options.这里举个