Jekyll2023-02-11T18:47:49+00:00https://damian-romero.github.io//feed.xmlDamian Romero,
Computational Hispanic LinguistDamian Romero's professional website.Damian RomeroSolve macOS BigSur ‘xcrun: error’ and fix Jekyll/Homebrew environment issues after update2020-12-29T22:00:00+00:002020-12-29T22:00:00+00:00https://damian-romero.github.io//blog/solve-xcrun-error-and-fix-jekyll-environment-after-macos-bigsur-update<p><em>If you only want the solution of the issue at hand, I suggest skipping to the <a href="#full-fix">“Full fix”</a> section.</em></p>
<h2 id="background-and-some-tips-on-updating-your-operating-system">Background and some tips on updating your operating system</h2>
<p>When a new version of an operating system comes out, I usually don’t install it right away unless it’s absolutely necessary. So when Apple rolled out its latest macOS (BigSur) back in November 2020, I decided to wait, especially since the University of Arizona warned its employees that there might be some compatibility issues regarding <a href="https://www.sophos.com/">Sophos security software</a> (which I use).</p>
<p>However, it is finally winter break, and it was time to update to the newest OS. I knew I would have to fix several things in my development environment, so I <strong>backed up my computer to an external drive</strong> just in case I needed to revert to my previous OS for any reason.</p>
<p>When I finally updated to BigSur, I was happy that I delayed my update because Sophos, Anaconda, and Git were all working correctly. However, I wanted to add some content to my website, and that is where I hit the jackpot. The command <code class="language-plaintext highlighter-rouge">bundle exec jekyll serve</code> was not working. Here is what happened and how I was able to solve the issue:</p>
<h2 id="full-fix">Full fix</h2>
<p>After updating to BigSur, I wanted to add content to my website, so I went through the usual steps:</p>
<div class="language-bash highlighter-rouge"><div class="highlight"><pre class="highlight"><code>bundle <span class="nb">exec </span>jekyll serve
</code></pre></div></div>
<p>This resulted in the following error:</p>
<div class="language-plaintext highlighter-rouge"><div class="highlight"><pre class="highlight"><code>Could not find concurrent-ruby-1.1.7 in any of the sources
Run `bundle install` to install missing gems.
</code></pre></div></div>
<p>Just running <code class="language-plaintext highlighter-rouge">bundle install</code> will throw a permission error, so I ran it with sudo:</p>
<div class="language-plaintext highlighter-rouge"><div class="highlight"><pre class="highlight"><code>sudo bundle install
</code></pre></div></div>
<p>But this failed again with:</p>
<div class="language-plaintext highlighter-rouge"><div class="highlight"><pre class="highlight"><code>An error occurred while installing json (2.3.1), and Bundler cannot continue.
Make sure that `gem install json -v '2.3.1' --source 'https://rubygems.org/'` succeeds before bundling
</code></pre></div></div>
<p>However, running <code class="language-plaintext highlighter-rouge">gem install json -v '2.3.1' --source 'https://rubygems.org/</code> also failed, prompting me to <code class="language-plaintext highlighter-rouge">install ruby-dev</code> or <code class="language-plaintext highlighter-rouge">ruby-devel</code>, so I tried to update brew first and see what happened:</p>
<div class="language-bash highlighter-rouge"><div class="highlight"><pre class="highlight"><code>brew update
</code></pre></div></div>
<p>Sure enough, I got to the root of the problem when I hit a <code class="language-plaintext highlighter-rouge">missing xcrun</code> error:</p>
<div class="language-plaintext highlighter-rouge"><div class="highlight"><pre class="highlight"><code>invalid active developer path (/Library/Developer/CommandLineTools), missing xcrun at: /Library/Developer/CommandLineTools/usr/bin/xcrun
</code></pre></div></div>
<p><a href="https://dev.to/o9uzdev/macos-xcrun-error-invalid-active-developer-path-missing-xcrun-411a">Googling around</a>, it turned out that the issue could be solved simply by re-installing xcode (step 1 in the <a href="https://jekyllrb.com/docs/installation/macos/">Jekyll documentation pre-requisites</a>)</p>
<div class="language-bash highlighter-rouge"><div class="highlight"><pre class="highlight"><code>xcode-select <span class="nt">--install</span>
</code></pre></div></div>
<p>Later, I found out that I needed to make one small change to my <code class="language-plaintext highlighter-rouge">.gitignore</code> file. I needed to add <a href="https://jekyllrb.com/tutorials/using-jekyll-with-bundler/">the full <code class="language-plaintext highlighter-rouge">/vendor/</code> directory</a> as opposed to just the <code class="language-plaintext highlighter-rouge">/vendor/bundle</code> which was sufficient in macOs Catalina:</p>
<div class="language-diff highlighter-rouge"><div class="highlight"><pre class="highlight"><code><span class="gh">diff --git a/.gitignore b/.gitignore
index 7d3f845..68a8ee8 100644
</span><span class="gd">--- a/.gitignore
</span><span class="gi">+++ b/.gitignore
</span><span class="p">@@ -77,6 +77,7 @@</span> build-iPhoneSimulator/
## Environment normalization:
/.bundle/
<span class="gi">+/vendor/
</span> /vendor/bundle
/lib/bundler/man/
</code></pre></div></div>
<p>Now you can just run <code class="language-plaintext highlighter-rouge">bundle install</code> (no sudo!) and this will get the correct configuration for your project.</p>
<div class="language-bash highlighter-rouge"><div class="highlight"><pre class="highlight"><code>bundle <span class="nb">install
</span>bundle <span class="nb">exec </span>jekyll serve
</code></pre></div></div>
<p><strong>Note that you do not need to install the <code class="language-plaintext highlighter-rouge">ruby-dev</code> or <code class="language-plaintext highlighter-rouge">ruby-devel</code> environments.</strong></p>
<p>Also, as a side-effect, your <code class="language-plaintext highlighter-rouge">Homebrew</code> environment is also fixed.</p>
<div class="language-bash highlighter-rouge"><div class="highlight"><pre class="highlight"><code>brew update
<span class="c"># works</span>
</code></pre></div></div>
<h2 id="takeaways">Takeaways</h2>
<p>When updating to a new OS, I will minimally follow the checklist below:</p>
<ul>
<li>Get information about the new release.
<ul>
<li>Pay attention to what the developers of your most frequently used tools say about a new big release. In my case these are:
<ul>
<li>Python, Anaconda, Homebrew, Git & GitHub, my antivirus software, among others</li>
</ul>
</li>
<li>(Re)read all IT team’s emails regarding the subject.</li>
<li>Search the internet for possible issues of switching too quickly.</li>
</ul>
</li>
<li>If possible, allow 3-6 months before installing a big release.
<ul>
<li>For security reasons, smaller releases should almost always be installed asap, except when there is a known security issue.</li>
</ul>
</li>
<li>Make sure I have enough time to back up and solve any issues that might come up during or after the process.</li>
<li>Back up my computer right before updating my OS (apart from my weekly backup).</li>
<li>Once I have completed my backup and before working on anything else, i will check that my most essential tools are working correctly.</li>
</ul>
<h2 id="thats-it">That’s it!</h2>
<p>I hope this is useful for people trying to fix their Jekyll environments.</p>
<p>Special thanks to <a href="https://dev.to/o9uzdev">o9uz.dev</a> for <a href="https://dev.to/o9uzdev/macos-xcrun-error-invalid-active-developer-path-missing-xcrun-411a">this post</a> in dev.to and to Ernest Ojeh for <a href="https://ernestojeh.com/fix-jekyll-on-macos-big-sur">this post</a> pre-<a href="https://brew.sh/2020/12/01/homebrew-2.6.0/">2.60 homebrew</a>, and of course to all the folks at Apple and Homebrew. So far I am enjoying my BigSur experience.</p>
<p>And remember to…</p>
<p>Jump higher!</p>
<p>- Damian</p>
<p>
<img alt="Visitors" src="https://visitor-badge.glitch.me/badge?page_id=damian-romero/damian-romero.github.io/blob/master/_posts/2020-12-29-solve-xcrun-error-and-fix-jekyll-environment-after-macos-bigsur-update.md" />
</p>Damian RomeroHere is how I fixed my Jekyll (and Homebrew) environments on macOS BigSur and some tips on what to do before updating your Operating System.How I built this website2020-12-26T22:00:00+00:002020-12-26T22:00:00+00:00https://damian-romero.github.io//blog/how-i-built-this-website<p>This is a very quick walkthrough of how I built this website in an afternoon using the <a href="https://github.com/mmistakes/minimal-mistakes"><code class="language-plaintext highlighter-rouge">Minimal Mistakes template</code></a> for Jekyll. Read this article to learn more!</p>
<p>I have summarized the steps to the bare minimum you need to get started with your own website. For more detailed/additional information you can always consult the <a href="#resources">resources section</a> below.</p>
<p>For this project I used a machine running MacOs Catalina. These steps may or may not work depending on your Operating System and version.</p>
<h2 id="minimal-steps-i-took">Minimal steps I took:</h2>
<h3 id="i-install-prerequisites">I. Install Prerequisites</h3>
<p>I installed the <a href="https://jekyllrb.com/docs/installation/macos/">Jekyll prerequisites for MacOs</a> (reproduced below). You can also look at the official prerequisites documentation <a href="https://jekyllrb.com/docs/installation/">here</a>.</p>
<div class="language-bash highlighter-rouge"><div class="highlight"><pre class="highlight"><code><span class="c">## Install xcode if you haven't</span>
xcode-select <span class="nt">--install</span>
<span class="c"># You will need homebrew</span>
/bin/bash <span class="nt">-c</span> <span class="s2">"</span><span class="si">$(</span>curl <span class="nt">-fsSL</span> https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh<span class="si">)</span><span class="s2">"</span>
<span class="c"># Use homebrew to install Ruby (you may need to restart your terminal)</span>
brew <span class="nb">install </span>ruby
<span class="c"># Add the following line to your .zshrc or your .bash_profile</span>
<span class="nv">PATH</span><span class="o">=</span><span class="s2">"/usr/local/opt/ruby/bin:</span><span class="nv">$PATH</span><span class="s2">"</span>
<span class="c"># Relaunch your terminal or source it:</span>
<span class="nb">source</span> ~/.zshrc <span class="c"># For Zsh</span>
<span class="nb">source</span> ~/.bash_profile <span class="c"># for Bash</span>
</code></pre></div></div>
<h3 id="ii-install-jekyll-and-bundler-gems">II. Install <code class="language-plaintext highlighter-rouge">Jekyll</code> and <code class="language-plaintext highlighter-rouge">bundler</code> gems</h3>
<div class="language-bash highlighter-rouge"><div class="highlight"><pre class="highlight"><code>gem <span class="nb">install</span> <span class="nt">--user-install</span> bundler jekyll
<span class="c">## Get your Ruby version:</span>
ruby <span class="nt">--version</span> <span class="c"># You will get something like 2.7.3</span>
<span class="c"># Add the following line to your .zshrc or your .bash_profile</span>
<span class="c"># BUT replace the X.X with the first two digits of your ruby version</span>
<span class="nv">PATH</span><span class="o">=</span><span class="s2">"</span><span class="nv">$HOME</span><span class="s2">/.gem/ruby/X.X.0/bin:</span><span class="nv">$PATH</span><span class="s2">"</span> <span class="c"># Example for version 2.7.3: PATH="$HOME/.gem/ruby/2.7.0/bin:$PATH"</span>
</code></pre></div></div>
<h3 id="iii-create-a-github-repo-with-the-minimal-mistakes-theme-starter">III. Create a GitHub repo with the Minimal Mistakes theme starter</h3>
<ol>
<li>I clicked on the <a href="https://github.com/mmistakes/mm-github-pages-starter/generate">Minimal Mistakes</a> theme starter on GitHub as my starting point. I named my repository with my user name <code class="language-plaintext highlighter-rouge">damian-romero</code> and the suffix <code class="language-plaintext highlighter-rouge">.github.io</code>. This will:
<ul>
<li>Generate a personal website hosted on GitHub (<a href="https://jekyllrb.com/docs/github-pages/">GitHub pages</a>) with the contents of your repository as <code class="language-plaintext highlighter-rouge">username.github.io</code>.</li>
<li>Allow you to work and test locally on your computer before you push any changes to your website.</li>
<li>The <code class="language-plaintext highlighter-rouge">theme starter repo</code> that you click on already contains the correctly generated Gemfile that you need to use for GitHub pages, so I did not need to follow the <a href="https://mmistakes.github.io/minimal-mistakes/docs/quick-start-guide/#remote-theme-method">instructions for using the Minimal Mistakes as a remote theme</a>.</li>
</ul>
</li>
</ol>
<p>* Note: If you do not have a GitHub account, go to the <a href="#resources">resources</a> section and follow the link. You will need to learn how to use Git as well.</p>
<h3 id="iv-test-your-site-locally">IV. Test your site locally</h3>
<p>You can test your site on your computer before you push it to your remote.</p>
<div class="language-bash highlighter-rouge"><div class="highlight"><pre class="highlight"><code>bundle <span class="nb">exec </span>jekyll serve
<span class="c"># Go to http://127.0.0.1:4000 on your browser and look at your website</span>
<span class="c"># Press ctrl + c to quit at any time</span>
</code></pre></div></div>
<p>Note that, if you get an error saying <code class="language-plaintext highlighter-rouge">ERROR '/favicon.ico' not found</code>, it may mean you need to run the above command from the root directory of your git repository.</p>
<h3 id="v-start-adding-content">V. Start adding content</h3>
<ol>
<li>In the sub-directory <code class="language-plaintext highlighter-rouge">_pages</code> you can add any markdown on html pages you want. Then you can display them by adding them to the <code class="language-plaintext highlighter-rouge">_data/navigation.yml</code> file. For instance, at the top of my page you can see <code class="language-plaintext highlighter-rouge">Home</code>, <code class="language-plaintext highlighter-rouge">About</code>, etc. These are <a href="https://www.markdownguide.org/basic-syntax/">markdown</a> or html files that are listed in <code class="language-plaintext highlighter-rouge">_data/navigation.yml</code> as below:</li>
</ol>
<div class="language-yml highlighter-rouge"><div class="highlight"><pre class="highlight"><code><span class="na">main</span><span class="pi">:</span>
<span class="pi">-</span> <span class="na">title</span><span class="pi">:</span> <span class="s2">"</span><span class="s">Home"</span>
<span class="na">url</span><span class="pi">:</span> <span class="s">https://d-romero.com/</span>
<span class="pi">-</span> <span class="na">title</span><span class="pi">:</span> <span class="s2">"</span><span class="s">About"</span>
<span class="na">url</span><span class="pi">:</span> <span class="s">/about/</span>
<span class="pi">-</span> <span class="na">title</span><span class="pi">:</span> <span class="s2">"</span><span class="s">Portfolio"</span>
<span class="na">url</span><span class="pi">:</span> <span class="s">/portfolio/</span>
<span class="pi">-</span> <span class="na">title</span><span class="pi">:</span> <span class="s2">"</span><span class="s">MCEC"</span>
<span class="na">url</span><span class="pi">:</span> <span class="s">/mcec_project/</span>
<span class="pi">-</span> <span class="na">title</span><span class="pi">:</span> <span class="s2">"</span><span class="s">News"</span>
<span class="na">url</span><span class="pi">:</span> <span class="s">/news/</span>
</code></pre></div></div>
<ol>
<li>Play around with your _config.yml file.
<ul>
<li>The _config.yml file is not loaded dynamically as the other contents of your website so you will need to run <code class="language-plaintext highlighter-rouge">bundle exec jekyll serve</code> every time you make a change</li>
<li>Look for inspiration from the full _config.yml file in the Minimal Mistakes GitHub repo: https://github.com/mmistakes/minimal-mistakes/blob/master/_config.yml</li>
</ul>
</li>
<li>Add <code class="language-plaintext highlighter-rouge">posts</code> as markdown files to your <code class="language-plaintext highlighter-rouge">_posts</code>. Posts have a specific structure. For an example look at my first posts <a href="https://github.com/damian-romero/damian-romero.github.io/blob/master/_posts/2020-12-03-welcome.md">here</a></li>
<li>Further develop your site. You can follow the Minimal Mistakes customization documentation <a href="https://mmistakes.github.io/minimal-mistakes/docs/configuration/">here</a>.</li>
</ol>
<h3 id="vi-push-to-remote">VI. Push to remote</h3>
<p>Once you are happy with your progress, follow the normal <a href="https://docs.github.com/en/free-pro-team@latest/github/using-git/git-workflows">Git/GitHub steps</a> to push to remote. <strong>Make sure you are not pushing any confidential information</strong></p>
<div class="language-bash highlighter-rouge"><div class="highlight"><pre class="highlight"><code>git add <span class="nt">-A</span>
git commit <span class="nt">-m</span> <span class="s1">'First commit'</span>
git push
</code></pre></div></div>
<h3 id="vii-visit-your-site">VII. Visit your site</h3>
<div class="language-bash highlighter-rouge"><div class="highlight"><pre class="highlight"><code>open https://username.github.io <span class="c"># replace 'username' with your user name</span>
</code></pre></div></div>
<h3 id="viii-custom-domain">VIII. Custom domain</h3>
<p>Because I wanted to have my custom domain instead of using <code class="language-plaintext highlighter-rouge">https://damian-romero.github.io</code>, I did the following (I linked a YouTube video tutorial on how to set up your custom domain in the references section, although it was a bit outdated):</p>
<ol>
<li>I got a <a href="http://domains.google.com/">Google domain</a> for $12 USD per year.</li>
<li>I created a text file inside my repository called <code class="language-plaintext highlighter-rouge">CNAME</code> (no file extension). The only content in this file is the domain for my website (d-romero.com)
<div class="language-bash highlighter-rouge"><div class="highlight"><pre class="highlight"><code><span class="nb">cd </span>my/repo/directory
<span class="nb">touch </span>CNAME
<span class="nb">echo </span>d-romero.com <span class="o">>></span> CNAME
</code></pre></div> </div>
</li>
<li>Once I had my domain, I had to point my site to GitHub:
<ul>
<li>I went to <code class="language-plaintext highlighter-rouge">My domains</code> on the side bar.</li>
<li>I clicked on the domain I wanted to use (I’ve got several, but for this case I wanted to use d-romero.com)</li>
<li>I clicked on the the <code class="language-plaintext highlighter-rouge">DNS</code> link on the side bar.</li>
<li>I scrolled down to <code class="language-plaintext highlighter-rouge">Custom resource records</code>.</li>
<li>I followed the official <a href="https://docs.github.com/en/free-pro-team@latest/github/working-with-github-pages/managing-a-custom-domain-for-your-github-pages-site">GitHub documentation</a> and created an “A” record with the following IP addresses:
<ul>
<li>185.199.108.153</li>
<li>185.199.109.153</li>
<li>185.199.110.153</li>
<li>185.199.111.153</li>
</ul>
</li>
<li>I created an additional record as such:
<ul>
<li>www CNAME 1h damian-romero.github.io</li>
</ul>
</li>
</ul>
</li>
</ol>
<p>The result looks like this:</p>
<p><img src="/assets/images/custom-resource-records.png" alt="records" /></p>
<h1 id="ix-that-is-it">IX That is it!</h1>
<p>You’ve made it. Now you’re the proud owner of your personal website.</p>
<h2 id="resources">Resources</h2>
<ul>
<li><a href="https://github.com/">GitHub</a></li>
<li><a href="https://git-scm.com/">Git</a>
<ul>
<li><a href="https://github.com/damian-romero/gitflow_toy/blob/develop/resources/useful_links.md">Some git and GitHub resources</a></li>
</ul>
</li>
<li><a href="https://jekyllrb.com/">Jekyll</a>
<ul>
<li><a href="https://docs.github.com/en/free-pro-team@latest/github/working-with-github-pages/setting-up-a-github-pages-site-with-jekyll">Learn more about GitHub pages and Git</a></li>
</ul>
</li>
<li><a href="https://mmistakes.github.io/minimal-mistakes/">Minimal Mistakes</a>
<ul>
<li><a href="https://github.com/mmistakes/mm-github-pages-starter">Minimal Mistakes Theme Starter repo</a></li>
</ul>
</li>
<li><a href="https://youtu.be/nN6QuNqmAwk?t=234">Custom domain YouTube tutorial</a></li>
<li><a href="https://docs.github.com/en/free-pro-team@latest/github/working-with-github-pages/managing-a-custom-domain-for-your-github-pages-site">Custom GitHub domain configuration documentation</a></li>
<li><a href="https://docs.github.com/en/free-pro-team@latest/github/working-with-github-pages/configuring-a-custom-domain-for-your-github-pages-site">Configuring a custom domain for your GitHub Pages site</a></li>
<li><a href="https://www.markdownguide.org/basic-syntax/">Learn markdown</a></li>
</ul>
<p>You can check out my website repository <a href="https://github.com/damian-romero/damian-romero.github.io">here</a></p>
<hr />
<p>Jump higher!</p>
<p>- Damian</p>
<!-- Visitor counter -->
<p>
<img alt="Visitors" src="https://visitor-badge.glitch.me/badge?page_id=damian-romero/damian-romero.github.io/blob/master/_posts/2020-12-26-how-i-built-this-website.md" />
</p>Damian RomeroThis is a very quick walkthrough of how I built this website in an afternoon using the Minimal Mistakes template for Jekyll. Read this article to learn more!Welcome to my new website!2020-12-03T22:00:00+00:002020-12-03T22:00:00+00:00https://damian-romero.github.io//blog/welcome<p>Hi, Damian here. Welcome to my website! Please feel free to navigate around and do contact me if you have any questions or collaboration ideas.</p>
<p>I confess that, for building this website, I was trying to use (and even forked) the <a href="https://github.com/academicpages/academicpages.github.io">Academic Pages</a> template, which is based on <a href="https://github.com/mmistakes/minimal-mistakes"><code class="language-plaintext highlighter-rouge">Minimal Mistakes</code></a>. Still, I was seduced by the original, plus I believe that Academic Pages is not being maintained at the moment of writing.</p>
<p>For a full (but concise) walkthrough about how I built my website using Jekyll, GitHub, and Minimal Mistakes on MacOs Catalina, please navigate to the following link: <a href="[link](https://d-romero.com/blog/how-i-built-this-website/)">‘How I built this website’</a></p>
<p>And remember to…</p>
<p>Jump higher!</p>
<p>- Damian</p>
<p align="center"><img src="https://data.library.arizona.edu/sites/default/files/styles/uaqs_medium/public/images/people/IMG_1131-edited.jpg?itok=7LftX1hx" /></p>
<p>
<img alt="Visitors" src="https://visitor-badge.glitch.me/badge?page_id=damian-romero/damian-romero.github.io/blob/master/_posts/2020-12-03-welcome.md" />
</p>Damian RomeroHi, Damian here. Welcome to my website! Please feel free to navigate around and do contact me if you have any questions or collaboration ideas.