大家好,
我不确定这是否是一个正确的问题,但是在将我的 rails 项目中的 ruby 升级到 2.1.4 后,我不再能够通过rails s
、 rails c
运行该项目,或任何 rake 任务。 在 2.1.2 中一切正常。
这是我不断收到的错误:
$ rake db:drop db:create db:migrate
rake aborted!
LoadError: cannot load such file -- guard/guard
/Users/jonathan/code/sirius/config/application.rb:14:in `<top (required)>'
/Users/jonathan/code/sirius/Rakefile:4:in `<top (required)>'
LoadError: cannot load such file -- guard-spring
/Users/jonathan/code/sirius/config/application.rb:14:in `<top (required)>'
/Users/jonathan/code/sirius/Rakefile:4:in `<top (required)>'
(See full trace by running task with --trace)
我在 OSX 上,通过 rbenv 安装了 ruby。 我正在运行 Gemfile.lock 说守卫在 2.11.1。 对此问题的任何帮助表示赞赏。
1) 只需从您的 Gemfile 和 Guardfile 中移除保护弹簧。
2)然后升级guard-rspec(运行bundle update guard-rspec
)
3)设置guard-rspec使用spring(见:https://github.com/guard/guard-rspec#options)
解释:
guard-spring 没有更新以与较新版本的 Guard 一起使用,但它甚至不再需要,因为 guard-rspec 支持 spring。
谢谢! 之后一切都恢复正常。
谢谢,它工作
不工作。 我在 Gemfile 和 Guardfile 中没有保护弹簧。 步骤 2、3 无济于事
@ElminDmitry - 你的问题可能不同。 如果您在消息中有“guard/guard”,您可能使用了一些过时的 Guard 插件。
改用“bundle exec rake (...)” - 它可能有助于找到原因。
如果可以,请打开一个新问题,粘贴您的 Gemfile 和 Gemfile.lock(或至少bundle show
输出)。
或者,您可以尝试运行guard -d
- 那里的任何错误也可能有所帮助。
添加和安装 gem 'guard-spork' gem 'childprocess' 后出现问题
据我所知,Guard-spork 已过时,因此请将其移除和/或使用guard-zeus 或弹簧。
感谢帮助
对我来说已经过时的那个是警卫式的。
我对遗留代码库有类似的问题。 以下是对我有用的版本,可以克服缺少的守卫/守卫要求。
group :development do
gem 'guard-rails', '0.7.2', require: false
gem 'guard-rspec', '3.1.0', require: false
gem 'guard-rubocop', '1.2.0', require: false
gem 'guard-spork', '2.1.0', require: false
end
今天在这里也一样。 在bundle update
给了我 rspec 3.5 beta3 之后,我不得不将 rspec 固定到' ~> 3.4.0'
来解决它。
我刚刚更新了守护宝石版本,它很神奇
任何使用guard-konacha
的人,它似乎不再适用于任何人也得到
LoadError: cannot load such file -- guard/guard
@tastycakeman guard-konacha
gem 依赖于 Guard 版本 1。将您的 gemfile 更改为gem 'guard-konacha', github: 'lbeder/guard-konacha'
,它具有更新的 gemspec 以支持更新版本的 Guard。
运行 rake db:create 时出现以下错误:
`耙子中止了!
LoadError: 无法加载此类文件 -- 守卫/守卫
/Users/macbookpro06/.rvm/gems/ruby-2.0. 0-p247@oohmp-v2/gems/activesupport-3.2.12/lib/active_support/dependencies.rb :251:in require'
/Users/macbookpro06/.rvm/gems/ruby-2.0.0-p247@oohmp-v2/gems/activesupport-3.2.12/lib/active_support/dependencies.rb:251:in
block in require'
/Users/macbookpro06/.rvm/gems/ruby-2.0. 0-p247@oohmp-v2/gems/activesupport-3.2.12/lib/active_support/dependencies.rb :236:in load_dependency'
/Users/macbookpro06/.rvm/gems/ruby-2.0.0-p247@oohmp-v2/gems/activesupport-3.2.12/lib/active_support/dependencies.rb:251:in
要求'
/Users/macbookpro06/.rvm/gems/ruby-2.0. 0-p247@oohmp-v2/gems/guard-migrate-1.0.4/lib/guard/migrate.rb :2:in <top (required)>'
/Users/macbookpro06/.rvm/gems/ruby-2.0.0-p247@oohmp-v2/gems/bundler-1.16.0/lib/bundler/runtime.rb:95:in
要求'
/Users/macbookpro06/.rvm/gems/ruby-2.0. 0-p247@oohmp-v2/gems/bundler-1.16.0/lib/bundler/runtime.rb :95:in rescue in block in require'
/Users/macbookpro06/.rvm/gems/ruby-2.0.0-p247@oohmp-v2/gems/bundler-1.16.0/lib/bundler/runtime.rb:72:in
block in require'
/Users/macbookpro06/.rvm/gems/ruby-2.0. 0-p247@oohmp-v2/gems/bundler-1.16.0/lib/bundler/runtime.rb :65:in each'
/Users/macbookpro06/.rvm/gems/ruby-2.0.0-p247@oohmp-v2/gems/bundler-1.16.0/lib/bundler/runtime.rb:65:in
要求'
/Users/macbookpro06/.rvm/gems/ruby-2.0. 0-p247@oohmp-v2/gems/bundler-1.16.0/lib/bundler.rb :114:in require'
/Users/macbookpro06/Desktop/projects/pradeep/ashley/oohmpv2/config/application.rb:7:in
require'
/Users/macbookpro06/Desktop/projects/pradeep/ashley/oohmpv2/Rakefile:5:in
<top (required)>'
/Users/macbookpro06/.rvm/gems/ruby-2.0.0-p247@oohmp-v2/bin/ruby_executable_hooks:15:in
eval'
/Users/macbookpro06/.rvm/gems/ruby-2.0. 0-p247@oohmp-v2/bin/ruby_executable_hooks :15:in <main>'
(See full trace by running task with --trace)
我是 ruby 的新手,但现在已经 3 天了,无法让它在 Windows 上运行。 我的错误:
耙分贝:创建
耙中止!
LoadError: 无法加载此类文件 -- /mnt/c/code/myapp/config/application
/mnt/c/code/myapp/ rakefile:4 :in require_relative'
/mnt/c/code/myapp/rakefile:4:in
最有用的评论
我刚刚更新了守护宝石版本,它很神奇