title: How do I install one of Github Pages' Jekyll themes for local preview?
body: <p>I'm trying to install Github Pages' <a href="https://github.com/pages-themes/slate" rel="nofollow noreferrer">Slate theme</a> on my CentOS 7 VM so I can locally preview my <em>new</em> site using the <code>bundle exec jekyll serve</code> command.</p>
  
  <p>I followed the instructions as best as I could.</p>
  
  <ul>
  <li>I changed the theme <code>minima</code> to <code>jekyll-theme-slate</code> in my <code>_config.yml</code> file.</li>
  <li>Then I changed <code>gem "minima", "~&gt; 2.0"</code>  to <code>gem "github-pages", group: :jekyll_plugins</code> in my <code>Gemfile</code> file.</li>
  </ul>
  
  <p>After that (since these are their only instructions), I ran <code>bundle exec jekyll serve</code> and it told me I had gems that weren't installed (duh), and suggested running <code>bundle install</code>.</p>
  
  <ul>
  <li>I ran <code>bundle install</code>, which told me there was a conflict in version types of the dependencies and it suggested that <code>bundle update</code> could potentially resolve that issue.</li>
  <li>No problem, I ran <code>bundle update</code>. A few plugins/features actually reverted versions here, but I got the Slate theme installed on my machine now, version <code>0.0.4</code> for whatever reason.</li>
  </ul>
  
  <p>After that, I ran <code>bundle exec jekyll serve</code> again. I got this error:</p>
  
  <pre><code>Configuration file: /home/peri/my-site/_config.yml
  Configuration file: /home/peri/my-site/_config.yml
  jekyll 3.4.3 | Error:  Could not find a JavaScript runtime. See https://github.com/rails/execjs for a list of available runtimes.
  </code></pre>
  
  <p>In a way, that error makes sense. For a custom theme to work, I probably need a tool to run their custom scripts. But first, I noticed <a href="https://github.com/pages-themes/slate#previewing-the-theme-locally" rel="nofollow noreferrer">this extra section</a> in the theme's installation instructions, which directly mentions being able to locally preview the site with that theme.</p>
  
  <ul>
  <li>I downloaded the source, instead of cloning it...I don't need the <code>.git</code> stuff do I?</li>
  <li>I edited the <code>script/bootstrap</code> file because <code>/usr/local</code> requires root and using <code>sudo</code> doesn't know about any binary called <code>gem</code> or <code>bundle</code>. I changed <code>gem</code> and <code>bundle</code> to their respective absolute paths and ran <code>sudo ./script/bootstrap</code> inside of <code>slate-master</code>.</li>
  </ul>
  
  <p>Point of the story is, it didn't work for my <code>home/peri/my-site</code> directory when I ran <code>bundle exec jekyll serve</code>. Presumably, it's because they intended for the user's site to be integrated into their theme's source code? That doesn't seem intuitive or correct. So, I investigated <a href="https://github.com/rails/execjs" rel="nofollow noreferrer">ExecJS</a>.</p>
  
  <ul>
  <li>I installed it. <code>gem install execjs</code></li>
  <li>I added <code>gem "execjs", "2.7.0"</code> to my <code>Gemfile</code> file.</li>
  </ul>
  
  <p>Got the same error as before.</p>
  
  <blockquote>
    <p>How am I supposed to install this Jekyll theme?</p>
  </blockquote>