marick / Midje

Midje provides a migration path from clojure.test to a more flexible, readable, abstract, and gracious style of testing
MIT License
1.69k stars 129 forks source link

error during initialization: "Cannot open load file, slime" #79

Closed gw666 closed 12 years ago

gw666 commented 12 years ago

I'm on emacs24 on Mac OS, got this error (caused somehow by midje-mode) on booting Emacs:

Warning (initialization): An error occurred while loading `/Users/gw/.emacs.d/init.el':

File error: Cannot open load file, slime

To ensure normal operation, you should investigate and remove the
cause of the error in your initialization file.  Start Emacs with
the `--debug-init' option to view a complete error backtrace.

Because of the way Emacs.app is packaged, I can't run it with the --debug-init option, but I can C-x C-e successive statements of my .emacs.d/init.el file (appended at the end of this message). When I did this for (require 'midje-mode), I got the following:

Debugger entered--Lisp error: (file-error "Cannot open load file" "slime")
  require(slime)
  eval-buffer(#<buffer  *load*> nil "/Users/gw/.emacs.d/elpa/midje-mode-0.1.0/midje-mode.el" nil t)  ; Reading at buffer position 275
  load-with-code-conversion("/Users/gw/.emacs.d/elpa/midje-mode-0.1.0/midje-mode.el" "/Users/gw/.emacs.d/elpa/midje-mode-0.1.0/midje-mode.el" nil t)
  require(midje-mode)
  eval((require (quote midje-mode)) nil)
  eval-last-sexp-1(nil)
  eval-last-sexp(nil)
  call-interactively(eval-last-sexp nil nil)

I tried adding a slime.el file that I got off github, but that just made the error different (I admit, this was a "wave a dead chicken" gambit,but sometimes, they work.) Again, here is the result of evaluating (require 'midje-mode):

Debugger entered--Lisp error: (void-variable <!DOCTYPE)
  eval-buffer(#<buffer  *load*<2>> nil "/Users/gw/.emacs.d/gw-site-lisp/slime.el" nil t)  ; Reading at buffer position 13
  load-with-code-conversion("/Users/gw/.emacs.d/gw-site-lisp/slime.el" "/Users/gw/.emacs.d/gw-site-lisp/slime.el" nil t)
  require(slime)
  eval-buffer(#<buffer  *load*> nil "/Users/gw/.emacs.d/elpa/midje-mode-0.1.0/midje-mode.el" nil t)  ; Reading at buffer position 275
  load-with-code-conversion("/Users/gw/.emacs.d/elpa/midje-mode-0.1.0/midje-mode.el" "/Users/gw/.emacs.d/elpa/midje-mode-0.1.0/midje-mode.el" nil t)
  require(midje-mode)
  eval((require (quote midje-mode)) nil)
  eval-last-sexp-1(nil)
  eval-last-sexp(nil)
  call-interactively(eval-last-sexp nil nil)

Any ideas why midje-mode doesn't work for me? Does it have anything to do with the fact that I'm using Emacs 24? Thanks. (init.el follows)

=== begin init.el ===

;; from https://github.com/technomancy/clojure-mode

;; add to ~/.emacs.d/init.el if you aren't already using Marmalade.
(require 'package)
(add-to-list 'package-archives
             '("marmalade" . "http://marmalade-repo.org/packages/"))
(package-initialize)

;=====================================================================
;; GW customizations

(show-paren-mode 1) ;shows matching parens automatically
(delete-selection-mode 1) ; txt operations (e.g., paste) delete seleted text
(recentf-mode 1)  ;show recent files in menu

; created my own directory for .el files to be loaded
; (setq load-path (append load-path (list "/Users/gw/.emacs.d/gw-site-lisp")))

;======================================================================

; from https://github.com/marick/Midje/wiki/Midje-mode README.md

(require 'clojure-mode)
(add-to-list 'auto-mode-alist '("\\.clj$" . clojure-mode))
(require 'midje-mode)
(require 'clojure-jump-to-file)

=== end ===

marick commented 12 years ago

Is this the same as the closed https://github.com/dnaumov/midje-mode/issues/8 ?

gw666 commented 12 years ago

Yes. Many apologies--I must have posted in midje-mode by mistake. But the answer there helped.

BTW, many thanks for midje and midje-mode. midje-mode is especially helpful for interactive testing, since lein midje classname executes so slowly for me.

marick commented 12 years ago

I'm glad you're finding it helpful.

AlexBaranosky commented 12 years ago

@gw666 another thing you can try is lein int then midje from within the interactive leiningen shell.