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

**URL:** <https://org-roam.discourse.group/t/no-emacsql-sqlite-binary-available-aborting-error-when-installing-org-roam-v2-on-mac/2178>\
**Category:** Troubleshooting\
**Created:** [November 4, 2021, 5:03am UTC](https://org-roam.discourse.group/t/no-emacsql-sqlite-binary-available-aborting-error-when-installing-org-roam-v2-on-mac/2178 "2021-11-04T05:03:20Z")\
**Posts on this page:** 16\
**Page:** 1

<div class="post-metadata">

**Author:** ![unparadise](https://avatars.discourse-cdn.com/v4/letter/u/258eb7/32.png) [@unparadise](https://org-roam.discourse.group/u/unparadise)\
**Post date:** [November 4, 2021, 5:03am UTC](https://org-roam.discourse.group/t/no-emacsql-sqlite-binary-available-aborting-error-when-installing-org-roam-v2-on-mac/2178/1 "2021-11-04T05:03:20Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![nobiot](https://yyz2.discourse-cdn.com/free1/user_avatar/org-roam.discourse.group/nobiot/32/159_2.png) [@nobiot](https://org-roam.discourse.group/u/nobiot)\
**Post date:** [November 4, 2021, 6:44am UTC](https://org-roam.discourse.group/t/no-emacsql-sqlite-binary-available-aborting-error-when-installing-org-roam-v2-on-mac/2178/2 "2021-11-04T06:44:19Z")

</div>

You need to install a C compiler.

---

<div class="post-metadata">

**Author:** ![roi.holtzman](https://avatars.discourse-cdn.com/v4/letter/r/f05b48/32.png) [@roi.holtzman](https://org-roam.discourse.group/u/roi.holtzman)\
**Post date:** [November 19, 2021, 12:13pm UTC](https://org-roam.discourse.group/t/no-emacsql-sqlite-binary-available-aborting-error-when-installing-org-roam-v2-on-mac/2178/3 "2021-11-19T12:13:01Z")

</div>

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…

---

<div class="post-metadata">

**Author:** ![nobiot](https://yyz2.discourse-cdn.com/free1/user_avatar/org-roam.discourse.group/nobiot/32/159_2.png) [@nobiot](https://org-roam.discourse.group/u/nobiot)\
**Post date:** [November 19, 2021, 12:24pm UTC](https://org-roam.discourse.group/t/no-emacsql-sqlite-binary-available-aborting-error-when-installing-org-roam-v2-on-mac/2178/4 "2021-11-19T12:24:52Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![roi.holtzman](https://avatars.discourse-cdn.com/v4/letter/r/f05b48/32.png) [@roi.holtzman](https://org-roam.discourse.group/u/roi.holtzman)\
**Post date:** [November 19, 2021, 12:30pm UTC](https://org-roam.discourse.group/t/no-emacsql-sqlite-binary-available-aborting-error-when-installing-org-roam-v2-on-mac/2178/5 "2021-11-19T12:30:05Z")

</div>

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

```auto
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…

---

<div class="post-metadata">

**Author:** ![nobiot](https://yyz2.discourse-cdn.com/free1/user_avatar/org-roam.discourse.group/nobiot/32/159_2.png) [@nobiot](https://org-roam.discourse.group/u/nobiot)\
**Post date:** [November 19, 2021, 1:06pm UTC](https://org-roam.discourse.group/t/no-emacsql-sqlite-binary-available-aborting-error-when-installing-org-roam-v2-on-mac/2178/6 "2021-11-19T13:06:43Z")

</div>

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

Here is the relevant section of the [manual](https://www.orgroam.com/manual.html#C-Compiler):

> #### 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](https://github.com/org-roam/org-roam/issues/1927). 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.

---

<div class="post-metadata">

**Author:** ![nobiot](https://yyz2.discourse-cdn.com/free1/user_avatar/org-roam.discourse.group/nobiot/32/159_2.png) [@nobiot](https://org-roam.discourse.group/u/nobiot)\
**Post date:** [November 19, 2021, 1:10pm UTC](https://org-roam.discourse.group/t/no-emacsql-sqlite-binary-available-aborting-error-when-installing-org-roam-v2-on-mac/2178/7 "2021-11-19T13:10:18Z")

</div>

> [@roi.holtzman](#):
>
> `Cannot open load file: No such file or directory, org-roam-graph`

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](https://github.com/org-roam/org-roam/tree/master/extensions). 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`.

---

<div class="post-metadata">

**Author:** ![roi.holtzman](https://avatars.discourse-cdn.com/v4/letter/r/f05b48/32.png) [@roi.holtzman](https://org-roam.discourse.group/u/roi.holtzman)\
**Post date:** [November 19, 2021, 2:37pm UTC](https://org-roam.discourse.group/t/no-emacsql-sqlite-binary-available-aborting-error-when-installing-org-roam-v2-on-mac/2178/8 "2021-11-19T14:37:49Z")

</div>

But I have gcc installed:

```auto
% 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:

```auto
% 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. 🤞

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

---

<div class="post-metadata">

**Author:** ![nobiot](https://yyz2.discourse-cdn.com/free1/user_avatar/org-roam.discourse.group/nobiot/32/159_2.png) [@nobiot](https://org-roam.discourse.group/u/nobiot)\
**Post date:** [November 19, 2021, 3:39pm UTC](https://org-roam.discourse.group/t/no-emacsql-sqlite-binary-available-aborting-error-when-installing-org-roam-v2-on-mac/2178/9 "2021-11-19T15:39:10Z")

</div>

I also suggest to look at the wiki pages [Home · org-roam/org-roam Wiki · GitHub](https://github.com/org-roam/org-roam/wiki)

Doom seems to suppress the message to refer to them.

---

<div class="post-metadata">

**Author:** ![roi.holtzman](https://avatars.discourse-cdn.com/v4/letter/r/f05b48/32.png) [@roi.holtzman](https://org-roam.discourse.group/u/roi.holtzman)\
**Post date:** [November 19, 2021, 4:24pm UTC](https://org-roam.discourse.group/t/no-emacsql-sqlite-binary-available-aborting-error-when-installing-org-roam-v2-on-mac/2178/10 "2021-11-19T16:24:06Z")

</div>

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

```auto
(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?

---

<div class="post-metadata">

**Author:** ![nobiot](https://yyz2.discourse-cdn.com/free1/user_avatar/org-roam.discourse.group/nobiot/32/159_2.png) [@nobiot](https://org-roam.discourse.group/u/nobiot)\
**Post date:** [November 19, 2021, 5:58pm UTC](https://org-roam.discourse.group/t/no-emacsql-sqlite-binary-available-aborting-error-when-installing-org-roam-v2-on-mac/2178/11 "2021-11-19T17:58:46Z")

</div>

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.

```auto
(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...
)

```

---

<div class="post-metadata">

**Author:** ![roi.holtzman](https://avatars.discourse-cdn.com/v4/letter/r/f05b48/32.png) [@roi.holtzman](https://org-roam.discourse.group/u/roi.holtzman)\
**Post date:** [November 19, 2021, 6:33pm UTC](https://org-roam.discourse.group/t/no-emacsql-sqlite-binary-available-aborting-error-when-installing-org-roam-v2-on-mac/2178/12 "2021-11-19T18:33:47Z")

</div>

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

```auto
(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)

```auto
(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)))))
)

```

---

<div class="post-metadata">

**Author:** ![nobiot](https://yyz2.discourse-cdn.com/free1/user_avatar/org-roam.discourse.group/nobiot/32/159_2.png) [@nobiot](https://org-roam.discourse.group/u/nobiot)\
**Post date:** [November 19, 2021, 7:26pm UTC](https://org-roam.discourse.group/t/no-emacsql-sqlite-binary-available-aborting-error-when-installing-org-roam-v2-on-mac/2178/13 "2021-11-19T19:26:11Z")

</div>

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

```auto
  (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…

---

<div class="post-metadata">

**Author:** ![roi.holtzman](https://avatars.discourse-cdn.com/v4/letter/r/f05b48/32.png) [@roi.holtzman](https://org-roam.discourse.group/u/roi.holtzman)\
**Post date:** [November 19, 2021, 7:32pm UTC](https://org-roam.discourse.group/t/no-emacsql-sqlite-binary-available-aborting-error-when-installing-org-roam-v2-on-mac/2178/14 "2021-11-19T19:32:06Z")

</div>

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.

---

<div class="post-metadata">

**Author:** ![nobiot](https://yyz2.discourse-cdn.com/free1/user_avatar/org-roam.discourse.group/nobiot/32/159_2.png) [@nobiot](https://org-roam.discourse.group/u/nobiot)\
**Post date:** [November 19, 2021, 7:53pm UTC](https://org-roam.discourse.group/t/no-emacsql-sqlite-binary-available-aborting-error-when-installing-org-roam-v2-on-mac/2178/15 "2021-11-19T19:53:37Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![charlemana](https://avatars.discourse-cdn.com/v4/letter/c/4af34b/32.png) [@charlemana](https://org-roam.discourse.group/u/charlemana)\
**Post date:** [July 8, 2022, 6:41am UTC](https://org-roam.discourse.group/t/no-emacsql-sqlite-binary-available-aborting-error-when-installing-org-roam-v2-on-mac/2178/16 "2022-07-08T06:41:00Z")

</div>

This solved my issue on Alpine and Ubuntu as well, using cmake, not gcc
