Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Unable to install cider to emacs - package not found

Fresh install of Ubuntu 20.04 Added openjdk-11 and lein 2.9.3

$ sudo apt-add-repository ppa:kelleyk/emacs

Installed GNU Emacs 26.3 (build 2, x86_64-pc-linux-gnu, GTK+ Version 3.24.14) of 2020-03-26, modified by Debian

Tried the instructions on the cider Getting Started page

M-x package-refresh-contents
M-x package install <RET>
cider <RET>

The cider package isn't found. Tried to package-list-packages - list doesn't contain cider. What am I missing?

Finally did the steps from the following link to get it to work Brave Clojure book companion repo

like image 988
Gishu Avatar asked Mar 02 '23 12:03

Gishu


1 Answers

Not sure why the cider instructions don't mention this.

You need to create a ~/.emacs.d/init.el file with the following contents

(require 'package)

(add-to-list 'package-archives
             '("melpa" . "https://melpa.org/packages/") t)

(package-initialize)

(when (not package-archive-contents)
  (package-refresh-contents))

Save and restart emacs.

M-x package-list-packages check the archive column shows packages from gnu as well as melpa archives.

  • Sometimes you would see an error Failed to download ‘gnu’ archive. - this one is a flaky one. A restart and/or M-x package-refresh-contents fixed it for me.

Now we have the sources configured correctly.

  1. Install: M-x package-install <RET> cider <RET>

  2. M-x package-list-packages - Move to the end of the listing to see Status=installed packages.

  3. Test: M-x cider-jack-in. Answer no to the prompt indicating you are not in a clojure project. Soon you should be dropped to a user> prompt - ready to REPL and roll.

like image 135
2 revs Avatar answered Mar 07 '23 06:03

2 revs