# How to build and test website locally

**URL:** <https://forum.graphviz.org/t/how-to-build-and-test-website-locally/160>\
**Category:** Dev\
**Created:** [June 3, 2020, 3:41pm UTC](https://forum.graphviz.org/t/how-to-build-and-test-website-locally/160 "2020-06-03T15:41:20Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![scnorth](https://sea2.discourse-cdn.com/graphviz/user_avatar/forum.graphviz.org/scnorth/32/89_2.png) [@scnorth](https://forum.graphviz.org/u/scnorth)\
**Post date:** [June 3, 2020, 3:41pm UTC](https://forum.graphviz.org/t/how-to-build-and-test-website-locally/160/1 "2020-06-03T15:41:20Z")

</div>

Hi - does anyone here do this? I mean pull from [git@gitlab.com](mailto:git@gitlab.com):graphviz/graphviz.gitlab.io.git  
and build this, and open localhost:something and  
see at least the top of the website.

Or are you testing some other way? How?

It has been several years, so I’ve forgotten how to do this manually. I realize the links in the website may refer to the canonical URL (now [graphviz.org](http://graphviz.org)) so possibly this doesn’t get very far but I wanted to see.

I tried to follow [Edit this website locally | GitLab](https://about.gitlab.com/handbook/git-page-update/)  
and got to step 7, NO\_CONTRACTS=true bundle exec middleman  
but eventually I run into  
$ bundler: failed to load command: middleman (/usr/local/lib/ruby/gems/2.7.0/bin/middleman)

Despite having installed middleman, done the bundler install, etc. I’ve tried setting GEM\_ROOT, I’ve checked that /usr/local/opt/ruby/bin/ruby is there, I’ve checked that $GEM\_ROOT/middleman-1.2.8 exists, so I must be missing something obvious.

SCN

---

<div class="post-metadata">

**Author:** ![mark](https://sea2.discourse-cdn.com/graphviz/user_avatar/forum.graphviz.org/mark/32/84_2.png) [@mark](https://forum.graphviz.org/u/mark)\
**Post date:** [June 4, 2020, 9:51am UTC](https://forum.graphviz.org/t/how-to-build-and-test-website-locally/160/2 "2020-06-04T09:51:02Z")

</div>

Hi Stephen, thanks for asking – I should document this better!

I think [Edit this website locally | GitLab](https://about.gitlab.com/handbook/git-page-update/) is a red herring - it’s how to update the docs for the GitLab product, not the Graphviz docs.

I assume you’re on Mac? Here’s how I run the graphviz docs locally on macOS

```auto
# Get a new version of Ruby, as the macOS version is old
$ brew install ruby
# Install all the gems in Gemfile
$ /usr/local/opt/ruby/bin/bundle install
# Start an HTTP server
$ /usr/local/opt/ruby/bin/bundle exec jekyll serve

```

---

<div class="post-metadata">

**Author:** ![mark](https://sea2.discourse-cdn.com/graphviz/user_avatar/forum.graphviz.org/mark/32/84_2.png) [@mark](https://forum.graphviz.org/u/mark)\
**Post date:** [June 4, 2020, 10:03am UTC](https://forum.graphviz.org/t/how-to-build-and-test-website-locally/160/3 "2020-06-04T10:03:27Z")

</div>

I’ve just added a README.md to the docs repo documenting this: [https://gitlab.com/graphviz/graphviz.gitlab.io/-/merge\_requests/92](https://gitlab.com/graphviz/graphviz.gitlab.io/-/merge_requests/92)

---

<div class="post-metadata">

**Author:** ![magjac](https://sea2.discourse-cdn.com/graphviz/user_avatar/forum.graphviz.org/magjac/32/16_2.png) [@magjac](https://forum.graphviz.org/u/magjac)\
**Post date:** [June 25, 2020, 1:50pm UTC](https://forum.graphviz.org/t/how-to-build-and-test-website-locally/160/4 "2020-06-25T13:50:57Z")

</div>

From the README: “Assuming you have a recent Ruby version installed:”

Does this count as recent?

```auto
magjac@t440:~/graphviz.gitlab.io$ ruby --version
ruby 2.6.5p114 (2019-10-01 revision 67812) [x86_64-linux]

```

It sort of works but not fully. The page looks like this:

 ![image](https://global.discourse-cdn.com/graphviz/original/1X/cb570c018b21c794e7716d5c13cff17f0af161cf.png)

And the log is:

```auto
magjac@t440:~/graphviz.gitlab.io$ bundle exec jekyll serve
Configuration file: /home/magjac/graphviz.gitlab.io/_config.yml
            Source: /home/magjac/graphviz.gitlab.io
       Destination: /home/magjac/graphviz.gitlab.io/_site
 Incremental build: disabled. Enable with --incremental
      Generating... 
                    done in 0.55 seconds.
 Auto-regeneration: enabled for '/home/magjac/graphviz.gitlab.io'
        **ERROR: directory is already being watched!**

        Directory: /home/magjac/graphviz.gitlab.io/_pages/Gallery

        is already being watched through: /home/magjac/graphviz.gitlab.io/_pages/Gallery

        MORE INFO: https://github.com/guard/listen/wiki/Duplicate-directory-errors
    Server address: http://127.0.0.1:4000/
  Server running... press ctrl-c to stop.

```

---

<div class="post-metadata">

**Author:** ![mark](https://sea2.discourse-cdn.com/graphviz/user_avatar/forum.graphviz.org/mark/32/84_2.png) [@mark](https://forum.graphviz.org/u/mark)\
**Post date:** [June 25, 2020, 10:30pm UTC](https://forum.graphviz.org/t/how-to-build-and-test-website-locally/160/5 "2020-06-25T22:30:38Z")

</div>

That should work…

[https://jekyllrb.com/docs/installation/#requirements](https://jekyllrb.com/docs/installation/#requirements) says ruby 2.5.0 is the min requirement.

Looks like the errors are related to file watching. we have some symlinks to directories like Gallery… it worked on my Mac but maybe that doesn’t work with file watching cross platform.

Try removing the Gallery symlink (I think from either / or /\_pages/) and see if that works?
