gpt4 book ai didi

ruby-on-rails-3 - guard 队给 "uninitialized constant Listen::Turnstile (NameError)"错误

转载 作者:行者123 更新时间:2023-12-04 04:30:21 24 4
gpt4 key购买 nike

我在尝试运行命令时遇到此错误:

guard

这是我在尝试安装Guard之前已经开发了一段时间的应用程序...

我正在遵循Ryan Bates关于 guard 的教程中的说明:

http://railscasts.com/episodes/264-guard

这是我的 gem 文件。
source 'https://rubygems.org'

gem 'rails', '3.2.14'
gem 'rake'
gem 'mysql2'
gem 'bcrypt-ruby'
gem 'devise'
gem 'rails_admin'
gem 'jbuilder'
gem 'gon'
gem 'dynamic_form'
gem 'therubyracer', :require => 'v8'
gem 'jquery-rails'
gem 'jquery-ui-rails'
gem 'rails3-jquery-autocomplete'
gem 'roo'

group :assets do
gem 'sass-rails', '~> 3.2.4'
gem 'coffee-script', '~> 2.2.0'
gem 'uglifier', '~> 1.2.3'
end

group :development, :test do
gem 'capistrano'
gem 'bullet'
gem 'rvm-capistrano'
gem 'better_errors'
gem 'rspec-rails', '2.10.0'
gem 'awesome_print'
gem 'wirble'
gem 'thin'
gem 'guard-rspec'
gem 'rb-fsevent', :require => false if RUBY_PLATFORM =~ /darwin/i
end

group :test do
gem 'capybara', '1.1.2'
gem 'faker'
gem 'factory_girl_rails'
gem 'spork', '~> 1.0rc'
end

这是完整的错误:
app3 git:(write-tests) ✗ guard
/Users/Nick/.rvm/gems/ruby-1.9.3-p448/gems/guard-1.4.0/lib/guard.rb:47:in `setup': uninitialized constant Listen::Turnstile (NameError)
from /Users/Nick/.rvm/gems/ruby-1.9.3-p448/gems/guard-1.4.0/lib/guard.rb:155:in `start'
from /Users/Nick/.rvm/gems/ruby-1.9.3-p448/gems/guard-1.4.0/lib/guard/cli.rb:104:in `start'
from /Users/Nick/.rvm/gems/ruby-1.9.3-p448/gems/thor-0.18.1/lib/thor/command.rb:27:in `run'
from /Users/Nick/.rvm/gems/ruby-1.9.3-p448/gems/thor-0.18.1/lib/thor/invocation.rb:120:in `invoke_command'
from /Users/Nick/.rvm/gems/ruby-1.9.3-p448/gems/thor-0.18.1/lib/thor.rb:363:in `dispatch'
from /Users/Nick/.rvm/gems/ruby-1.9.3-p448/gems/thor-0.18.1/lib/thor/base.rb:439:in `start'
from /Users/Nick/.rvm/gems/ruby-1.9.3-p448/gems/guard-1.4.0/bin/guard:6:in `<top (required)>'
from /Users/Nick/.rvm/gems/ruby-1.9.3-p448/bin/guard:23:in `load'
from /Users/Nick/.rvm/gems/ruby-1.9.3-p448/bin/guard:23:in `<main>'
from /Users/Nick/.rvm/gems/ruby-1.9.3-p448/bin/ruby_noexec_wrapper:14:in `eval'
from /Users/Nick/.rvm/gems/ruby-1.9.3-p448/bin/ruby_noexec_wrapper:14:in `<main>'

最佳答案

我在Rails 3.2.13应用程序中遇到了类似的问题。

令人困惑的部分是我的Gemfile中没有gem 'guard',但是gem显然是以下项的依赖项:

gem 'guard-rspec'
gem 'guard-livereload'
gem 'guard-cucumber'

一切工作一直持续到最近的 bundle update为止,后者引入了更高版本的 listen,这是 guard的依赖项之一,而 guard本身却受阻(不确定原因)。因此,您看到的错误是 guard试图调用 listen中不再存在的类。

通过将当前版本的 guard显式添加到 Gemfile中,解决了该问题:
gem 'guard', '>=2.1.0'

并且当然会重新捆绑。

关于ruby-on-rails-3 - guard 队给 "uninitialized constant Listen::Turnstile (NameError)"错误,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/19322183/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com