Tag: 后卫

Guard Rspec:不推荐使用cli选项,更改为:cmd选项

在我的rails应用程序中使用Guardfile guard ‘rspec’, all_after_pass: false, cli: ‘–drb’ do 不工作Guardfile guard ‘rspec’, all_after_pass: false, cmd: ‘–drb’ do 我已经多次打开了bundle exec guard ,但我发现即使我收到此消息Guard::RSpec DEPRECATION WARNING: The :cli option is deprecated. Please customize the new :cmd option to fit your need. Guard::RSpec DEPRECATION WARNING: The :cli option is deprecated. Please customize the new :cmd option to fit your need. […]

LiveReload不工作Guard(火狐)

我有一个有趣的问题,我有LiveReload在Chrome中工作,所以我知道它安装正确,但我不能为我的生活让它在Firefox 9.0.1上运行。 我激活了我网站上的图标,它只是保持红色,我的守卫终端显示以下症状。 Browser connected. Browser URL: {“command”:”hello”,”protocols”:[“http://livereload.com/protocols/connection-check-1”]} Browser disconnected. 这是我的警卫档案。 guard ‘livereload’ do watch(%r{app/.+\.(erb|haml)}) watch(%r{app/helpers/.+\.rb}) watch(%r{(public/|app/assets).+\.(css|js|html)}) watch(%r{(app/assets/.+\.css)\.s[ac]ss}) { |m| m[1] } watch(%r{(app/assets/.+\.js)\.coffee}) { |m| m[1] } watch(%r{config/locales/.+\.yml}) end 我做了一些关于这个主题的研究,我所能找到的只是报告问题的人,然后报告它刚刚清理完毕,没有任何开发人员的解释。 有趣!

当试图运行rspec时,我得到“未初始化的常量ActiveModel”

当我运行rspec spec我得到以下内容: /usr/local/lib/ruby/gems/1.9.1/gems/rspec-rails-2.7.0/lib/rspec/rails/extensions/active_record/base.rb:26:in`’:ininitialized constant ActiveModel(NameError ) 来自/usr/local/lib/ruby/gems/1.9.1/gems/rspec-rails-2.7.0/lib/rspec/rails/extensions.rb:1:in`requiren’ 来自/usr/local/lib/ruby/gems/1.9.1/gems/rspec-rails-2.7.0/lib/rspec/rails/extensions.rb:1:in` 来自/usr/local/lib/ruby/gems/1.9.1/gems/rspec-rails-2.7.0/lib/rspec/rails.rb:8:in,requirement 来自/usr/local/lib/ruby/gems/1.9.1/gems/rspec-rails-2.7.0/lib/rspec/rails.rb:8:in` 来自/Users/noahc/Dropbox/perfect_setup/spec/spec_helper.rb:4:in`requirement’ 来自/Users/noahc/Dropbox/perfect_setup/spec/spec_helper.rb:4:in`’ 来自/Users/noahc/Dropbox/perfect_setup/spec/controllers/pages_controller_spec.rb:1:in`requirent’ 来自/Users/noahc/Dropbox/perfect_setup/spec/controllers/pages_controller_spec.rb:1:in` 来自/usr/local/lib/ruby/gems/1.9.1/gems/rspec-core-2.7.1/lib/rspec/core/configuration.rb:459:in”load’ 来自/usr/local/lib/ruby/gems/1.9.1/gems/rspec-core-2.7.1/lib/rspec/core/configuration.rb:459:in”load_spec_files中的块’ 来自/usr/local/lib/ruby/gems/1.9.1/gems/rspec-core-2.7.1/lib/rspec/core/configuration.rb:459:in`map’ 来自/usr/local/lib/ruby/gems/1.9.1/gems/rspec-core-2.7.1/lib/rspec/core/configuration.rb:459:in,load_spec_files’ 来自/usr/local/lib/ruby/gems/1.9.1/gems/rspec-core-2.7.1/lib/rspec/core/command_line.rb:18:in“run” 来自/usr/local/lib/ruby/gems/1.9.1/gems/rspec-core-2.7.1/lib/rspec/core/runner.rb:80:in“run_in_process” 来自/usr/local/lib/ruby/gems/1.9.1/gems/rspec-core-2.7.1/lib/rspec/core/runner.rb:69:in“run” 来自/usr/local/lib/ruby/gems/1.9.1/gems/rspec-core-2.7.1/lib/rspec/core/runner.rb:10:in,clock in autorun’ 我的spec_helper.rb看起来像这样: ENV[“RAILS_ENV”] ||= ‘test’ require ‘spec_helper’ require ‘rspec/rails’ require ‘rspec/autorun’ require ‘spork’ Spork.prefork do ENV[‘RAILS_ENV’] ||= ‘test’ require File.expand_path(‘../../config/environment’, __FILE__) require ‘rspec/rails’ RSpec.configure do |config| config.mock_with :rspec config.fixture_path = “#{Rails.root}/spec/fixtures” config.use_transactional_fixtures […]

Ruby Guard问题 – ‘请安装sqlite3适配器’ – railstutorial.org

我正在关注Ruby on Rails教程并且在测试部分中有些困惑,特别是 – 3.6.2 – 使用Guard进行自动测试 根据教程的部署到Heroku的说明,我已切换到Postgresql并从我的gemfile中删除了sqlite3并进行了一个bundle install以进行更新。 但是,一旦我跑了 捆绑执行警卫 我收到的消息是: /Users/username/.rvm/gems/ruby-1.9.3-p125@global/gems/bundler-1.1.3/lib/bundler/rubygems_integration.rb:147:in block in replace_gem’: Please install the sqlite3 adapter: gem install activerecord-sqlite3-adapter`(sqlite3不是bundle的一部分。将它添加到Gemfile。)(LoadError) 我很困惑为什么我需要这个,因为sqlite3已从我的环境中删除? 我的Gemfile如下: source ‘https://rubygems.org’ gem ‘rails’, ‘3.2.3’ gem ‘pg’, ‘0.12.2’ group :development, :test do gem ‘rspec-rails’, ‘2.9.0’ gem ‘guard-rspec’, ‘0.5.5’ end # Gems used only for assets and not required # […]