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