【发布时间】:2016-08-25 18:31:39
【问题描述】:
我能够成功安装 rspec-rails 和 guard-rspec。我使用的是 windows,所以 rspec 的版本必须是旧的才能成功安装。
# Gemfile
group :development, :test do
# Call 'byebug' anywhere in the code to stop execution and get a debugger console
gem 'byebug', platform: :mri
gem 'postgresql'
gem 'rspec-rails', '2.8', :require => false #'2.8'
end
group :development do
gem 'web-console'
gem 'better_errors'
gem 'binding_of_caller'
gem 'ruby_dep', '1.4.0'
gem 'guard-rspec', require: false#'4.2.'
end
我运行了rails g rspec:install,spec-helper.rb 是在规范下生成的。虽然没有 rails-helper.rb。我也有 .rspec 文件。
运行guard init rspec后得到以下信息
10:56:04 - INFO - Writing new Guardfile to C:/Users/nidaa_bugis/Documents/Ruby practices/workspace/Testing/Guardfile
10:56:05 - INFO - rspec guard added to Guardfile, feel free to edit it
但是当我运行 bundle exec guard 时,我得到了这个错误
10:56:39 - INFO - Run 'gem install win32console' to use color on Windows
10:56:39 - ERROR - Invalid Guardfile, original error is:
> [#]
> [#] cannot load such file -- guard/rspec/dsl,
> [#] backtrace:
> [#] (dsl)> C
> [#] (dsl)> C
> [#] (dsl)> C
> [#] (dsl)> C
> [#] (dsl)> C
> [#] (dsl)> C
> [#] (dsl)> C
> [#] (dsl)> C
> [#] (dsl)> C
> [#] (dsl)> C
> [#] (dsl)> C
> [#] (dsl)> C
> [#] (dsl)> C
> [#] (dsl)> C
> [#] (dsl)> C
> [#] (dsl)> C
> [#] (dsl)> C
> [#] (dsl)> C
> [#] (dsl)> C
有人知道如何解决这个问题并最终在 windows 上运行 guard 和 rspec 吗?
【问题讨论】:
标签: ruby-on-rails-4 rspec-rails