jjzjj

is_loading

全部标签

ruby - Homebrew 软件损坏 - "cannot load such file -- vendor/bundle/bundler/setup (LoadError)"

每次我尝试运行brew命令时,都会出现以下错误:/usr/local/Homebrew/Library/Homebrew/vendor/portable-ruby/2.3.7/lib/ruby/2.3.0/rubygems/core_ext/kernel_require.rb:55:in`require':cannotloadsuchfile--vendor/bundle/bundler/setup(LoadError)from/usr/local/Homebrew/Library/Homebrew/vendor/portable-ruby/2.3.7/lib/ruby/2.3.0/r

ruby-on-rails - rails 引擎 : rake routes show its routes but on rspec execution "No route matches" is thrown

我正在尝试测试我的应用程序正在使用的引擎内部的Controller。规范不在引擎中,而是在应用程序本身中(我试图在引擎中进行测试,但也遇到了问题)。我的引擎有以下routes.rb:Revision::Engine.routes.drawdoresources:steps,only:[]docollection{get:first}endend引擎正常挂载在应用routes.rb上:mountRevision::Engine=>"revision"当我运行rakeroutes时,在最后一行我得到:RoutesforRevision::Engine:first_stepsGET/step

ruby-on-rails - Ruby BigDecimal 圆 : Is this an error?

在用一个表示为BigDecimal的值编写测试时,我遇到了一些奇怪的事情并决定深入研究它。简而言之,四舍五入到小数点后两位的“0.00009”返回为0.01而不是0.00。真的。这是我的脚本/控制台捕获:>>bp=BigDecimal('0.09')=>#>>bp.round(2,BigDecimal::ROUND_HALF_DOWN).to_f=>0.09>>bp=BigDecimal('0.009')=>#>>bp.round(2,BigDecimal::ROUND_HALF_DOWN).to_f=>0.01>>bp=BigDecimal('0.0009')=>#>>bp.roun

ruby - Chef : cannot load such file -- moneta/basic_file

我正在运行一个我以前使用过无数次的Recipe,当我用chef+knife启动一个新的EC2实例时,我遇到了这些错误。[2013-01-30T23:44:48+00:00]INFO:Processinguser[dan]actioncreate(/var/chef/cache/cookbooks/users/providers/manage.rbline65)[2013-01-30T23:44:48+00:00]INFO:user[dan]created[2013-01-30T23:44:48+00:00]INFO:Processingdirectory[/home/dan/.ssh]

ruby - "Assignment Branch Condition size for index is too high"是如何工作的?

Rubocop总是报告错误:app/controllers/account_controller.rb:5:3:C:AssignmentBranchConditionsizeforindexistoohigh.[30.95/24]ifparams[:role]@users=@search.result.where(:role=>params[:role])elsifparams[:q]&¶ms[:q][:s].include?('count')@users=@search.result.order(params[:q][:s])else@users=@search.result

ruby-on-rails - "gem update --system is disabled on Debian"错误

当我尝试更新ruby​​gems(通过运行“gemupdate--system”)时出现此错误:ERROR:Whileexecutinggem...(RuntimeError)gemupdate--systemisdisabledonDebian.RubyGemscanbeupdatedusingtheofficialDebianrepositoriesbyaptitudeorapt-get.知道可能出了什么问题以及如何解决它吗? 最佳答案 有两种方法:摆脱debianruby​​包并从源代码安装ruby​​,或者您可以按照给您的说

ruby-on-rails - YAML::load 引发未定义的类/模块错误

我正在我的Rails应用程序中实现类似文件跟踪的功能。为此,我在YAML中序列化对象。我有item_at_version方法,它基本上执行YAML::load(cached_object)–这工作得很好,但是,我不知道为什么,有时它返回未定义的类/模块_类名_。它适用于Event、Conversation、Note等模型,但没有任何理由,它似乎会为Dataset、Comment、Student等模型抛出该错误(我试图找到任何模式,但没有任何运气).我正在使用rails3.2.8、ruby1.9.3p327、psych作为YAML引擎(Psych::Version返回1.3.4)。附言。

ruby-on-rails - 如何将条件 "IS NOT NULL"添加到 Thinking Sphinx 搜索中

我正在使用ThinkingSphinx进行全文搜索,关注thisvideo.我想做以下事情:@articles=Article.search(params[:search],:conditions=>"published_atISNOTNULL",:order=>:created_at)问题是这行不通。搜索方法似乎只接受散列条件。我尝试了几种方法,但我对如何将“published_atISNOTNULL”表示为哈希一无所知... 最佳答案 在Railscasts给出了解决方案Ifyouwant*all*resultsforthatm

ruby - kernel_require.rb :55:in `require' : cannot load such file error

我目前使用的是Ruby1.9.3版(尽管我在使用Ruby2.0.0时遇到了同样的问题)。在Windows764位上。我正在关注“TheCucumberBook”并卡在第7.2章-“使用转换删除重复项”。我的文件夹结构如下:\cash_withdrawal\cash_withdrawal\Gemfile\cash_withdrawal\Gemfile.lock\cash_withdrawal\features\cash_withdrawal\features\cash-withdrawal.feature\cash_withdrawal\features\step_definitions

ruby-on-rails - Need Advice : Is this a good use case for a 'NoSQL' Database? 如果有,是哪一个?

我最近一直在研究NoSql选项。我的场景如下:我们从位于世界各地偏远地区的定制硬件收集和存储数据。我们每15分钟记录一次来自每个站点的数据。我们最终希望每1分钟移动一次。每条记录有20到200个测量值。一旦设置好硬件,每次都会记录和报告相同的测量值。我们面临的最大问题是我们从每个项目中获得了一组不同的衡量标准。我们测量大约50-100种不同的测量类型,但是任何项目都可以有任意数量的每种测量类型。没有可以容纳数据的预设列集。因此,当我们在系统上设置和配置项目时,我们创建并构建了每个项目数据表,其中包含所需的确切列。我们提供工具来帮助分析数据。这通常包括更多的计算和数据聚合,其中一些我们也