I use the same configuration of emacs on multiple machines, and I want to use use-package to keep the packages the same on all machines. I have an init file in each machine's home directory that looks like this:
;;Set the custom file to Dropbox .emacscommon
(setq custom-file "~/Dropbox/.emacs.d/.emacscommon")
;;These are commands that should be common across systems.
(load "~/Dropbox/.emacs.d/.emacscommon")
And the beginning of .emacscommon has these lines:
;;; -*- mode: Emacs-Lisp; -*-
(eval-when-compile
(require 'use-package))
(require 'use-package-ensure)
(setq use-package-always-ensure t)
(use-package auto-package-update
:config
(setq auto-package-update-delete-old-versions t)
(setq auto-package-update-hide-results t)
(auto-package-update-maybe))
When I start up Emacs, though, I get the following error.
Warning (initialization): An error occurred while loading ‘/Users/basil/.emacs’:
File is missing: Cannot open load file, No such file or directory, use-package
Checking the value of "load-path" via "describe-variable" gives a long list which includes "/Users/basil/.emacs.d/elpa/use-package-20190405.2047", so use-package appears to be accessible. Why can't Emacs find it? If I omit the use-package lines from .emacscommon, all other packages work just fine.
.emacscommon
?