font-lock-fontify-keywords-region:符号的函数定义为void:compilation - ensure-parse

时间:2013-04-20 16:28:53

标签: ruby emacs

当我尝试为任何给定的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)

1 个答案:

答案 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版本上运行。