# Installation issues on mac

**URL:** https://org-roam.discourse.group/t/installation-issues-on-mac/2808
**Category:** Troubleshooting
**Created:** [October 10, 2022, 9:20am UTC](https://org-roam.discourse.group/t/installation-issues-on-mac/2808 "2022-10-10T09:20:19Z")
**Posts on this page:** 7
**Page:** 1

<div class="post-metadata">

### Author: ![gaolegao](https://avatars.discourse-cdn.com/v4/letter/g/71c47a/32.png) [@gaolegao](https://org-roam.discourse.group/u/gaolegao)
#### Post date: [October 10, 2022, 9:20am UTC](https://org-roam.discourse.group/t/installation-issues-on-mac/2808/1 "2022-10-10T09:20:19Z")

</div>

I am new to emacs, and after installed org-mode and org-roam, I try to execute “M-x org-roam-node-find”,an error occurred “Query timeout error: “Query timed out”, 30”. Any help is appreciate!

my config are as follows:

```auto
(use-package org-roam
  :ensure t
  :config
  ;; If using org-roam-protocol
  (require 'org-roam-protocol)
  :bind
  ("C-c n l" . org-roam-buffer-toggle)
  ("C-c n f" . org-roam-node-find)
  ("C-c n g" . org-roam-graph)
  ("C-c n i" . org-roam-node-insert)
  ("C-c n c" . org-roam-capture)
  ;; Dailies
  ("C-c n j" . org-roam-dailies-capture-today)
  :custom
  (org-roam-v2-ack t)
  (org-roam-directory (string-join (cons my/all-notes '("content-org")) "/"))
  (org-roam-capture-templates `(("d" "default" plain "%?"
                                 :unnarrowed t
                                 :if-new (file+head "%<%Y%m%d%H%M%S>-${slug}.org"
                                                    "#+TITLE: ${title}
#+AUTHOR: James
#+DATE: %U
#+HUGO_BASE_DIR: ../
#+HUGO_SECTION: notes
")))))

```

---

<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: [October 10, 2022, 11:57am UTC](https://org-roam.discourse.group/t/installation-issues-on-mac/2808/2 "2022-10-10T11:57:52Z")

</div>

I suspect you might not have a C compiler in your machine, `gcc` or `clang`?

Refer to this part of the manual: [Org-roam User Manual](https://www.orgroam.com/manual.html#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

---

<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: [October 10, 2022, 12:00pm UTC](https://org-roam.discourse.group/t/installation-issues-on-mac/2808/3 "2022-10-10T12:00:01Z")

</div>

In addition, I suggest you review the configuration in [README](https://github.com/org-roam/org-roam#configuration) of Org-roam repository on GitHub

Yours does not seem to be correct – where is `org-roam-db-autosync-mode`?

---

<div class="post-metadata">

### Author: ![gaolegao](https://avatars.discourse-cdn.com/v4/letter/g/71c47a/32.png) [@gaolegao](https://org-roam.discourse.group/u/gaolegao)
#### Post date: [October 11, 2022, 3:43am UTC](https://org-roam.discourse.group/t/installation-issues-on-mac/2808/4 "2022-10-11T03:43:54Z")

</div>

I checked clang in my mac using `clang --version`:

```auto
Apple clang version 14.0.0 (clang-1400.0.29.102)
Target: x86_64-apple-darwin21.6.0
Thread model: posix
InstalledDir: /Library/Developer/CommandLineTools/usr/bin

```

I think there is a C compiler I can use?

---

<div class="post-metadata">

### Author: ![gaolegao](https://avatars.discourse-cdn.com/v4/letter/g/71c47a/32.png) [@gaolegao](https://org-roam.discourse.group/u/gaolegao)
#### Post date: [October 11, 2022, 3:51am UTC](https://org-roam.discourse.group/t/installation-issues-on-mac/2808/5 "2022-10-11T03:51:01Z")

</div>

After I added `org-roam-db-autosync-mode` to my config, the problem still exist.  
In addition, `M-x org-roam-db-build-cache` or `M-x org-roam-db-autosync-mode` will lead to the same error :  
`Error (use-package): org-roam/:config: Query timeout error: "Query timed out", 30`

---

<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: [October 11, 2022, 6:36am UTC](https://org-roam.discourse.group/t/installation-issues-on-mac/2808/6 "2022-10-11T06:36:56Z")

</div>

What’s the value of your org-roam-directory?

I have never seen this way of setting your dir:

(org-roam-directory (string-join (cons my/all-notes '(“content-org”)) “/”))

---

<div class="post-metadata">

### Author: ![gaolegao](https://avatars.discourse-cdn.com/v4/letter/g/71c47a/32.png) [@gaolegao](https://org-roam.discourse.group/u/gaolegao)
#### Post date: [October 11, 2022, 6:58am UTC](https://org-roam.discourse.group/t/installation-issues-on-mac/2808/7 "2022-10-11T06:58:44Z")

</div>

Oh I forget to update the modification，the config I am using is:

```auto
(use-package org-roam
  :ensure t
  :config
  (setq org-roam-node-display-template (concat "${title:*} " (propertize "${tags:10}" 'face 'org-tag)))
  (org-roam-db-autosync-mode)
  ;; If using org-roam-protocol
  (require 'org-roam-protocol)
  :bind
  ("C-c n l" . org-roam-buffer-toggle)
  ("C-c n f" . org-roam-node-find)
  ("C-c n g" . org-roam-graph)
  ("C-c n i" . org-roam-node-insert)
  ("C-c n c" . org-roam-capture)
  ;; Dailies
  ("C-c n j" . org-roam-dailies-capture-today)
  :custom
  (org-roam-v2-ack t)
  (org-roam-directory "~/notes")
  (org-roam-capture-templates `(("d" "default" plain "%?"
                                 :unnarrowed t
                                 :if-new (file+head "%<%Y%m%d%H%M%S>-${slug}.org"
                                                    "#+TITLE: ${title}
#+AUTHOR: James
#+DATE: %U
#+HUGO_BASE_DIR: ../
#+HUGO_SECTION: notes
")))))

```

I make a new directory for convenience

my environment is

```auto
emacs Version 28.2 (9.0)
org-roam 2.2.2

```

@nobiot Thank you for your help, I have solve the probelm,  
just install `sqlite3 `, and add `(setq org-roam-database-connector 'sqlite3)` before init org-roam  
refer to [Query timeout error: "Query timed out", 30 · Issue #1196 · org-roam/org-roam · GitHub](https://github.com/org-roam/org-roam/issues/1196#issuecomment-1050561289)
