7

我已经安装了 Marmalade 并下载了一些有趣的软件包。但是现在,当我启动 Emacs 时,我得到了这个错误:

Cannot open load file: c:/Documents and Settings/Carlos/Datos de programa/.emacs.d/elpa/archives/-pkg

如果我使用--debug-init,我会得到:

Debugger entered--Lisp error: (file-error "Cannot open load file" "c:/Documents and Settings/Carlos/Datos de programa/.emacs.d/elpa/archives/-pkg")
load("c:/Documents and Settings/Carlos/Datos de programa/.emacs.d/elpa/archives/-pkg" nil t)
(if (file-directory-p pkg-dir) (load (concat pkg-dir ... "-pkg") nil t))
(let ((pkg-dir ...)) (if (file-directory-p pkg-dir) (load ... nil t)))

package-load-descriptor("c:/Documents and Settings/Carlos/Datos de programa/.emacs.d/elpa/" "archives")
(lambda (name) (package-load-descriptor dir name))("archives")
mapc((lambda (name) (package-load-descriptor dir name)) ("anything-1.287" "anything-  complete-1.86" "anything-config-0.4.1" "archive-contents" "archive-contents~" "archives" "auto-indent-mode-0.35" "builtin-packages" "builtin-packages~" "clojure-mode-1.7.1" "clojurescript-mode-0.5" "coffee-mode-0.3.0" "color-file-completion-1.0.1" "color-theme-6.6.1" "color-theme-eclipse-0.0.2" "color-theme-github-0.0.3" "color-theme-railscasts-0.0.2" "color-theme-twilight-0.1" "css-mode-1.0" "drag-stuff-0.0.3" "evernote-mode-0.41" "find-file-in-project-2.0" "flymake-coffee-0.4" "flymake-haml-0.5" "flymake-ruby-0.4" "flymake-shell-0.5" "haml-mode-3.0.14" "highlight-parentheses-1.0.1" "html-script-src-0.0.2" "inf-ruby-2.1" "js-comint-0.0.1" "js2-mode-20090814" "lua-mode-20100617" "package.el" "package.el~" "project-local-variables-0.2" "ruby-compilation-0.7" "ruby-electric-1.1" "ruby-mode-1.1" "slime-20100404" "tabbar-2.0.1" "tabbar-ruler-0.2" "yasnippet-0.6.1" "yasnippet-bundle-0.6.1" "zenburn-1.8"))
(if (file-directory-p dir) (mapc (lambda ... ...) (directory-files dir nil "^[^.]")))
(lambda (dir) (if (file-directory-p dir) (mapc ... ...)))("c:/Documents and Settings/Carlos/Datos de programa/.emacs.d/elpa/")
mapc((lambda (dir) (if (file-directory-p dir) (mapc ... ...))) ("c:/Documents and Settings/Carlos/Datos de programa/.emacs.d/elpa/" "/usr/share/emacs/site-lisp/elpa/"))
package-load-all-descriptors()
package-initialize()
  (progn (package-initialize))
(if (load (expand-file-name "~/.emacs.d/elpa/package.el")) (progn (package-initialize)))
(when (load (expand-file-name "~/.emacs.d/elpa/package.el")) (package-initialize))
eval-buffer(#<buffer  *load*> nil "c:/Documents and Settings/Carlos/Datos de programa/.emacs" nil t)  ; Reading at buffer position 9019
load-with-code-conversion("c:/Documents and Settings/Carlos/Datos de programa/.emacs" "c:/Documents and Settings/Carlos/Datos de programa/.emacs" t t)
load("~/.emacs" t t)
#[nil "\205\264

该文件不存在。我试过用谷歌搜索这个问题,但没有找到任何东西。

4

5 回答 5

13

简单的。无论出于何种原因,package.el您现在使用的是来自http://tromey.com/elpa/package.el. 它与最新版本的package.el. 我不知道您是如何设法使用该版本安装 Marmalade 软件包的;您在安装这些软件包时一定有不同的版本package.el,可能是因为您当时使用的是较新的 Emacs。

修复方法是使用与 Emacs 捆绑在一起的版本(如果它足够新的话),或者~/.emacs.d/elpa/package.el这个版本替换你的版本,如Marmalade 说明中所述。

于 2011-11-17T13:00:03.167 回答
4

我在尝试解决类似问题时偶然发现了这个问题。就我而言,强制package-initialize已经解决了这个问题:

;; init.el
(require 'package)
(package-initialize)

尽管我没有阅读 的源代码,但我相信package.el 中的package.el某种懒惰是造成问题的原因。虽然这是一个老问题,但我想回答一下,以防其他人需要帮助。

有关 Emacs 启动的更多信息,请参阅http://www.gnu.org/software/emacs/manual/html_node/elisp/Startup-Summary.html

于 2013-03-19T10:51:30.437 回答
1

添加一个文件,而不是目录,使用touch ~/.emacs.d/elpa/archives/-pkg为我解决了它。

于 2013-03-08T22:42:00.193 回答
0

我认为如果您在以下位置手动创建目录,它可能会消失:

c:/Documents and Settings/Carlos/Datos de programa/.emacs.d/elpa/archives/-pkg
于 2011-11-17T07:49:10.513 回答
0

就我而言,我必须添加这个指令来告诉 emacs 在哪里可以找到所需的文件:

首先这一行

(add-to-list 'load-path "~/.emacs.d/")

以及所需的包...

(require 'package)
(add-to-list 'package-archives
             '("marmalade" . "http://marmalade-repo.org/packages/") t)
(package-initialize)

(when (not package-archive-contents)
  (package-refresh-contents))
于 2013-09-18T10:43:26.103 回答