<?xml version="1.0" encoding="utf-8"?><feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en_US"><generator uri="https://jekyllrb.com/" version="4.4.1">Jekyll</generator><link href="https://accidentaltechnologist.com/feed.xml" rel="self" type="application/atom+xml" /><link href="https://accidentaltechnologist.com/" rel="alternate" type="text/html" hreflang="en_US" /><updated>2025-09-18T10:38:52-04:00</updated><id>https://accidentaltechnologist.com/feed.xml</id><title type="html">Accidental Technologist</title><subtitle>Musings about Entrepreneurship, Technology and Software Development.</subtitle><author><name>Rob Bazinet</name><email>rbazinet@accidentaltechnologist.com</email></author><entry><title type="html">Goodbye WordPress, Hello Jekyll</title><link href="https://accidentaltechnologist.com/general/technology/2025/08/30/goodbye-wordpress.html" rel="alternate" type="text/html" title="Goodbye WordPress, Hello Jekyll" /><published>2025-08-30T21:43:00-04:00</published><updated>2025-08-30T21:43:00-04:00</updated><id>https://accidentaltechnologist.com/general/technology/2025/08/30/goodbye-wordpress</id><content type="html" xml:base="https://accidentaltechnologist.com/general/technology/2025/08/30/goodbye-wordpress.html"><![CDATA[<p>I have been using WordPress for many years but I never loved it. Actually, I never liked it.</p>

<p>It has been a long time since my last post, almost 2 1/2 years ago. Where does the time go. So many life changes. So many things to talk about. and</p>

<p>I am hoping it motivates me to start writing on a regular cadence. Writing is a great way to clear ones head, to work out thoughts and ideas.</p>

<p>I’m looking forward it…</p>

<p>I moved over the posts I had under WordPress and have noticed some weird formatting and layout. Give me some time over the next couple weeks to fix up those conversion errors.</p>]]></content><author><name>Rob Bazinet</name></author><category term="General" /><category term="Technology" /><category term="Jekyll" /><category term="WordPress" /><category term="blogging" /><category term="static site" /><summary type="html"><![CDATA[I have been using WordPress for many years but I never loved it. Actually, I never liked it.]]></summary></entry><entry><title type="html">Social Media Times Are Changing</title><link href="https://accidentaltechnologist.com/technology/social-media-times-are-changing/" rel="alternate" type="text/html" title="Social Media Times Are Changing" /><published>2023-03-27T11:36:01-04:00</published><updated>2023-03-27T11:36:01-04:00</updated><id>https://accidentaltechnologist.com/technology/social-media-times-are-changing</id><content type="html" xml:base="https://accidentaltechnologist.com/technology/social-media-times-are-changing/"><![CDATA[<p>It has been interesting to follow the story of <a href="https://twitter.com">Twitter</a> going from public company to being <a href="https://www.nytimes.com/2022/10/27/technology/elon-musk-twitter-deal-complete.html">purchased by Elon Musk</a> for more money than I could ever imagine. Since that time it seems like you either love or hate Musk as the owner of a private Twitter. He’s a way better business person that I will ever be so I trust he has plans for the service that we will see over time.</p>

<p>Many people I followed on Twitter have moved on to other platforms.</p>

<p>I decided to explore the world beyond Twitter. You can find me in various places:</p>

<p><a href="https://accidentaltechnologist.com">Here of course</a>, with plans to write more.</p>

<p>I finally created a Mastodon account over on <a href="https://ruby.social">ruby.social</a>. I am pretty sure I am the last holdout to create on. :-) <a href="https://ruby.social/@rbazinet">Follow me over there</a>…</p>

<p>I started using the <a href="https://micro.blog/">Micro.blog</a> account I’ve had some Manton created the service. I thought I started posting over there but it appears I never did. Thanks to Manton for getting me going again. I plan to write some smaller posts, useful notes or other short-form there. I can be found at <a href="https://rbazinet.micro.blog/">rbazinet.micro.blog</a>.</p>

<p>If I am missing some great community somewhere else, please let me know.</p>]]></content><author><name>Rob Bazinet</name></author><category term="Technology" /><category term="Social Media" /><category term="Twitter" /><category term="Mastodon" /><category term="Micro.blog" /><category term="social networks" /><summary type="html"><![CDATA[It has been interesting to follow the story of Twitter going from public company to being purchased by Elon Musk for more money than I could ever imagine. Since that time it seems like you either love or hate Musk as the owner of a private Twitter. He’s a way better business person that I will ever be so I trust he has plans for the service that we will see over time.]]></summary></entry><entry><title type="html">It has certainly been a long time…</title><link href="https://accidentaltechnologist.com/general/it-has-certainly-been-a-long-time/" rel="alternate" type="text/html" title="It has certainly been a long time…" /><published>2023-03-27T11:20:35-04:00</published><updated>2023-03-27T11:20:35-04:00</updated><id>https://accidentaltechnologist.com/general/it-has-certainly-been-a-long-time</id><content type="html" xml:base="https://accidentaltechnologist.com/general/it-has-certainly-been-a-long-time/"><![CDATA[<p>I realized that I have neglected my blog for a very long time. I wanted to write up something so that any readers I had left didn’t think I had simply stopped existing.</p>

<p>What to write about?</p>

<p>Is writing about Ruby on Rails and how to do this or that even relevant any long? Does anyone still look to blogs for solutions to problems we might be facing? I don’t know. I solve problems this way though but maybe I am the rare case.</p>

<p>Is it time I start writing more about the entrepreneurial side of what I enjoy doing? I’m not sure.</p>

<p>I am here and still existing.</p>]]></content><author><name>Rob Bazinet</name></author><category term="General" /><summary type="html"><![CDATA[I realized that I have neglected my blog for a very long time. I wanted to write up something so that any readers I had left didn’t think I had simply stopped existing.]]></summary></entry><entry><title type="html">How to Fix Rails Flash Rendering When Using Hotwire</title><link href="https://accidentaltechnologist.com/ruby-on-rails/how-to-fix-rails-flash-rendering-when-using-hotwire/" rel="alternate" type="text/html" title="How to Fix Rails Flash Rendering When Using Hotwire" /><published>2021-05-14T09:06:31-04:00</published><updated>2021-05-14T09:06:31-04:00</updated><id>https://accidentaltechnologist.com/ruby-on-rails/how-to-fix-rails-flash-rendering-when-using-hotwire</id><content type="html" xml:base="https://accidentaltechnologist.com/ruby-on-rails/how-to-fix-rails-flash-rendering-when-using-hotwire/"><![CDATA[<p>I added <a href="https://hotwire.dev/">Hotwire</a> to a <a href="https://rubyonrails.org/">Ruby on Rails</a> application I’ve been working on and discovered some issues when rendering flash messages. Yesterday I <a href="https://accidentaltechnologist.com/ruby-on-rails/hotwire-fix-for-cors-error-when-using-omniauth/">wrote about problems related to CORS error using OmniAuth</a>. Today’s is not as exciting but still as annoying.</p>

<h2 id="problem">Problem</h2>

<p>I was in the process of testing some validation changes I implemented and realized errors were not being displayed. I went through the typical debug scenarios and found that errors were being returned but just not displayed. The code consists of just trying to create a user:</p>

<div class="language-ruby highlighter-rouge"><div class="highlight"><pre class="highlight"><code><span class="k">def</span> <span class="nf">create</span>
  <span class="vi">@user</span> <span class="o">=</span> <span class="no">User</span><span class="p">.</span><span class="nf">new</span><span class="p">(</span><span class="n">user_params</span><span class="p">)</span>
  <span class="k">if</span> <span class="vi">@user</span><span class="p">.</span><span class="nf">save</span>
    <span class="n">redirect_to</span> <span class="n">root_path</span><span class="p">,</span> <span class="ss">notice: </span><span class="s2">"User created successfully"</span>
  <span class="k">else</span>
    <span class="n">render</span> <span class="ss">:new</span>
  <span class="k">end</span>
<span class="k">end</span>
</code></pre></div></div>

<p>When creating a user, the <em>new</em> form rendered but errors were not displayed.</p>

<h2 id="solution">Solution</h2>

<p>The reason the messages were not being displayed is because of <a href="https://turbo.hotwire.dev/">Turbo</a> and Rails UJS conflicting. Solving the problem can be done in one of two ways:</p>

<ol>
  <li>It appears Turbo expects form submissions to redirect to a new location. When there is an error, we are staying on the same page. Adding <code class="language-plaintext highlighter-rouge">status: :unprocessable_entity</code> to the render fixes the problem:</li>
</ol>

<div class="language-ruby highlighter-rouge"><div class="highlight"><pre class="highlight"><code><span class="k">def</span> <span class="nf">create</span>
  <span class="vi">@user</span> <span class="o">=</span> <span class="no">User</span><span class="p">.</span><span class="nf">new</span><span class="p">(</span><span class="n">user_params</span><span class="p">)</span>
  <span class="k">if</span> <span class="vi">@user</span><span class="p">.</span><span class="nf">save</span>
    <span class="n">redirect_to</span> <span class="n">root_path</span><span class="p">,</span> <span class="ss">notice: </span><span class="s2">"User created successfully"</span>
  <span class="k">else</span>
    <span class="n">render</span> <span class="ss">:new</span><span class="p">,</span> <span class="ss">status: :unprocessable_entity</span> 
  <span class="k">end</span>
<span class="k">end</span>
</code></pre></div></div>

<ol>
  <li>A similar solution from <a href="https://accidentaltechnologist.com/ruby-on-rails/hotwire-fix-for-cors-error-when-using-omniauth/">yesterday’s post</a> also works. Adding:</li>
</ol>

<div class="language-erb highlighter-rouge"><div class="highlight"><pre class="highlight"><code>data: { turbo: false }
</code></pre></div></div>

<p>The form declaration disables turbo and lets Rails UJS handle as desired. I hope future versions of Turbo handle this better.</p>]]></content><author><name>admin</name></author><category term="Hotwire" /><category term="Ruby on Rails" /><category term="Hotwire" /><category term="Ruby on Rails" /><category term="Turbo" /><summary type="html"><![CDATA[I added Hotwire to a Ruby on Rails application I’ve been working on and discovered some issues when rendering flash messages. Yesterday I wrote about problems related to CORS error using OmniAuth. Today’s is not as exciting but still as annoying.]]></summary></entry><entry><title type="html">Hotwire Fix for CORS Error when using Omniauth</title><link href="https://accidentaltechnologist.com/ruby-on-rails/hotwire-fix-for-cors-error-when-using-omniauth/" rel="alternate" type="text/html" title="Hotwire Fix for CORS Error when using Omniauth" /><published>2021-05-13T09:11:32-04:00</published><updated>2021-05-13T09:11:32-04:00</updated><id>https://accidentaltechnologist.com/ruby-on-rails/hotwire-fix-for-cors-error-when-using-omniauth</id><content type="html" xml:base="https://accidentaltechnologist.com/ruby-on-rails/hotwire-fix-for-cors-error-when-using-omniauth/"><![CDATA[<p>I’ve been working on a small side project lately and having some fun trying some new <a href="https://rubyonrails.org/">Ruby on Rails</a> features. The application allows a user to authenticate using their Twitter account. I’m using the <a href="https://github.com/arunagw/omniauth-twitter">omniauth-twitter gem</a> to implement the Twitter strategy with OmniAuth. It works great; the user is redirected to Twitter to enter their Twitter username and password then sent back to the site with a token for the user’s account.</p>

<h2 id="the-problem">The Problem</h2>

<p>Everything was working great until I implement some of the HTML over the wire goodness of <a href="https://hotwire.dev/">Hotwire</a>. I have a couple of areas on the site that rely on a <a href="https://sidekiq.org/">Sidekiq</a> and update a page when the job is complete. A perfect use case for Hotwire. The job processed, changes broadcast, and pages updated when the model changed. It worked as planned!</p>

<p>I deployed the update using Hotwire, tested and everything was working as I wanted. Deciding to authenticate a different Twitter account, no longer was I sent to the Twitter page to enter my credentials. No error on the page; it just did no redirect. I looked for any errors in the Rails log. I could see the request initiated but it seemed to drop out of sight with nothing additional logged and no errors.</p>

<p>Maybe it’s a browser-specific issue. I usually use Firefox so I tried Chrome and Safari with the same results. Digging a bit deeper I decided to look at the Network tab in the browser to see if the request was giving an error and I found nothing. The request wasn’t going out to Twitter.</p>

<p>Inspecting the console in Firefox revealed this ugly message:</p>

<div class="language-plaintext highlighter-rouge"><div class="highlight"><pre class="highlight"><code>Access to fetch at 'https://api.twitter.com/oauth/authenticate?oauth_token=&lt;my secret token&gt;' (redirected from 'https://127.0.0.1:3000/auth/twitter') from origin 'https://127.0.0.1:3000' has been blocked by CORS policy: Response to preflight request doesn't pass access control check: No 'Access-Control-Allow-Origin' header is present on the requested resource. If an opaque response serves your needs, set the request's mode to 'no-cors' to fetch the resource with CORS disabled.
</code></pre></div></div>

<p>I started to search around for the error, and many solutions had me trying the <a href="https://github.com/cyu/rack-cors">rack-cors gem</a> and other methods to satisfy what needed to be done. Nothing worked. I spent a couple of hours going down this path to no avail. The error is deceiving and not indicative of the real problem.</p>

<h2 id="debugging">Debugging</h2>

<p>I had done many updates since the last time I knew this worked, including gem and NPM package updates. After removing and testing each update, the message still appeared. I determined which code was updated since the feature recently worked. I evaluated and ranked each change by how much I thought it could cause the problem. The only change that was a bit of a black box to me was the addition of Hotwire to the mix.</p>

<p>I removed the <a href="https://github.com/hotwired/hotwire-rails">Hotwire-rails gem</a> and removed all the code related to Hotwire and, moved back to Turbolinks. Magically it all worked again. Adding Hotwire caused this problem.</p>

<h2 id="a-solution">A Solution</h2>

<p>Being new to Hotwire I wasn’t sure where to start. I started with what any good developer does…a Google search. I came across some posts on the <a href="https://discuss.hotwire.dev/">Hotwire forums</a> and on the <a href="https://github.com/hotwired/turbo/issues">Devise Github issues list</a> that provided a solution that worked.</p>

<p>One, in particular, gave this solution:</p>

<blockquote>
  <p>It seems like adding:</p>

  <div class="language-erb highlighter-rouge"><div class="highlight"><pre class="highlight"><code>:data =&gt; {turbo: "false"}
</code></pre></div>  </div>

  <p>and making my link a button seems to make it work as per: <a href="https://github.com/hotwired/turbo/issues/45#issuecomment-753444256">Devise github login not working after Turbo enabled. · Issue #45 · hotwired/turbo · GitHub</a>. I now have a different error, but that it something different. So I suppose this is solved for now.</p>
</blockquote>

<p>The original button I used to connect with Twitter, looked like this:</p>

<div class="language-erb highlighter-rouge"><div class="highlight"><pre class="highlight"><code>button_to "Connect a Twitter account", "/auth/twitter", method: :post, class: "btn btn-primary"
</code></pre></div></div>

<p>After the suggestion above, it now looks like this:</p>

<div class="language-erb highlighter-rouge"><div class="highlight"><pre class="highlight"><code>button_to "Connect a Twitter account", "/auth/twitter", method: :post, data: {turbo: "false"}, class: "btn btn-primary"
</code></pre></div></div>

<p>After adding the code to the button, it works as it did before. Simply don’t use Turbo for this type of request. The <a href="https://turbo.hotwire.dev/handbook/drive#disabling-turbo-drive-on-specific-links-or-forms">Turbo docs do discuss disabling Turbo on specific links</a>. The error I received did not do a good job of pointing me in the right direction and I spent some time going down the wrong path. I hope someone else can save some time if they have a similar problem.</p>

<h2 id="conclusion">Conclusion</h2>

<p>Solving this problem was time-consuming, but I learned a bunch. Hotwire is in beta at this time. I’m sure things will improve, and maybe we don’t have to solve problems in this way in the future. A lesson I learned is the need for some better end-to-end tests for this project. I thought since it was going to Twitter and back, it wasn’t necessary. I was wrong.</p>]]></content><author><name>Rob Bazinet</name></author><category term="Hotwire" /><category term="Ruby on Rails" /><category term="CORS" /><category term="Hotwire" /><category term="Omniauth" /><summary type="html"><![CDATA[I’ve been working on a small side project lately and having some fun trying some new Ruby on Rails features. The application allows a user to authenticate using their Twitter account. I’m using the omniauth-twitter gem to implement the Twitter strategy with OmniAuth. It works great; the user is redirected to Twitter to enter their Twitter username and password then sent back to the site with a token for the user’s account.]]></summary></entry><entry><title type="html">Fix Installation of Ruby using rbenv on macOS Big Sur</title><link href="https://accidentaltechnologist.com/ruby/fix-installation-of-ruby-using-rbenv-on-macos-big-sur/" rel="alternate" type="text/html" title="Fix Installation of Ruby using rbenv on macOS Big Sur" /><published>2021-04-26T09:30:26-04:00</published><updated>2021-04-26T09:30:26-04:00</updated><id>https://accidentaltechnologist.com/ruby/fix-installation-of-ruby-using-rbenv-on-macos-big-sur</id><content type="html" xml:base="https://accidentaltechnologist.com/ruby/fix-installation-of-ruby-using-rbenv-on-macos-big-sur/"><![CDATA[<p>I’ve been using with <a href="https://github.com/rbenv/rbenv">rbenv</a> to manage installation and switching of Ruby versions for the pass year and have been very happy with it. I recently took the plunge and upgraded my main Apple MacBook Pro from macOS Catalina to Big Sur. Everything seemed to work well after the upgrade. Until I tried to install a new version of Ruby.</p>

<h2 id="problem">Problem</h2>

<p>When performing the usual command to install Ruby with rbenv, I started getting this message:</p>

<div class="language-bash highlighter-rouge"><div class="highlight"><pre class="highlight"><code>~ <span class="nv">$ </span>rbenv <span class="nb">install </span>2.6.7
Downloading ruby-2.6.7.tar.bz2...
-&gt; https://cache.ruby-lang.org/pub/ruby/2.6/ruby-2.6.7.tar.bz2
Installing ruby-2.6.7...
ruby-build: using readline from homebrew

BUILD FAILED <span class="o">(</span>macOS 11.2.3 using ruby-build 20210423<span class="o">)</span>

Inspect or clean up the working tree at /var/folders/mq/tlm78wy92v54ygbzfykqc8640000gn/T/ruby-build.20210424214159.42314.u6mGui
Results logged to /var/folders/mq/tlm78wy92v54ygbzfykqc8640000gn/T/ruby-build.20210424214159.42314.log

Last 10 log lines:
        rb_native_mutex_destroy<span class="o">(</span>&amp;vm-&gt;waitpid_lock<span class="o">)</span><span class="p">;</span>
        ^
vm.c:2489:34: warning: expression does not compute the number of elements <span class="k">in </span>this array<span class="p">;</span> element <span class="nb">type </span>is <span class="s1">'const int'</span>, not <span class="s1">'VALUE'</span> <span class="o">(</span>aka <span class="s1">'unsigned long'</span><span class="o">)</span> <span class="o">[</span><span class="nt">-Wsizeof-array-div</span><span class="o">]</span>
                             sizeof<span class="o">(</span>ec-&gt;machine.regs<span class="o">)</span> / sizeof<span class="o">(</span>VALUE<span class="o">))</span><span class="p">;</span>
                                    ~~~~~~~~~~~~~~~~  ^
vm.c:2489:34: note: place parentheses around the <span class="s1">'sizeof(VALUE)'</span> expression to silence this warning
compiling dmyenc.c
1 warning and 1 error generated.
make: <span class="k">***</span> <span class="o">[</span>vm.o] Error 1
make: <span class="k">***</span> Waiting <span class="k">for </span>unfinished jobs....
~ <span class="err">$</span>
</code></pre></div></div>

<p>Trying to figure out the problem by looking at the message, it didn’t seem like something I could fix. Searching the <a href="https://github.com/rbenv/rbenv/issues">rbenv Github issues</a> didn’t give many clues. Knowing that rbenv uses <a href="https://github.com/rbenv/ruby-build">ruby-build</a> to automate the Ruby build process, I looked at the issues reported. It looks like I was not the only one having similar problems.</p>

<p><img src="/assets/img/2021/04/CleanShot-2021-04-24-at-21.51.png" alt="CleanShot 2021 04 24 at 21 51" title="CleanShot 2021-04-24 at 21.51.png" /></p>

<p>I tried several of the suggestions found from those issues and none of the solutions worked.</p>

<h2 id="solution">Solution</h2>

<p>I decided to turn to my friends on Twitter to see if anyone had faced this issue. Twitter never lets me down and <a href="https://www.planetargon.com/about/robby-russell">Robby Russell of Planet Argon</a> came through, suggesting installing Ruby with these CFLAGS:</p>

<div class="language-bash highlighter-rouge"><div class="highlight"><pre class="highlight"><code><span class="nv">CFLAGS</span><span class="o">=</span><span class="s2">"-Wno-error=implicit-function-declaration"</span> rbenv <span class="nb">install </span>2.6.7
</code></pre></div></div>

<p>It worked perfectly and I was able to get additional versions of Ruby installed. This should also work if you’re having problems with <a href="https://github.com/asdf-vm/asdf-ruby">asdf Ruby version manager</a> too. Asdf uses ruby-build behind the scenes.</p>

<p>I wondered why I hadn’t stumbled on this solution in the <a href="https://github.com/rbenv/ruby-build/issues">ruby-build issues on Github</a>. It turned out I saw the issue but ignored it because it referenced installing older versions of Ruby when Xcode 12 was installed. I have Xcode 12 but was installing new versions of Ruby. The ticket was a little deceiving as it worked with new versions as well.</p>

<p>For those interested in the details, they can be found in the ticket - <a href="https://github.com/rbenv/ruby-build/issues/1489">Installing older Ruby versions on OSX after Xcode 12</a>.</p>]]></content><author><name>Rob Bazinet</name></author><category term="Mac" /><category term="Ruby" /><category term="rbnev" /><category term="Ruby" /><summary type="html"><![CDATA[I’ve been using with rbenv to manage installation and switching of Ruby versions for the pass year and have been very happy with it. I recently took the plunge and upgraded my main Apple MacBook Pro from macOS Catalina to Big Sur. Everything seemed to work well after the upgrade. Until I tried to install a new version of Ruby.]]></summary></entry><entry><title type="html">RailsConf 2021 and the Future of Conferences</title><link href="https://accidentaltechnologist.com/ruby-on-rails/railsconf-2021-and-the-future-of-conferences/" rel="alternate" type="text/html" title="RailsConf 2021 and the Future of Conferences" /><published>2021-04-20T16:49:56-04:00</published><updated>2021-04-20T16:49:56-04:00</updated><id>https://accidentaltechnologist.com/ruby-on-rails/railsconf-2021-and-the-future-of-conferences</id><content type="html" xml:base="https://accidentaltechnologist.com/ruby-on-rails/railsconf-2021-and-the-future-of-conferences/"><![CDATA[<p><img src="/assets/img/2021/04/railsconf-2021-flag.png" alt="Railsconf 2021 flag" title="railsconf-2021-flag.png" /></p>

<p>I attended <a href="https://railsconf.com/">RailsConf</a> this year, as I did last year. Due to COVID-19 these events were virtual-only. Unlike last year, this year’s event included a live component for keynote speakers as well as a large number of Discord rooms so that attendees could live the hallway track as best a virtual even could provide.</p>

<p>Organizers reported attendees took part from 61 countries.</p>

<p><img src="/assets/img/2021/04/CleanShot-2021-04-20-at-16.14.png" alt="CleanShot 2021 04 20 at 16 14" title="CleanShot 2021-04-20 at 16.14.png" /></p>

<p>There were 5 keynotes, 60 talks (not including attendee lightening talks) and 11 workshops over 4 days. The talks were prerecorded so they could be viewed at anytime. This is a nice feature; as someone who has attended the in-person RailsConf in the past, it’s always hard to decide what talks to attend and sustain the energy to watch one during every time slot.</p>

<p>The keynotes and workshops were live and took place in the afternoon and late morning, respectively. This year live lightning talks, game show, sponsor talks and speaker Q&amp;A were added and made the experience feel as close to in-person as possible.</p>

<p>The 60 session talks will be up on the <a href="https://www.youtube.com/channel/UCpFXaEz3vKJ45XjW5m5pbow/featured">Ruby Central Youtube channel</a> with a month after the event. Lots of really great talks and tons to learn.</p>

<p>This format worked great but I do miss the in-person events when you can see old friends face-to-face, have good conversations and enjoy group dinners out. I hope next year there is an in-person component of RailsConf. It does appear <a href="https://rubyconf.org/">RubyConf</a> will offer both in-person and virtual attendance. This gives attendees options and likely means more people can attend since some would miss because they couldn’t get away.</p>

<p>I don’t know the numbers for previous RailsConf, but I would have to think attendance was not close to 61 countries.</p>

<h2 id="we-are-seeing-the-future">We are seeing the future</h2>

<p>As bad as COVID-19 was for so many, we may see some positive changes for the future.</p>

<p>Conferences were designed to be in-person, face-to-face meetups, bringing attendees from all over the world to a central location. COVID-19 has shown us there had to be a different way.</p>

<p>Organizers had embrace a new way of holding events or shutdown. Technologies like <a href="https://zoom.us/">Zoom</a> and <a href="https://mux.com/">Mux</a> proved online video is a solid technology, capable of the demands of many users.</p>

<p>Events than can offer both an in-person and virtual experience, stand to gain the most. This opens up opportunities for both organizers and attendees. People who would not be able to attend a particular conference in-person would now not miss the event because they can watch in the comfort of their home or office. Organizers that had to limit attendance can now open up and allow so many more to take in the event. Win..win.</p>

<p>I’m looking forward to attend more conferences in 2021 than ever before. I will attend some in-person but will attend others virtually. The RailsConf organizers and folks at Ruby Central should be applauded for a great job.</p>]]></content><author><name>admin</name></author><category term="Ruby on Rails" /><category term="railsconf" /><category term="rubyconf" /><summary type="html"><![CDATA[]]></summary></entry><entry><title type="html">Fixing Out of Diskspace Errors on Amazon EC2</title><link href="https://accidentaltechnologist.com/infrastructure/fixing-out-of-diskspace-errors-on-amazon-ec2/" rel="alternate" type="text/html" title="Fixing Out of Diskspace Errors on Amazon EC2" /><published>2021-04-20T10:40:15-04:00</published><updated>2021-04-20T10:40:15-04:00</updated><id>https://accidentaltechnologist.com/infrastructure/fixing-out-of-diskspace-errors-on-amazon-ec2</id><content type="html" xml:base="https://accidentaltechnologist.com/infrastructure/fixing-out-of-diskspace-errors-on-amazon-ec2/"><![CDATA[<p>Recently, I was working on a side project and deployed an update on my favorite deployment platform, <a href="https://www.hatchbox.io/">Hatchbox</a>.</p>

<p>The deployment ran and failed with an error message:</p>

<p><code class="language-plaintext highlighter-rouge">error An unexpected error occurred: "ENOSPC: no space left on device</code></p>

<p>Hatchbox gives users a nice interface to deploy Ruby on Rails applications. Everything is taken care of for us, from server provisioning to application deployment. It’s really a nice service and allows lots of customizability.</p>

<p>This particular application is provisioned on Amazon EC2. Hatchbox provisions to multiple providers including Amazon and DigitalOcean but their responsibility for the platform does not go beyond provision. Issues such as what to do about these types of errors is up to the user.</p>

<h2 id="finding-the-problem">Finding the Problem</h2>

<p>I am running an a t2.micro instance which does not have a lot of space but I didn’t expect to run out so soon. I ssh’d into the server and ran a check of disk space with the</p>

<div class="language-bash highlighter-rouge"><div class="highlight"><pre class="highlight"><code><span class="nb">df</span> <span class="nt">-h</span>
</code></pre></div></div>

<p>command. The result showed me what was wrong:</p>

<p><img src="/assets/img/2021/04/CleanShot-2021-04-16-at-16.22.png" alt="CleanShot 2021 04 16 at 16 22" title="CleanShot 2021-04-16 at 16.22.png" /></p>

<p>Granted, this shows I have 93% free and that should be enough to deploy my application and it is. I removed some old deploys and freed up enough space to finish the deploy. Disk space was at 99% before cleanup. This was a temporary solution and adding space is needed.</p>

<h2 id="fixing-the-problem">Fixing the Problem</h2>

<p>If you are familiar with how managing partitions on a Mac or Windows system then you should have an understanding how to solve this problem. On these system there is the idea of a partition, which has a set size. The partition is formatted for a given file system and can then be used to store applications and data. These partitions can have their size adjusted and formatted for use. This is how this problem is solved.</p>

<p>This application is running on Amazon EC2 and those servers use Elastic Block Storage (EBS) for server storage. The nice feature of EBS is the ability to easily change the size of the drive allocated for our use. The default size for our t2.micro instance is set to 8G, which seems small but can be easily expanded.</p>

<p>Loggin into the Amazon Web Services dashboard, the available volumes are shown. Selecting Volumes listed under Elastic Block Store on the left side column reveals them:</p>

<p><img src="/assets/img/2021/04/CleanShot-2021-04-16-at-16.25.png" alt="CleanShot 2021 04 16 at 16 25" title="CleanShot 2021-04-16 at 16.25.png" /></p>

<p>I have a single volume listed, you mileage may vary. Choose the one for the EC2 instance needing more space. Notice the display shows 16g of storage. This screenshot was taken after the changes were made to expand the volume.</p>

<p>Right clicking on the volume shows a nice menu:</p>

<p><img src="/assets/img/2021/04/CleanShot-2021-04-16-at-16.26.png" alt="CleanShot 2021 04 16 at 16 26" title="CleanShot 2021-04-16 at 16.26.png" /></p>

<p>Finding this menu was not obvious when first arriving at this page. You will want to choose the <strong>Modify Volume</strong> option from the popup menu where you will see the following modal:</p>

<p><img src="/assets/img/2021/04/CleanShot-2021-04-16-at-16.27.png" alt="CleanShot 2021 04 16 at 16 27" title="CleanShot 2021-04-16 at 16.27.png" /></p>

<p>I changed this option from 8GB to 16GB for my purposes. Once you click the Modify button it will take some time for the change to take effect. The status will be here:</p>

<p><img src="/assets/img/2021/04/CleanShot-2-2021-04-16-at-16.25.jpg" alt="CleanShot 2 2021 04 16 at 16 25" title="CleanShot-2 2021-04-16 at 16.25.jpg" />:</p>

<p>The <strong>State</strong> field will change and update with progress. Mine took about 5-10 minutes. When it’s all done it will return to showing <strong>In-Use</strong>.</p>

<p>Unfortunately, once this process is done the disk space is not expanded. You have to expand the volume on your own.</p>

<h3 id="expanding-the-volume">Expanding the Volume</h3>

<p>Amazon does have a <a href="https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/recognize-expanded-volume-linux.html">nice document</a> to accomplish this task. It’s a good idea to take a look at this and follow their specific directions including taking a snapshot of the volume in the event there are problems.</p>

<p>I decided against the snapshot because I didn’t have any production data I needed to be concerned about.</p>

<p>These are the steps to finish expanding the volume. I assume you are familiar enough with the command line to complete these steps. These steps need to be completed from the EC2 instance itself. Access to the instance is accomplished with secure shell (ssh). Root privileges are also needed.</p>

<p><strong>1. Check the file system in the volume. Mine shows ext4.</strong></p>

<p><img src="/assets/img/2021/04/CleanShot-2021-04-16-at-16.23.png" alt="CleanShot 2021 04 16 at 16 23" title="CleanShot 2021-04-16 at 16.23.png" /></p>

<p>The <strong>Type</strong> column shows the format of the filesystem. Take note of this, it will be needed later.</p>

<p><strong>2. Run <em>lsblk</em> to look for the partition that needs to be extended.</strong></p>

<p><img src="/assets/img/2021/04/CleanShot-2021-04-16-at-17.18.png" alt="CleanShot 2021 04 16 at 17 18" title="CleanShot 2021-04-16 at 17.18.png" /></p>

<p>This shows my partition <em>after</em> the upgrade had been done. The disk size showed 16G and the partition (xvda1) showed 8G.</p>

<p><strong>3. Extend the partition</strong></p>

<p>We need to extend the partition so we can use it in the next step. From a terminal window of your EC2 instance.</p>

<div class="language-bash highlighter-rouge"><div class="highlight"><pre class="highlight"><code><span class="nb">sudo </span>growpart /dev/xvda1 1
</code></pre></div></div>

<p>The 1 at the end indicates the partition to be expanded.</p>

<p><strong>4. Extend the File System</strong></p>

<p>Since the filesystem of the drive I am targeting is ext4, I use the command:</p>

<div class="language-bash highlighter-rouge"><div class="highlight"><pre class="highlight"><code><span class="nb">sudo </span>resize2fs /dev/root
</code></pre></div></div>

<p>Once this command completes running another <code class="language-plaintext highlighter-rouge">df -h</code> shows our partition is expanded and we no longer receive errors when trying to deploy to Hatchbox. This issue is not unique to Hatchbox and will solve this problem for any method used to deploy to your Amazon EC2 instance.</p>

<h2 id="conclusion">Conclusion</h2>

<p>This process is not difficult but does require paying attention to some details. If you aren’t familiar with how-to access remote systems or how partitions and filesystems work then you might want to find a friend who can help.</p>

<p>I hope this helps…</p>]]></content><author><name>Rob Bazinet</name></author><category term="Infrastructure" /><category term="Amazon EC2" /><category term="Amazone EBS" /><category term="Hatchbox" /><summary type="html"><![CDATA[Recently, I was working on a side project and deployed an update on my favorite deployment platform, Hatchbox.]]></summary></entry><entry><title type="html">Discover DevUtils.app - Toolbox for Developers</title><link href="https://accidentaltechnologist.com/utilities/discover-devutils-app/" rel="alternate" type="text/html" title="Discover DevUtils.app - Toolbox for Developers" /><published>2021-04-19T10:15:42-04:00</published><updated>2021-04-19T10:15:42-04:00</updated><id>https://accidentaltechnologist.com/utilities/discover-devutils-app</id><content type="html" xml:base="https://accidentaltechnologist.com/utilities/discover-devutils-app/"><![CDATA[<p>I love finding great tools that solve problems I face everyday. I came across the <a href="https://devutils.app/">DevUtils.app</a> recently which is a toolbox with lots of tools to make our day better.</p>

<p><img src="/assets/img/2021/04/CleanShot-2021-04-18-at-20.58.png" alt="CleanShot 2021 04 18 at 20 58" title="CleanShot 2021-04-18 at 20.58.png" /></p>

<p>I’ve made use of several of these and it works great.</p>

<p>The list of tools is pretty broad and I can imagine the author adding more to the toolbox as time goes on.</p>

<p>The toolbox is not free, $25 for use on two Macs. Seems like a bargain. I found the <a href="https://github.com/DevUtilsApp/DevUtils-app">source code is available too</a> but I hope is if you find value, you support the author. As developers we know how much time it takes to create and support a nice piece of software.</p>]]></content><author><name>Rob Bazinet</name></author><category term="Utilities" /><category term="DevUtils" /><summary type="html"><![CDATA[I love finding great tools that solve problems I face everyday. I came across the DevUtils.app recently which is a toolbox with lots of tools to make our day better.]]></summary></entry><entry><title type="html">Overcoming the Mimemagic Fiasco</title><link href="https://accidentaltechnologist.com/ruby-on-rails/overcoming-the-mimemagic-fiasco/" rel="alternate" type="text/html" title="Overcoming the Mimemagic Fiasco" /><published>2021-03-26T09:31:19-04:00</published><updated>2021-03-26T09:31:19-04:00</updated><id>https://accidentaltechnologist.com/ruby-on-rails/overcoming-the-mimemagic-fiasco</id><content type="html" xml:base="https://accidentaltechnologist.com/ruby-on-rails/overcoming-the-mimemagic-fiasco/"><![CDATA[<p>I’m sure if you are a Ruby on Rails developer, you have heard about the fiasco that is <a href="https://rubygems.org/gems/mimemagic">Mimemagic</a>. It seems a component used in the Mimemagic gem was under a GPL license which was different than Mimemagic but because of how these licenses work, trickles down to users of Mimemagic. In this case the Ruby on Rails gem. If you’re interested in some of the background, the Ruby on Rails issue, <a href="https://github.com/rails/rails/issues/41750">Dependency on mimemagic 0.3.x no longer valid #41750</a>, can fill you in.</p>

<p>The gem was yanked from Rubygems and because of this, the gem could no longer be installed so builds broke everywhere. Users received the message:</p>

<blockquote>
  <p>Your bundle is locked to mimemagic (0.3.5), but that version could not be found in any of the sources listed in your Gemfile. If you haven’t changed sources, that means the author of mimemagic (0.3.5) has removed it. You’ll need to update your bundle to a version other than mimemagic (0.3.5) that hasn’t been removed in order to install.</p>
</blockquote>

<p>I have several clients needing a way to resolve this problem. I came up with a couple different options.</p>

<h2 id="option-1---remove-dependency">Option 1 - Remove Dependency</h2>

<p>After a bit of research I discovered that Mimemgic was used by the Marcel gem which is required by ActiveStorage. If the application did not use ActiveStorage then removing the dependency would solve the problem. If you use ActiveStorage, this is not an option.</p>

<p>Implementing this is pretty straightforward. Opening up your <strong>config/application.rb</strong>, you should see where Rails is required:</p>

<div class="language-ruby highlighter-rouge"><div class="highlight"><pre class="highlight"><code><span class="nb">require</span> <span class="s2">"rails/all"</span>
</code></pre></div></div>

<p>Instead of requiring all, just require what you need and remove the ActiveStorage dependency. This is what requiring rails/all includes:</p>

<div class="language-ruby highlighter-rouge"><div class="highlight"><pre class="highlight"><code><span class="n">active_record</span><span class="o">/</span><span class="n">railtie</span>
<span class="n">active_storage</span><span class="o">/</span><span class="n">engine</span>
<span class="n">action_controller</span><span class="o">/</span><span class="n">railtie</span>
<span class="n">action_view</span><span class="o">/</span><span class="n">railtie</span>
<span class="n">action_mailer</span><span class="o">/</span><span class="n">railtie</span>
<span class="n">active_job</span><span class="o">/</span><span class="n">railtie</span>
<span class="n">action_cable</span><span class="o">/</span><span class="n">engine</span>
<span class="n">action_mailbox</span><span class="o">/</span><span class="n">engine</span>
<span class="n">action_text</span><span class="o">/</span><span class="n">engine</span>
<span class="n">rails</span><span class="o">/</span><span class="n">test_unit</span><span class="o">/</span><span class="n">railtie</span>
<span class="n">sprockets</span><span class="o">/</span><span class="n">railtie</span>
</code></pre></div></div>

<p>Just remove the second line and require each of these individually and you will be all set.</p>

<h2 id="option-2---change-how-the-gem-is-included">Option 2 - Change how the gem is included</h2>

<p>Since the Mimemagic gem is open source and the code is in a git repo, we can identify the commit created when version 0.3.5 of the gem was released. Some commits that should solve the problem:</p>

<ul>
  <li>0.3.3 https://github.com/mimemagicrb/mimemagic/commit/d5ebc0cd846dcc68142622c76ad71d021768b7c2</li>
  <li>0.3.4 https://github.com/mimemagicrb/mimemagic/commit/64b60d125432bde900fa4d9f77fb6f057a0c325a</li>
  <li>0.3.5 https://github.com/mimemagicrb/mimemagic/commit/01f92d86d15d85cfd0f20dabd025dcbd36a8a60f</li>
</ul>

<p>My projects have been using v0.3.5, I found the commit and added this to my Gemfile:</p>

<div class="language-ruby highlighter-rouge"><div class="highlight"><pre class="highlight"><code><span class="n">gem</span> <span class="s1">'mimemagic'</span><span class="p">,</span> <span class="s1">'0.3.5'</span><span class="p">,</span> <span class="ss">git: </span><span class="s1">'https://github.com/mimemagicrb/mimemagic'</span><span class="p">,</span> <span class="ss">ref: </span><span class="s1">'01f92d8'</span>
</code></pre></div></div>

<p>This is a short-term fix. I expect once the Rails team resolves the dependency, new versions of Rails will be released.</p>]]></content><author><name>Rob Bazinet</name></author><category term="Ruby on Rails" /><category term="Ruby on Rails" /><category term="rubygem" /><summary type="html"><![CDATA[I’m sure if you are a Ruby on Rails developer, you have heard about the fiasco that is Mimemagic. It seems a component used in the Mimemagic gem was under a GPL license which was different than Mimemagic but because of how these licenses work, trickles down to users of Mimemagic. In this case the Ruby on Rails gem. If you’re interested in some of the background, the Ruby on Rails issue, Dependency on mimemagic 0.3.x no longer valid #41750, can fill you in.]]></summary></entry></feed>