当我尝试为任何给定的Ruby文件运行规范测试时,我在Emacs中收到此错误。我的gem以标准方式设置,lib/
中的模块和类,spec/
中的规范测试。我的.emacs
文件包含以下条目:
;; Ruby的东西
(add-to-list 'load-path "~/.emacs.d/plugins/rvm.el")
(require 'rvm)
(autoload 'ruby-mode "ruby-mode"
"Mode for editing ruby files" t)
(setq interpreter-mode-alist
(append '(("ruby" . ruby-mode))
interpreter-mode-alist))
(autoload 'run-ruby "inf-ruby"
"Run an inferior Ruby process (irb)" t)
(autoload 'inf-ruby-keys "inf-ruby"
"Set local key bindings for inf-ruby in ruby-mode")
(add-to-list 'auto-mode-alist '("\\.rake$" . ruby-mode))
(add-to-list 'auto-mode-alist '("\\.gemspec$" . ruby-mode))
(add-to-list 'auto-mode-alist '("\\.rake$" . ruby-mode))
(add-to-list 'auto-mode-alist '("/[Rr]akefile$" . ruby-mode))
(add-to-list 'auto-mode-alist '("/Gemfile$" . ruby-mode))
(add-hook
'ruby-mode-hook
(lambda ()
(rvm-activate-corresponding-ruby)
(rspec-mode)))
(add-hook
'ruby-mode-hook
(lambda ()
(set (make-local-variable 'compile-command)
"bundle exec rake")
(define-key ruby-mode-map "\C-c\C-b" 'compile) ; "Build and Test"
)
)
;; RSpec
(add-to-list 'load-path "~/.emacs.d/plugins/rspec-mode")
(require 'rspec-mode)
;; Cucumber
(add-to-list 'load-path "~/.emacs.d/feature-mode-0.4")
(require 'feature-mode)
;; Rinari
(add-to-list 'load-path "~/.emacs.d/plugins/rinari")
(require 'rinari)
;; rails reloaded plugin
(add-to-list 'load-path "~/.emacs.d/plugins/rails-reloaded")
(require 'rails-autoload)
答案 0 :(得分:2)
rspec-compilation-mode-font-lock-keywords
变量中的 rspec-mode uses compilation--ensure-parse on line 435。函数compilation--ensure-parse
是在Emacs 24.1中引入的,因此可能不保证rspec-mode可以在早期的Emacs版本上运行。