【问题标题】:cannot load such file -- guard/rspec/dsl无法加载此类文件 --guard/rspec/dsl
【发布时间】: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


    【解决方案1】:

    我有类似的问题,但我有 Ubuntu Linux,不知道 Windows。 我只是更新到最新版本,您可以在相应的存储库中找到它: guard-rspec 但在你的情况下,这似乎是不可能的。 如果你有 Windows 10,你可以使用 Linux beta environment

    我希望我在 Stackoverflow 中的第一个答案仍然对您和/或其他人有用:)。

    干杯!

    托尼奥

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 2015-07-18
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2018-03-06
      • 2017-12-06
      • 1970-01-01
      相关资源
      最近更新 更多