ELPA / Marmalade为〜/ .emacs.d / elpa / archives / -pkg报告“无法打开加载文件”

时间:2011-11-17 03:00:37

标签: emacs marmalade elpa

我安装了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

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

5 个答案:

答案 0 :(得分:13)

易。无论出于何种原因,您现在使用的package.el是来自http://tromey.com/elpa/package.el的“经典”版本。它与最近版本的package.el非常不兼容。我不知道你是如何设法使用该版本安装Marmalade软件包的;安装这些软件包时,您必须拥有不同版本的package.el,可能是因为您当时使用的是较新的Emacs。

修复方法是使用与您的Emacs捆绑在一起的版本(如果它足够新的话),或者用this version取代~/.emacs.d/elpa/package.el,如Marmalade instructions中所述

答案 1 :(得分:5)

我在试图解决类似的问题时偶然发现了这个问题。在我的情况下,强制package-initialize解决了问题:

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

即使我没有阅读package.el的源代码,我相信package.el中的某种 laziness 正在解决问题。虽然这是一个古老的问题,但我想回答,以防其他人需要帮助。

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

答案 2 :(得分:1)

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

答案 3 :(得分:0)

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

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

答案 4 :(得分: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))