Config not found... using only defaults, stuff may not work

629 views
Skip to first unread message

NkS

unread,
Sep 3, 2014, 2:37:26 AM9/3/14
to hugo-d...@googlegroups.com

Hi,


Why am getting the followin warning, while creating a new site using the command`hugo new .`:

ERROR: 2014/09/03 Config not found... using only defaults, stuff may not work


System details:

Mac OS X: v10.9.4

hugo: v0.12


Thanks,

NkS

Dave Cottlehuber

unread,
Sep 3, 2014, 3:32:29 AM9/3/14
to hugo-d...@googlegroups.com
It thinks you’re trying to create new content (e.g. a post) called `.`, and therefore expects 
there’s already a config.{toml,yaml,json} present. 

The correct syntax is `hugo new site <dir>` which gives you: 

<dir> 
├── archetypes/ 
├── config.toml 
├── content/ 
├── layouts/ 
└── static/ 

A+ 
Dave

Steve Francia

unread,
Sep 4, 2014, 10:30:44 AM9/4/14
to Dave Cottlehuber, hugo-d...@googlegroups.com
Correct, 
We made the hugo new site <location> longer than hugo new <content> because you use it so less frequently. 

--
Hugo
 
A Fast and Flexible Static Site Generator built with love by spf13 and friends in Go
 
Download the latest at https://github.com/spf13/hugo/releases
---
You received this message because you are subscribed to the Google Groups "Hugo Discuss" group.
To unsubscribe from this group and stop receiving emails from it, send an email to hugo-discuss...@googlegroups.com.
To post to this group, send email to hugo-d...@googlegroups.com.
Visit this group at http://groups.google.com/group/hugo-discuss.
For more options, visit https://groups.google.com/d/optout.

slowbluesmaster

unread,
Sep 7, 2014, 12:46:52 PM9/7/14
to hugo-d...@googlegroups.com
20+ years Mac veteran (currently OS X 10.9), but a command line n00b. New here too, name's Peter.

Can't figure it out how to clear the 1st hurdle ;-(

Interested in statically generated sites for years, never tried it before. Investigated the more popular and finally settled on trying Hugo (fast, easy, extensive docs).
Been reading those docs on install and quickstart over and over again. Downloaded 0.12_darwin_amd64 and dropped the executable in a new Hugo folder with my other applications (Once downloaded it can be run from anywhere.)

Opened Terminal, dragged the executable on the terminal window to provide a path, and failed over and over again at all conceivable variations of *hugo new site*.
Running *hugo help* gives what's promised, though, so I know something is OK at least.
But the errors are :

ERROR: 2014/09/07 Config not found... using only defaults, stuff may not work
ERROR: 2014/09/07 Unable to find Static Directory:  in /Applications/Hugo/static/
CRITICAL: 2014/09/07 No source directory found, expecting to find it at /Applications/Hugo/content

I figured I should perhaps do something with the */path/to/site* portion of the *hugo new site* command, but for me it's just catch 22.
What do I need to do to generate a site structure in a new folder in my Hugo folder ? Please be gentle with me and ELI5 ;-)

TIA !

Peter

Dave Cottlehuber

unread,
Sep 7, 2014, 4:56:43 PM9/7/14
to hugo-d...@googlegroups.com, slowbluesmaster
> 20+ years Mac veteran (currently OS X 10.9), but a command line n00b. New
> here too, name's Peter.
>
> Can't figure it out how to clear the 1st hurdle ;-(
>
> Interested in statically generated sites for years, never tried it before.
> Investigated the more popular and finally settled on trying Hugo (fast,
> easy, extensive docs).
> Been reading those docs on install and quickstart over and over again.
> Downloaded 0.12_darwin_amd64 and dropped the executable in a new Hugo
> folder with my other applications (Once downloaded it can be run from
> anywhere.)
>
> Opened Terminal, dragged the executable on the terminal window to provide a
> path, and failed over and over again at all conceivable variations of *hugo
> new site*.
> Running *hugo help* gives what's promised, though, so I know something is
> OK at least.
> But the errors are :
>
> ERROR: 2014/09/07 Config not found... using only defaults, stuff may not
> work
> ERROR: 2014/09/07 Unable to find Static Directory: in
> /Applications/Hugo/static/
> CRITICAL: 2014/09/07 No source directory found, expecting to find it at
> /Applications/Hugo/content

This error message is indicating that the directory that hugo is looking for
its configuration file is missing, and that also there’s other files missing.
This is because your current working dir and the place hugo’s trying to create
stuff in don’t match up.

More info below. I also suggest you see how to copy the screen from your
terminal, and put it up on a site like http://dpaste.de/ to share a record
of what’s not worked for you if you still get stuck below. 

> I figured I should perhaps do something with the */path/to/site* portion of
> the *hugo new site* command, but for me it's just catch 22.
> What do I need to do to generate a site structure in a new folder in my
> Hugo folder ? Please be gentle with me and ELI5 ;-)
>
> TIA !
>
> Peter

Hi Peter,

Welcome :-)

You’re pretty close,  I’ll spell this out slowly to make it a bit command-line
friendlier.

I’ll use `backquotes` to indicate typing individual commands in the terminal,
and <angle/brackets> where you need to replace that with content of your
own devising. Longer sections of terminal will be ```fenced``` , as in
https://help.github.com/articles/github-flavored-markdown already shown:

```
a command
# comment to ignore, perhaps some output if useful
another command
```

## Finding hugo

If you open a new terminal window, does just typing `hugo` do anything? This
is making sure it’s in your path. The default PATH is, IIRC, on OSX:

    /usr/bin:/bin:/usr/sbin:/usr/local/bin:/usr/X11/bin

A good place for user-installed binaries is in /usr/local/bin/ which you can
create if it doesn’t already exist. Dragging the hugo binary into this folder
is a Good Thing. 

The amazing http://brew.sh tool kit uses /usr/local/bin too, and also allows
simple installation like `brew install hugo` to install a current version of
hugo directly. brew is probably a distraction at this point BTW but it *is*
awesome.

## Changing working Directory

Typically you’ll work in a particular directory, and use a relative path, 
so let’s assume you have hugo in /usr/local/bin as before, and that you have
chosen to work in ~/Documents folder.

You can change dir in the terminal with `cd ~/Documents/` and confirm using
`pwd` that the change was successful.

The next sections are basically an expanded version of
http://hugo.spf13.com/overview/quickstart/ so feel free to follow that as
well. If you try the verbatim `hugo /path/to/site` it will fail as most people
don’t have the preceding directories /path/to/ existing. Use something like
~/Documents/ which is on your mac already.

## Generating a site

`hugo new <site>` will create a new directory containing a plain site from
template, and an associated config file, also with some defaults.

Assuming you’ve changed directory already above, you can make a new site
by doing `hugo new mysite` which will create a new directory:

    ~/Documents/mysite/

From the terminal you can see what files and directories are there using ls:

```
ls -Fl ~/Documents/mysite
# total 8
# drwxr-xr-x+ 2 dch  staff  68  7 Sep 22:36 archetypes/
# -rw-r--r--+ 1 dch  staff  82  7 Sep 22:36 config.toml
# drwxr-xr-x+ 2 dch  staff  68  7 Sep 22:36 content/
# drwxr-xr-x+ 2 dch  staff  68  7 Sep 22:36 layouts/
# drwxr-xr-x+ 2 dch  staff  68  7 Sep 22:36 static/
```

the handy -F switch puts an extra character at the end of anything that isn’t
a simple file.

Before doing anything more, we need to change the current working directory,
inside ~/Documents at the moment, to be inside mysite.

We can do this either using a relative path `cd mysite` or the longer
`cd ~/Documents/mysite`, and check our location with `pwd` at the end.

## A first post

So now we are “inside” our site dir, but it’s empty. The next stage is to make
a page within that site, and then we can generate the site to see our awesome
powers at work.

```
pwd
# should see ~/Documents/mysite/ or similar
hugo new about.md
# ~/Documents/mysite/content/about.md created
# check it with `cat ~/Documents/mysite/content/about.md`
# +++
# date = "2014-09-07T22:47:35+02:00"
# draft = true
# title = "about"
# +++
```

That’s a good starting point if you get thus far.


Dave Cottlehuber
d...@jsonified.com
Sent from my Couch


Steve Francia

unread,
Sep 7, 2014, 11:59:17 PM9/7/14
to Dave Cottlehuber, hugo-d...@googlegroups.com, slowbluesmaster
Dave, 
This is a really fantastic beginners guide. Absolutely great stuff. I'd love to include it in the docs. Would you mind submitting it as a Pull Request so you get the credit. 

I'm thinking calling it "beginners quick start" and at the top of the normal quick start saying something like... 

New to the command line. Please use the beginners quick start which explains each step in much greater detail".

What do you think?

From: Dave Cottlehuber <d...@jsonified.com>
Reply: Dave Cottlehuber <d...@jsonified.com>>

slowbluesmaster

unread,
Sep 8, 2014, 5:49:31 AM9/8/14
to hugo-d...@googlegroups.com, blu35...@gmail.com
Dave !

I apologise for my late reply, apparently we live in different timezones.
I'll be studying your instructions with great care and attention later, but permit me a few observations first.

First of all, let me tell you that I'm extremely grateful that you're willing to take me by the hand. The friendliness and generosity of people like yourself never ceases to amaze me. I've been trying to educate myself on lacking command line knowledge to extensive Google sessions for weeks, but it's been a bumpy ride. OS X is not a 100% match for Linux 'under the hood' and Apple's tinkering with FreeBSD apparently haven't made aficionados of pure Unix very happy. The number of 'hidden directories' in OS X is now mind boggling.

People tell me I'm not stupid, but I know my limitations : I'm not comfortable working on the command line. Not always being able to grasp what I'm doing is rather unsettling and not getting a result following instructions to the best of my ability is disheartening.

Here we go :

On installing :
Apple has not seen fit to provide an empty /usr/local/bin directory with its latest OS X incarnations :


so I thought I'd keep Hugo in plain sight : in a new folder named Hugo in my Applications folder. Because Hugo can be used from anywhere, it says so in the docs !
Apparently not the best idea/ I know I can create the missing /usr/local/bin directory with mkdir and then use it in Terminal. But why not have it my way ? So I can simply drag'n'drop Hugo in a visible folder instead of moving it into a hidden directory via Terminal ?

On providing PATH :

Hugo's docs almost casually mention : Ideally you should install it somewhere in your path for easy use. There the trouble already begins for me. Default PATH on OS X is


How to provide PATH to my chosen location for Hugo ? I must've read dozens of OS X related items and in the end I'm hardly the wiser. An example of confusing instructions : http://superuser.com/questions/324616/how-should-i-set-the-path-variable-on-my-mac-so-the-hombrew-installed-tools-are Whom to trust ?
But then I found this : http://coolestguidesontheplanet.com/add-shell-path-osx/ which suggests I should amend my .bash_profile and then export PATH.

But typing ls -a in Terminal does not show an existing .bash_profile. What now ? Is one automatically created when I follow instructions in the link above ? Or should it be created first ? All this before I can even begin to tackle Hugo ...


You'll get my drift : what command line veterans often take for granted (creating documentation) could be a virtual minefield for command line n00bs.
I know you can't provide documentation for every eventuality, but making a serious effort to sort out these little but critical installation issues should IMHO be an extremely worthwhile effort.

I'll report back here later with the result of your instructions.

Thanks for now !

Peter

slowbluesmaster

unread,
Sep 8, 2014, 6:01:23 AM9/8/14
to hugo-d...@googlegroups.com, d...@jsonified.com, blu35...@gmail.com
Steve !

I'm humbled by your presence in this topic and chuffed to see you acknowledge the trials and tribulations of a command line n00b.
Thank you for providing Hugo !

Peter

Adrian Simmons

unread,
Sep 10, 2014, 12:43:14 PM9/10/14
to hugo-d...@googlegroups.com, blu35...@gmail.com

On Monday, 8 September 2014 10:49:31 UTC+1, slowbluesmaster wrote:
 
On installing :
Apple has not seen fit to provide an empty /usr/local/bin directory with its latest OS X incarnations :
Create it, you'll likely need to use 'sudo' to gain admin permissions, it'll ask for your password.

sudo mkdir /usr/local/bin
 
so I thought I'd keep Hugo in plain sight : in a new folder named Hugo in my Applications folder. Because Hugo can be used from anywhere, it says so in the docs !
It can, but if you step off the beaten path you can find it harder to find your way :)

 
Apparently not the best idea/ I know I can create the missing /usr/local/bin directory with mkdir and then use it in Terminal. But why not have it my way ?
Because /usr/local/bin is usually in your $path by default (as you can see in the message you sent about the default path). No need to faff about adding it. You're actually making your life harder by not doing what everyone else does.

Also, conceptually, Applications is for GUI apps. OSX has lots of non-gui apps too, tucked away – try 'ls /usr/bin' for a look-see. And that's just one location...

HTH a little.

slowbluesmaster

unread,
Sep 10, 2014, 12:59:38 PM9/10/14
to hugo-d...@googlegroups.com, blu35...@gmail.com
Hi Adrian !

Thanks for your comments, much appreciated.
Unexpected RL issues have prevented me from following up on earlier instructions, but I'll intend to make up for that in the upcoming days.
I understand the different locations for GUI and CLI. Meanwhile I've discovered this free little OS X app : http://rixstep.com/1/20131101,00.shtml to educate myself.

Peter

slowbluesmaster

unread,
Sep 24, 2014, 9:20:19 AM9/24/14
to hugo-d...@googlegroups.com, blu35...@gmail.com
Dave,

I apologise for staying away so long with my promised results. Unexpected RL priorities ...

I've managed to create my missing /usr/local/bin (turned out /usr/local was also missing) and I've managed to move Hugo to that location.
Sadly the trying command hugo gives an error. A link to a Terminal screenshot showing various checks and result will perhaps teel you what you need to know to help me proceed


As you can see hugo is now in the correct directory and should be in my path at some point.
I knew this wasn't going to be a walkover, but getting this close means I'm willing to go the distance.

Will you please help me again ?

TIA

Peter


On Sunday, September 7, 2014 10:56:43 PM UTC+2, Dave Cottlehuber wrote:

Dave Cottlehuber

unread,
Sep 25, 2014, 4:54:11 AM9/25/14
to hugo-d...@googlegroups.com
> Dave,
>
> I apologise for staying away so long with my promised results. Unexpected
> RL priorities …

no worries, such is life.

> I've managed to create my missing /usr/local/bin (turned out /usr/local was
> also missing) and I've managed to move Hugo to that location.
> Sadly the trying command hugo gives an error. A link to a Terminal
> screenshot showing various checks and result will perhaps teel you what you
> need to know to help me proceed
>
> http://imgur.com/rkwjqPr
>
> As you can see hugo is now in the correct directory and should be in my
> path at some point.

The command line is the world’s most extreme pedant.

You’ve probably downloaded the .zip file, unpacked it, and then ended up with either a directory or the executable itself in a subfolder. from this output I can’t tell.

This should sort you out:

```
cd /usr/local/bin/
# see if hugo_0.12_darwin_amd64 is a directory or a file
ls -AFGhl
# ignore if this command fails
# we are just trying to change the directory
# if the directory doesnt change then it
# must be a file and if the dir does change
# then we are in the right place anyway and
# can simply rename the file
cd hugo_0.12_darwin_amd64
mv hugo_0.12_darwin_amd64 /usr/local/bin/hugo
# clean up any left over files and directories
rm -rf /usr/local/bin/hugo_*
# check to see if theres an executable file here now
cd /usr/local/bin/
ls -AFGhl
# we should see something like:
# -rwxr-xr-x  1 dch  staff    11M  1 Sep 14:17 hugo*
# the * says its executable
```

You can type `man ls` for an explanation on what those
AFGhl options do. I use this so often I added:

    alias l='/bin/ls -AFGhl'

into my shell profile.

HTH.

slowbluesmaster

unread,
Sep 25, 2014, 5:07:04 AM9/25/14
to hugo-d...@googlegroups.com
Awesome !

You'll forgive if I'm now merely a copy'n'paste guy, so here's what I got after running your example :


Back to you ...

Peter

Dave Cottlehuber

unread,
Sep 25, 2014, 5:11:55 AM9/25/14
to hugo-d...@googlegroups.com
Hmm

/usr/local should (IMHO) be readable / writable by you. I’ll leave discussing that for another day, but re-run all of those commands after doing:

   sudo -s

which puts you as admin/root.

then exit the shell, start a new one, and you should be good to (hu)go.


-----Original Message-----
From: slowbluesmaster <blu35...@gmail.com>
Reply: slowbluesmaster <blu35...@gmail.com>>
Date: 25. September 2014 at 11:07:07
To: hugo-d...@googlegroups.com <hugo-d...@googlegroups.com>>
> --
> Hugo
>
> A Fast and Flexible Static Site Generator built with love by spf13 and friends in Go
>
> Download the latest at https://github.com/spf13/hugo/releases
> ---
> You received this message because you are subscribed to the Google Groups "Hugo Discuss"
> group.
> To unsubscribe from this group and stop receiving emails from it, send an email to hugo-discuss...@googlegroups.com.
> To post to this group, send email to hugo-d...@googlegroups.com.
> Visit this group at http://groups.google.com/group/hugo-discuss.
> For more options, visit https://groups.google.com/d/optout.
>

Adrian Simmons

unread,
Sep 25, 2014, 8:10:26 AM9/25/14
to hugo-d...@googlegroups.com
On Thursday, 25 September 2014 10:07:04 UTC+1, slowbluesmaster wrote:

You'll forgive if I'm now merely a copy'n'paste guy, so here's what I got after running your example :


Yikes! Never cut and paste random stuff into a terminal like that, consequences can be unpredictable! To be brutally honest Peter unless you're willing to put a *bit* more effort into understanding what you're doing I'd steer clear of the terminal. You need to at least figure out which bits people are posting are comments and which the actual commands and only cut/paste the commands. I notice Dave very wisely put his comments in actual comments (lines starting with #) so they wouldn't do harm, but still...

That said: yes when you download hugo you get the executable, and it's named with the version etc like hugo_0.12_darwin_amd64, the terminal is pedantic and you'd only be able to use that by typing 'hugo_0.12_darwin_amd64' as opposed to 'hugo'. So you're one last step needs to be either renaming the executable or creating an alias linking /usr/bin/hugo to /usr/bin/hugo_0.12_darwin_amd64.

DO

Dave suggested renaming (mv is the move command):
cd /usr/local/bin/
sudo mv hugo_0.12_darwin_amd64 hugo 


OR DO

I'd suggest an alias (in unix terms its a called a 'soft link' – ln is the link command):
cd /usr/local/bin/
sudo ln -s hugo_0.12_darwin_amd64 hugo


Whichever you do, after you've finished do:

ls -al /usr/local/bin

To check what you actually ended up with and let us know too,

slowbluesmaster

unread,
Sep 26, 2014, 4:51:49 AM9/26/14
to hugo-d...@googlegroups.com
Adrian,

Thank you for stepping up to the plate.

While I feel suitably castigated I've been told on occasion that I'm not a complete idiot. I can distinguish comments from actual commands and Dave has explained his terminology in an earlier comment. I'd also like to add that I've put quite a lot of effort into learning the most elementary terminal commands. At least Google knows, that's for sure ;-)

My feedback to date may seem moronic to those living in their terminal, but I can assure you it's extremely frustrating to find that my efforts keep me running into unexpected walls. I'm just not willing to be too adventurous without guidance from those I trust
 But maybe you're right and I should just take the easy route and capitulate. Or perhaps wait for hugo to come with a foolproof install script.

But please be advised that I do appreciate you trying to help me, so here we go.

I ran your

cd /usr/local/bin/
sudo mv hugo_0.12_darwin_amd64 hugo

which showed the renaming was successful and then tried

hugo

again, which resulted in another series of errors, see my screenshot


But I think some progress was made ...
Message has been deleted

michael henderson

unread,
Sep 28, 2014, 3:12:35 PM9/28/14
to hugo-d...@googlegroups.com


On Friday, September 26, 2014 3:51:49 AM UTC-5, slowbluesmaster wrote:
I ran your

cd /usr/local/bin/
sudo mv hugo_0.12_darwin_amd64 hugo

which showed the renaming was successful and then tried

hugo

again, which resulted in another series of errors, see my screenshot


But I think some progress was made ...


I just saw this response. You've installed hugo correctly and your path is set up correctly. That comment about the "Static" directory is a rite of passage. You have to create a new site now.

```
cd ~/Documents && hugo  new site test
```
This will create a new hugo site in your Documents directory.

You get to it by running

```
cd ~/Documents/test
```
Once you're there, the hugo command will start doing what you're expecting.

```

hugo

```

That results in the following output:

  0 draft content 

  0 future content 

  0 pages created 

  0 tags created

  0 categories created

  in 3 ms

Now you'll just have to install a theme and you'll be off and running.

Oh, when you install the theme, please don't forget to update config.toml and add 'theme = "yourThemeName"' as the first line. If you do that, then you won't have to remember to use "--theme=yourThemeName" every time you generate content.


Mike

slowbluesmaster

unread,
Sep 30, 2014, 5:49:01 AM9/30/14
to hugo-d...@googlegroups.com
Thanks Mike ! Very helpful, much appreciated.

Peter
Reply all
Reply to author
Forward
0 new messages