2

当我尝试对任何给定的 Ruby 文件运行规范测试时,我在 Emacs 中遇到了这个错误。我的 gem 以标准方式设置,模块和类lib/spec/. 我的.emacs文件有以下条目:

;; 红宝石的东西

(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)
4

1 回答 1

2

rspec-mode在第 435 行的变量中使用编译--ensure-parse 。rspec-compilation-mode-font-lock-keywords该功能compilation--ensure-parse是在 Emacs 24.1 中引入的,因此推测 rspec-mode 不能保证在早期的 Emacs 版本上工作。

于 2013-04-23T13:02:04.173 回答