"No EmacSQL SQLite binary available, aborting" error when installing org-roam v2 on MAC

Hi everyone,

I got an error message - error “No EmacSQL SQLite binary available, aborting” when trying to install org-roam V2 on MAC.

I am running Emacs 27.2 on macOS Monterey (12.1 Beta). When I ran which sqlite3 command, it returns /usr/bin/sqlite3. I also have the emacsql-sqlite3 package installed.

Anyone has any idea how to fix the issue?

Thank you very much in advance!

-Frank

You need to install a C compiler.

How can this be done?
I am running on Mac. I also had v1 installed properly, so I am not sure why I don’t sqlite installed already…

@roi.holtzman what part are you struggling with? You shouldn’t have to change anything about database.

I open emacs and run the migration wizard, and I get this error

Compiling EmacSQL SQLite binary ...
Org-roam initialization: (error "No EmacSQL SQLite binary available, aborting")
Cannot open load file: No such file or directory, org-roam-graph

I don’t know how to solve it…

You need a C compiler, really – sorry, I’m just repeating myself.

Here is the relevant section of the manual:

4.3.1 C Compiler

Org-roam relies on an Emacs package called emacsql and emacsql-sqlite to work with the sqlite database. Both of them should be installed automatically in your Emacs environment as a prerequisite for Org-roam when you install it.

emacsql-sqlite requires a C compiler (e.g. gcc or clang ) to be present in your computer. How to install a C compiler depends on the OS that you use.

I believe it’s easy on macOS to install either gcc or clang. One of them may be part of X-code like Git. Or perhaps via brew?

Don’t use emacsql-sqlite3.; it does not work. By default, you should not have to do any manual configuration – I think that’s why you get the error message.

If you install a C compiler and do it again, it should work.

For this… Are you on Doom or use Straight or something to install Org-roam? Some of these features inculuding graph is in a subdirectory of the repo called extesions. You need to also get .el files from it. Adjust your configuration for your package manager. You don’t need to do anything for this if you are using the built-in package.el.

But I have gcc installed:

% which gcc
/usr/bin/gcc

BTW, I am running on doom emacs.

WAIT - there might a problem with my gcc, since I get this error:

% gcc
xcrun: error: invalid active developer path (/Library/Developer/CommandLineTools), missing xcrun at: /Library/Developer/CommandLineTools/usr/bin/xcrun

I am trying to update my gcc now, and I hope it will fix the issue. :crossed_fingers:

@nobiot I updated gcc, and the error is now gone :slight_smile:
I am now running the migration wizard, and I hope it will be fine.

1 Like

I also suggest to look at the wiki pages Home · org-roam/org-roam Wiki · GitHub

Doom seems to suppress the message to refer to them.

Thanks.

I am still having a hard time to handle the configuration. For instance, I don’t know why I cannot toggle the org roam buffer…
I don’t have the function org-roam-buffer-toggle to choose when I do M-x.

This is my configuration

(after! org-roam
  (setq org-roam-completion-everywhere 'nil)
  (setq org-roam-directory (file-truename "~/Dropbox (Weizmann Institute)/PHD/org-roam"))
  (setq org-roam-db-location "~/org-roam.db")
  (setq org-roam-v2-ack t)

  (setq org-roam-mode-section-functions
      (list #'org-roam-backlinks-section
            #'org-roam-reflinks-section
            ;; #'org-roam-unlinked-references-section
            ))
  (add-to-list 'display-buffer-alist
             '("\\*org-roam\\*"
               (display-buffer-in-side-window)
               (side . right)
               (slot . 0)
               (window-width . 0.33)
               (window-parameters . ((no-other-window . t)
                                     (no-delete-other-windows . t)))))

   (org-roam-setup)
)

What am I doing wrong?

I don’t know exactly how Doom works.
Two questions:

  1. Are you aware of the (+roam2) flag for Doom’s org module?

  2. Does after! macro load or require org-roam before you call the org-roam-buffer-toggle command?

If the answer to question 2 above, I think you would need to tell Doom to register org-roam-buffer-toggle for autoloading org-roam – so that when you call the command, Emacs will automatically load org-roam if it hasn’t.

If I remember correctly, the :bind or :command directives within use-package! does this.

So… I think it should be something like below – note I can’t test it but I believe I’ve seen something like it used by others.

(use-package! org-roam
  :init 
     (setq org-roam-v2-ack t)
  :command 
    ;; I  don't know exact syntax, but it would be a list of symbols???
    '(org-roam-db-sync org-roam-buffer-toggle) ;;; .. and so on
  :config
     ;;; setq config continues...
)

Amazing! This is a big step!
The use-pacakge! command is crucial!
This is the configuration I am using

(use-package! org-roam
  :after org
  :config
  (setq org-roam-v2-ack t)
  (setq org-roam-completion-everywhere 'nil)
  ;; (setq org-roam-directory "~/Dropbox (Weizmann Institute)/PHD/org-roam")
  ;; (setq org-roam-directory (f-canonical "~/Dropbox (Weizmann Institute)/PHD/org-roam"))
  (setq org-roam-directory (file-truename "~/Dropbox (Weizmann Institute)/PHD/org-roam"))
  (setq org-roam-db-location "~/org-roam.db")

    (setq org-roam-mode-section-functions
      (list #'org-roam-backlinks-section
            #'org-roam-reflinks-section
            ;; #'org-roam-unlinked-references-section
            ))

  (org-roam-setup))

Now, the I can toggle the org roam buffer.

I am not sure though why my preference of having the window to take only 0.33 of the large window does not work.
I set it like this (taken from the documentation)

(after! org-roam
     (map! :leader
      (:prefix-map ("n" . "notes")
       (:prefix ("r" . "roam")
        :desc "Insert new roam node" "i" #'org-roam-node-insert
        :desc "Find roam node" "f" #'org-roam-node-find
        :desc "Roam buffer" "r" #'org-roam-buffer-toggle)))


       (add-to-list 'display-buffer-alist
             '("\\*org-roam\\*"
               (display-buffer-in-side-window)
               (side . right)
               (slot . 0)
               (window-width . 0.33)
               (window-parameters . ((no-other-window . t)
                                     (no-delete-other-windows . t)))))
)

I think you are missing one set of brackets. It’s a list of lists. I have this in my configuration:

  (setq display-buffer-alist
        '(;; Left side window
          ("\*org-roam\*"
           (display-buffer-in-side-window)
           (window-width . 0.25)
           (side . left)
           (slot . 1))))

Okay. You use add-to-list. I don’t know really. It’s usually a number of brackets. I use customize to get it right in many cases…

It’s weird if something is missing because I have copied it from the documentation.
Also, in other places in my configuration, when doing add-to-list there is the same number of parenthesis as here.

I’d check C-h v to see if it looks correctly formatted just before calling the toggle command.

If you see nothing wrong, I have no clue. I’d do edebug

1 Like