blogdown problem with serve_site() / hugo version

Hi Rstudio,
I am trying to make a new blogdown site using the Hugo Academic theme and running into problems with the version of hugo that I have running. I've updated hugo so that when I do hugo_version() it tells me I have the most recent (0.55.6), but initially when I tried to serve_site, I got an error where it seems like i have two versions of hugo.

Total in 490 ms
Error: Error building site: logged 1 error(s)
To stop the server, run servr::daemon_stop(1) or restart your R session
Serving the directory /Users/jenny/Desktop/RichmondLab at http://127.0.0.1:4321
Warning message:
In find_exec("hugo", "Hugo", "You can install it via blogdown::install_hugo()") :
  Found hugo at "~/Library/Application Support/Hugo/hugo" and "/usr/local/bin/hugo". The former will be used. If you don't need both copies, you may delete/uninstall one.

I uninstalled hugo using brew uninstall hugo --force, restarted R and did serve site again, and ended up with a different error

Building sites … ERROR 2019/06/19 09:58:25 error: failed to transform resource: TOCSS: failed to transform "main_parsed.scss" (text/x-scss): this feature is not available in your current Hugo version, see https://goo.gl/YMrWcn for more information
Total in 596 ms
Error: Error building site: logged 1 error(s)
createTcpServer: address already in use
To stop the server, run servr::daemon_stop(2) or restart your R session
Serving the directory /Users/jenny/Desktop/RichmondLab at http://127.0.0.1:5846

I looked at that google link and it is something about the "extended" version of hugo, so I reinstalled hugo with extended = TRUE, but then I ended up with two versions of hugo again.

FYI When I run...

> blogdown:::find_hugo()
[1] "/Users/jenny/Library/Application Support/Hugo/hugo"
> blogdown::hugo_version()
[1] ‘0.55.6’

thanks!
Jen

Hi Jenny,

This is indeed an odd error and you found the extended Hugo thing. When you say you reinstalled hugo, did you use something like this?

blogdown::install_hugo = function(
  version = 'latest', force = TRUE, extended = TRUE
)

Can you try this solution?

So...

unlink('~/Library/Application Support/Hugo', recursive = TRUE)
blogdown::install_hugo(force=TRUE, extended=TRUE)

Then restart your R session.

Alison

1 Like

thanks Alison! that works perfectly. All fixed :slight_smile:

1 Like

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.