simar
simar

Reputation: 1832

cannot open load file: /yasnippet

I receive this message every time I start emacs

Emacs 24.2
Win7 64 and Ubuntu 12.10
yasnippet 0.8.0 installed with package-list 

If there is a way to fix it ?

Upvotes: 2

Views: 2271

Answers (2)

Liwen
Liwen

Reputation: 937

yasnippet doesn't get initialised automatically when installed with elpa, which I find unconventional. You still need to add the yasnippet directory into your load-path.

Here is my set up in my .emacs

;; yasnippet
(add-to-list 'load-path "~/.emacs.d/elpa/yasnippet-0.8.0")
(require 'yasnippet)
(setq yas-snippet-dirs '("~/.emacs.d/elpa/yasnippet-0.8.0/snippets" "~/Dropbox/Applications/Customise/emacs/myyassnipets"))
(yas-global-mode 1)

Upvotes: 6

Chris Barrett
Chris Barrett

Reputation: 3385

This is the sort of message I would expect to see if you're calling load or load-file in your init.el with a bad path. Look for any uses of those functions and correct the path if you can.

If this is in code you control, you probably want to call (require 'yasnippet) instead of directly loading the file.

Upvotes: 1

Related Questions