# Anyone got v2 working with spacemacs or on Ubuntu at all?

**URL:** <https://org-roam.discourse.group/t/anyone-got-v2-working-with-spacemacs-or-on-ubuntu-at-all/1475>\
**Category:** Troubleshooting\
**Created:** [April 15, 2021, 2:58pm UTC](https://org-roam.discourse.group/t/anyone-got-v2-working-with-spacemacs-or-on-ubuntu-at-all/1475 "2021-04-15T14:58:06Z")\
**Posts on this page:** 7\
**Page:** 1

<div class="post-metadata">

**Author:** ![BenMoon](https://avatars.discourse-cdn.com/v4/letter/b/cab0a1/32.png) [@BenMoon](https://org-roam.discourse.group/u/BenMoon)\
**Post date:** [April 15, 2021, 2:58pm UTC](https://org-roam.discourse.group/t/anyone-got-v2-working-with-spacemacs-or-on-ubuntu-at-all/1475/1 "2021-04-15T14:58:06Z")

</div>

I very recently came across org-roam and wanted to evaluate it for my needs (I’ve been using org-mode for some time). It looks very promising and after some reading and trying I thought to test the new branch v2. For what I think I will need, I guess v2 is the way to go and since I’m anyway starting new, I wanted to give it a shot. However, I kind of got stuck and after I have been meddling with this for the better part of a week now without significant progress I dearly hope someone here can help me.

1. Using this config from Jethro,

2. I also tried to install doom on a recent Ubuntu 20.04 with even less success. I tried the shipped emacs 26.3 and a self-compiled 27.2.  
`org-roam-setup` crashed with a cryptic error message:

My apologies if it’s something obvious, but I stopped seeing the trees in the forst.  
Thank you very much in advance and any help is much appreciated.

Best

Ben

---

<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:** [April 15, 2021, 4:21pm UTC](https://org-roam.discourse.group/t/anyone-got-v2-working-with-spacemacs-or-on-ubuntu-at-all/1475/2 "2021-04-15T16:21:07Z")

</div>

Hi Ben,

I am guessing you only need Spacemacs to work, correct?

Have you had a chance to read the [wiki](https://github.com/org-roam/org-roam/wiki/Hitchhiker's-Rough-Guide-to-Org-roam-V2#once-you-have-done-the-initial-configuration), and perhaps tried to apply [this vanilla config](https://github.com/org-roam/org-roam/wiki/Hitchhiker's-Rough-Guide-to-Org-roam-V2#configuration-for-vanilla-emacs-no-distribution-such-as-doom-or-spacemacs) to Spacemacs?

Once variables have been set via `setq` and/or `use-package`, etc. (I don’t know how Spacemacs does this), you need to run `org-roam-setup`.

You say this:

> only after I manually call org-roam-setup can the new note be found with org-roam-node-insert`

This is because… You need to do it – you will notice it added in part of the config above. There is no minor-mode to start Org-roam. `org-roam-setup` is the way to start it.

And then refer to [this section](https://github.com/org-roam/org-roam/wiki/Hitchhiker's-Rough-Guide-to-Org-roam-V2#once-you-have-done-the-initial-configuration) on how you can use V2.

I am guessing the reason why you see nothing in the org-roam buffer is because you haven’t set up the sections to display. See this part:

```auto
(setq org-roam-mode-sections
    (list #'org-roam-backlinks-insert-section
          #'org-roam-reflinks-insert-section
          ;; #'org-roam-unlinked-references-insert-section
          ))

```

I think you can run org-roam in Spacemacs now… Let us know…

---

<div class="post-metadata">

**Author:** ![BenMoon](https://avatars.discourse-cdn.com/v4/letter/b/cab0a1/32.png) [@BenMoon](https://org-roam.discourse.group/u/BenMoon)\
**Post date:** [April 15, 2021, 9:29pm UTC](https://org-roam.discourse.group/t/anyone-got-v2-working-with-spacemacs-or-on-ubuntu-at-all/1475/3 "2021-04-15T21:29:55Z")

</div>

Dear Nobiot  
yes, I did read the wiki, but apparently didn’t understand…  
It works like a charm on Mac 😃 and I will try Ubuntu tomorrow. Thanks a million!  
Here’s my org-roam related `dotspacemacs/user-config` part for reference:

```auto
   (defun my/org-roam-load ()
       (interactive)
       (add-to-list 'load-path "~/.emacs.d/private/org-roam")
       (load-library "org-roam")
       (setq org-roam-directory "~/data/Notes/roam/")
       (setq org-roam-mode-sections
           (list #'org-roam-backlinks-insert-section
                 #'org-roam-reflinks-insert-section;))
                 #'org-roam-unlinked-references-insert-section))
       (setq org-roam-file-extensions '("org"))
       (org-roam-setup)
       ; capture files without date-time prefix
       (setq org-roam-capture-templates
           '(("d" "default" plain
               "%?"
              :if-new (file+head "${slug}.org"
                                 "#+title: ${title}\n")
              :immediate-finish t
              :unnarrowed t)))
        (setq org-roam-capture-ref-templates
            '(("r" "ref" plain
               "%?"
               :if-new (file+head "${slug}.org"
                                  "#+title: ${title}\n")
               :unnarrowed t)))
    )
    (my/org-roam-load)
   (spacemacs/declare-prefix "ar" "org-roam")
   (spacemacs/set-leader-keys
     "ar/" 'org-roam-node-find
     "arc" 'org-roam-capture
     "ari" 'org-roam-node-insert
     "arr" 'org-roam-buffer-toggle)
   (spacemacs/declare-prefix-for-mode 'org-mode "mr" "org-roam")
   (spacemacs/set-leader-keys-for-major-mode 'org-mode
     "r/" 'org-roam-node-find
     "rc" 'org-roam-capture
     "ri" 'org-roam-node-insert
     "rr" 'org-roam-buffer-toggle)
   (define-key evil-insert-state-map (kbd "C-c i") 'org-roam-capture)

```

Cheers

Ben

---

<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:** [April 16, 2021, 5:39am UTC](https://org-roam.discourse.group/t/anyone-got-v2-working-with-spacemacs-or-on-ubuntu-at-all/1475/4 "2021-04-16T05:39:56Z")

</div>

This part defines a function you can manually run. Did you you call it?

Maybe you are calling it.

And it does not work?

If it works on Mac and not on Ubuntu, it might be that the Emac version is different.

---

<div class="post-metadata">

**Author:** ![BenMoon](https://avatars.discourse-cdn.com/v4/letter/b/cab0a1/32.png) [@BenMoon](https://org-roam.discourse.group/u/BenMoon)\
**Post date:** [April 16, 2021, 7:15pm UTC](https://org-roam.discourse.group/t/anyone-got-v2-working-with-spacemacs-or-on-ubuntu-at-all/1475/5 "2021-04-16T19:15:22Z")

</div>

Dear Nobiot,  
all it’s working now 😃. On Ubuntu I had to use the new Emacs 27.2. I’m pretty stumped as to why this was such a struggle previously, but I’m happy that I’m operational now.  
Thanks a lot

Ben

---

<div class="post-metadata">

**Author:** ![tbd](https://avatars.discourse-cdn.com/v4/letter/t/9d8465/32.png) [@tbd](https://org-roam.discourse.group/u/tbd)\
**Post date:** [April 28, 2021, 5:27pm UTC](https://org-roam.discourse.group/t/anyone-got-v2-working-with-spacemacs-or-on-ubuntu-at-all/1475/6 "2021-04-28T17:27:47Z")

</div>

Why am I getting this error message each time I tried to write a new node?

user-error:

> **Template needs to specify ‘:if-new’**

---

<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:** [April 28, 2021, 6:40pm UTC](https://org-roam.discourse.group/t/anyone-got-v2-working-with-spacemacs-or-on-ubuntu-at-all/1475/7 "2021-04-28T18:40:29Z")

</div>

That’s because the capture template has introduced new syntax ([wiki](https://github.com/org-roam/org-roam/wiki/Hitchhiker's-Rough-Guide-to-Org-roam-V2#capture-template)).
