我有Sublime Text 3与rubocop和sublimelinter一起工作。但是,当我启用rubocop-rspec时:
# .rubocop.yml
require: rubocop-rspec除非我用以下命令运行rubocop,否则rubocop在终端的命令行上会失败:
bundle exec rubocop然而,我无法在Sublime中很好地使用rubocop-rspec,我在Sublime控制台中看到了这一点,并启用了debug:
SublimeLinter: rubocop output:
/Users/sean/.rbenv/versions/2.2.3/lib/ruby/site_ruby/2.2.0/rubygems/core_ext/kernel_require.rb:55:in `require': cannot load such file -- /Users/sean/Dropbox/Sean/Sites/tovgdb/rubocop-rspec (LoadError)有没有办法让sublimelinter把bundle exec放在rubocop命令之前?
发布于 2016-03-12 08:57:21
我发现这是rubocop gem的一个已知问题:0.38 fails to load rubocop-rspec #2937
我暂时注释掉了导致问题的代码,并放回了gem的早期版本中的代码:
# ~/.rbenv/versions/2.2.3/lib/ruby/gems/2.2.0/gems/rubocop-0.38.0/lib/rubocop/config_loader.rb
# Temporary Code copied from earlier version of gem:
Array(hash.delete('require')).each { |r| require(r) }
# Code Commented Out:
# config_dir = File.dirname(path)
# Array(hash.delete('require')).each do |r|
# require(File.join(config_dir, r))
# endhttps://stackoverflow.com/questions/35949218
复制相似问题