<?xml version="1.0" encoding="UTF-8"?><rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:atom="http://www.w3.org/2005/Atom" version="2.0" xmlns:cc="http://cyber.law.harvard.edu/rss/creativeCommonsRssModule.html">
    <channel>
        <title><![CDATA[Stories by Riley Manda on Medium]]></title>
        <description><![CDATA[Stories by Riley Manda on Medium]]></description>
        <link>https://medium.com/@rileymanda?source=rss-68b19d8d61cd------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/1*_1cXwfsaJUCLACJ8hjfjaA.jpeg</url>
            <title>Stories by Riley Manda on Medium</title>
            <link>https://medium.com/@rileymanda?source=rss-68b19d8d61cd------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Wed, 02 Dec 2026 08:51:52 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@rileymanda/feed" rel="self" type="application/rss+xml"/>
        <webMaster><![CDATA[yourfriends@medium.com]]></webMaster>
        <atom:link href="http://medium.superfeedr.com/" rel="hub"/>
        <item>
            <title><![CDATA[The Day My PostgreSQL Refused to Start: A MacBook Troubleshooting Journey]]></title>
            <link>https://rileymanda.medium.com/the-day-my-postgresql-refused-to-start-a-macbook-troubleshooting-journey-04ed27a5b185?source=rss-68b19d8d61cd------2</link>
            <guid isPermaLink="false">https://medium.com/p/04ed27a5b185</guid>
            <dc:creator><![CDATA[Riley Manda]]></dc:creator>
            <pubDate>Sat, 21 Feb 2026 20:13:25 GMT</pubDate>
            <atom:updated>2026-02-21T20:13:25.488Z</atom:updated>
            <content:encoded><![CDATA[<p>It was a typical morning when I sat down at my MacBook, ready to dive into my development work. Little did I know that I was about to face one of those classic developer challenges that would test my patience and problem-solving skills.</p><h3>The Problem Emerges</h3><p>The day started normally enough. I fired up my terminal, ready to connect to my PostgreSQL database, only to be greeted by an error message that would become all too familiar:</p><p>psql: error: connection to server on socket “/tmp/.s.PGSQL.5432” failed: No such file or directory<br>Is the server running locally and accepting connections on that socket?</p><p>This was strange. PostgreSQL had been working perfectly fine the day before. What could have changed overnight?</p><h3>The Investigation Begins</h3><p>My first instinct was to check if PostgreSQL was actually running. A quick</p><pre>ps aux | grep postgres</pre><p>revealed that no PostgreSQL processes were active, despite the service supposedly being started. This was the first clue that something was amiss.</p><p>I tried the standard Homebrew command to start PostgreSQL 15:</p><pre>brew services start postgresql@15</pre><p>The command appeared to succeed, but the database still wasn’t accessible. This was when I knew I was dealing with something more complex than a simple service restart.</p><h3>The Deep Dive</h3><p>As I dug deeper, I discovered multiple issues:</p><p>A stale lock file (postmaster.pid) was preventing the server from starting</p><p>Locale settings were causing initialisation problems</p><p>The data directory was in an inconsistent state</p><h3>Solution</h3><p>The journey to fix these issues took several steps:</p><ol><li>First, we needed to stop all PostgreSQL services:</li></ol><pre>brew services stop postgresql@15</pre><p>2. Clean up any stale processes and lock files:</p><pre>rm -f /usr/local/var/postgresql@15/postmaster.pid</pre><p>Then:</p><pre>pkill -f postgres</pre><pre>mv /usr/local/var/postgresql@15 /usr/local/var/postgresql@15.bak</pre><p>mkdir /usr/local/var/postgresql@15</p><p>Set proper locale settings:</p><ol><li>export LANG=en_US.UTF-8</li><li>export LC_ALL=en_US.UTF-8</li></ol><p><strong>Initialize a fresh database:</strong></p><pre>/usr/local/opt/postgresql@15/bin/initdb -D /usr/local/var/postgresql@15 - auth=trust</pre><pre>brew services start postgresql@15</pre><p><strong>Lessons Learned</strong></p><p>This experience taught me several valuable lessons:</p><p>Always check the logs: The error messages provided crucial clues about what was going wrong.</p><p>Backup before major changes: I backed up the data directory before making significant changes, which is a good practice.</p><p>Understand your environment: The locale issues highlighted how important it is to have proper system settings.</p><p>Use the right tools: While manual pg_ctl commands work, using brew services is often more reliable for managing PostgreSQL on macOS.</p><h3>Prevention for the Future</h3><p>To prevent similar issues in the future, I’ve learned to:</p><p>Always stop PostgreSQL services properly before shutting down</p><p>Keep track of system locale settings</p><p>Regularly check the health of the database service</p><p>Maintain proper backups of important data</p><h3>Conclusion</h3><p>What started as a frustrating morning turned into a valuable learning experience. These kinds of issues are common in development, and knowing how to troubleshoot them systematically is a crucial skill. The key is to stay calm, gather information, and tackle problems one step at a time.</p><p>Remember, in the world of development, every problem is an opportunity to learn something new. And sometimes, the most frustrating issues lead to the most valuable lessons.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=04ed27a5b185" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Are We Outsourcing Our Humanity to AI?]]></title>
            <link>https://rileymanda.medium.com/are-we-outsourcing-our-humanity-to-ai-54c015fa9ab3?source=rss-68b19d8d61cd------2</link>
            <guid isPermaLink="false">https://medium.com/p/54c015fa9ab3</guid>
            <category><![CDATA[ai]]></category>
            <category><![CDATA[chatgpt]]></category>
            <category><![CDATA[future-of-humanity]]></category>
            <dc:creator><![CDATA[Riley Manda]]></dc:creator>
            <pubDate>Sat, 14 Feb 2026 02:08:59 GMT</pubDate>
            <atom:updated>2026-02-14T02:16:08.786Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*Num8K8l3OttuV4RuwR0N2w.png" /></figure><p>I recently discovered something that genuinely shocked me.</p><p>Women are now using ChatGPT to scan through conversations with their partners, and then accepting whatever the AI says about those partners as truth.</p><p>That is deeply concerning.</p><p>We are witnessing a subtle but significant shift in how people make judgments. AI, once positioned as a productivity tool, is now being treated as an emotional authority. Instead of using it to draft emails, write code, or research information, some are relying on it for medical advice, psychological analysis, and even relationship verdicts, and taking its output as fact.</p><p>This isn’t just about AI or Women, Men are doing it too.</p><p>It’s therefore about what happens when humans stop thinking for themselves.</p><h3>The Problem Isn’t the Tool : It’s the Authority We Give It</h3><p>ChatGPT is not a lie detector.<br> It is not a therapist.<br> It is not a moral compass.</p><p>It is a probability engine trained on patterns of text.</p><p>When someone pastes a few screenshots of a conversation from whatsapp into AI and asks,<br> “Is he manipulating me?”<br> or<br> “Is she emotionally unavailable?”</p><p>AI generates a response based on patterns it has learned, not on lived context, tone, shared history, or nuance.</p><p><strong>It does not know the relationship.<br>It does not see the full picture.<br>It cannot read intention.<br>It does not feel.</strong></p><p>Yet its output is increasingly being treated as objective truth.</p><p>That is dangerous.</p><h3>This Is Bigger Than Relationships</h3><p>We are entering an era where:</p><ul><li>Medical symptoms are being diagnosed by AI before doctors are consulted.</li><li>Emotional conflicts are being interpreted by AI before partners are confronted.</li><li>Moral dilemmas are being resolved by algorithm rather than reflection.</li></ul><p>When convenience replaces contemplation, discernment weakens.</p><p>Every technological leap in history triggered fears of intellectual decline the printing press, radio, television, the internet, smartphones. Each time, society adapted.</p><p>But AI is different in one important way:</p><p>It doesn’t just distribute information.</p><p>It interprets it.</p><p>And when interpretation is outsourced, critical thinking can atrophy.</p><h3>What Will the World Look Like in 20 Years?</h3><p>If this trajectory continues, we may see two types of people emerge:</p><p>Those who use AI to <strong>enhance their thinking.</strong></p><p>Those who use AI to <strong>replace their thinking.</strong></p><p>The first group becomes sharper using AI as a co-pilot.</p><p>The second group risks becoming passive, waiting for instruction, validation, and direction from machines.</p><blockquote>The danger is not <strong>“the rise of the walking dead.”</strong><br> It is the rise of <strong>Intellectual complacency.</strong></blockquote><p>When humans stop wrestling with ambiguity, they stop growing.</p><p>When discomfort is immediately filtered through an AI lens for validation, emotional maturity may stall.</p><h3>A Call for Discernment</h3><p>AI should be used as a tool, not as a judge.</p><p>Second opinions are healthy.<br>External perspectives are useful.<br>Reflection is powerful.</p><p>But no machine should replace critical thought, lived experience, or direct communication.</p><p>If we are not careful, the future will not be dystopian because machines became intelligent and stole all the money in the bank, built factories and conquered humanity.</p><p>It will be dystopian because humans stopped exercising their intelligence.</p><p>And that choice, unlike AI, is entirely ours.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=54c015fa9ab3" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Automating Merge Conflict Nightmares with Custom Git Commands]]></title>
            <link>https://rileymanda.medium.com/automating-merge-conflict-nightmares-with-custom-git-commands-8a52a441850b?source=rss-68b19d8d61cd------2</link>
            <guid isPermaLink="false">https://medium.com/p/8a52a441850b</guid>
            <category><![CDATA[developer-tools]]></category>
            <category><![CDATA[git]]></category>
            <category><![CDATA[merge-conflicts]]></category>
            <category><![CDATA[github-actions]]></category>
            <dc:creator><![CDATA[Riley Manda]]></dc:creator>
            <pubDate>Sun, 12 Oct 2025 22:52:11 GMT</pubDate>
            <atom:updated>2026-01-22T20:29:54.419Z</atom:updated>
            <content:encoded><![CDATA[<p>A few days ago, I decided to revisit one of my oldest projects — a React + TypeScript project I’ve been maintaining for years.<br> In the early days, I used to create a new branch for every deployment, naming them things like:</p><pre>v1-deploy<br>v2-deploy<br>v3-deploy<br>...<br>v26-deploy</pre><p>By the time I reached <strong>v26</strong>, the project was stable enough to deserve a single, central deployment branch — <strong>main</strong>.<br> So I thought: <em>“Let’s finally make main my deployment branch and keep all development in dev.”</em></p><p>Seemed simple, right?</p><p>Well… the moment I opened a PR from <strong>dev → main</strong>, Git had other plans.</p><h3>The Merge Conflict Avalanche</h3><p>I was greeted with over <strong>20 files marked as conflicted</strong> — everything from components to layout pages.<br> I could have gone with <strong>git rebase</strong>, but that would mean stopping after every single conflict to resolve and continue.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*tH2wBmbZ-0ZCbQvdxZcPqQ.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/508/1*2Ua3Sp2AyHJa2otDreTqkw.png" /></figure><p>So, I tried the VS Code <strong>Merge Editor</strong>. It worked, one file at a time, but it was painfully slow for this many files and time consuming.<br> After a few attempts, I knew there had to be a faster way.</p><h3>Shortcut Idea: Accept All “Current” Changes</h3><p>Since I was merging from <strong>dev → main</strong>, I already knew what I wanted:</p><p><em>Keep everything from </em><strong><em>dev</em></strong><em> (current), and discard all conflicting changes from </em><strong><em>main</em></strong><em>.</em></p><p>So I created a Git alias that would accept all “ours” changes automatically.</p><pre>git config --global alias.accept-ours \<br>&#39;!git diff --name-only --diff-filter=U | xargs git checkout --ours &amp;&amp; git add . &amp;&amp; git merge --continue&#39;</pre><p>Now I could simply run:</p><pre>git accept-ours</pre><p>It worked — mostly. But then I hit a new issue.</p><pre>error: path &#39;src/pages/AboutUsSection.tsx&#39; does not have our version <br>error: path &#39;src/pages/AppointmentManager.tsx&#39; does not have our version<br>error: path &#39;src/pages/ContactUsSection.tsx&#39; does not have our version <br>error: path &#39;src/pages/PrivacyPolicy.tsx&#39; does not have our version <br>error: path &#39;src/pages/ServicesSection.tsx&#39; does not have our version <br>error: path &#39;src/pages/dashboard/AppointmentsView.tsx&#39; does not have our version</pre><h3>The “File Does Not Have Our Version” Error</h3><p>Some files were marked as <strong>“deleted by us”</strong> in dev, but they still existed in <strong>main</strong>.<br> That’s when I learned that git checkout --ours doesn’t work for files we’ve deleted: Git literally says:</p><pre>error: path &#39;src/pages/AboutUsSection.tsx&#39; does not have our version</pre><p>So I needed a way to handle those deletions automatically.</p><h3>Final Solution: git accept-ours-all</h3><p>I wrote a more complete alias that:</p><ul><li>Removes files deleted in our branch (DU entries).</li><li>Accepts our version for the rest.</li><li>Adds everything from current(dev)by accepting current and ignoring incoming from main.</li><li>Continues the merge without the need for git merge continue.</li></ul><pre>git config --global alias.accept-ours-all &#39;!f(){ \<br>  git status --porcelain | awk &#39;&quot;&#39;&quot;&#39;/^DU /{print $2}&#39;&quot;&#39;&quot;&#39; | xargs -r git rm; \<br>  git diff --name-only --diff-filter=U | xargs -r git checkout --ours; \<br>  git add -A; \<br>  git merge --continue; \<br>}; f&#39;</pre><p>Now, all I needed to do was simply run:</p><pre>git accept-ours-all</pre><p>Git resolved <strong>all conflicts</strong> by keeping the current branch (dev) version even when some files were deleted.No merge editor, no clicking through 20 conflicts manually and no need for git merge — continue during a rebase flow.</p><h3>Key Takeaways</h3><ul><li>Use automation for repetitive merge conflict patterns.</li><li>You don’t always need a GUI to fix large merges — a few terminal commands can save time.</li><li>If you’re stabilising a project, it’s worth consolidating to a single main deployment branch, but prepare for merge cleanup and thorough testing before deployment when staging to main.</li></ul><p>What started as a small cleanup turned into a valuable reminder:</p><blockquote><em>Git is powerful, but only once you understand how to tame it.</em></blockquote><p>The next time you face dozens of merge conflicts, remember:<em>You can write Git aliases to fit your workflow instead of fighting with it.</em></p><p>And lastly, it might be worthwhile investing in devOps.But for solo developers who can’t afford a dedicated DevOps setup, adding a simple CI/CD workflow (like a dry-run merge check between <strong>dev</strong> and <strong>main</strong>) is a lightweight, zero-cost way to catch conflicts early and keep deployments smooth.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=8a52a441850b" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[KISS Ai -And Gain Your Superpowers]]></title>
            <description><![CDATA[<div class="medium-feed-item"><p class="medium-feed-image"><a href="https://rileymanda.medium.com/kiss-ai-and-gain-your-superpowers-ed3b1c7908f3?source=rss-68b19d8d61cd------2"><img src="https://cdn-images-1.medium.com/max/1536/1*RDft3B_KExL7L0AQQSYeAg.png" width="1536"></a></p><p class="medium-feed-snippet">If you&#x2019;ve ever heard of the phrase &#x201C;KISS&#x201D;, you probably know it doesn&#x2019;t mean what your cheeky brain thinks it does. In this context, it&#x2026;</p><p class="medium-feed-link"><a href="https://rileymanda.medium.com/kiss-ai-and-gain-your-superpowers-ed3b1c7908f3?source=rss-68b19d8d61cd------2">Continue reading on Medium »</a></p></div>]]></description>
            <link>https://rileymanda.medium.com/kiss-ai-and-gain-your-superpowers-ed3b1c7908f3?source=rss-68b19d8d61cd------2</link>
            <guid isPermaLink="false">https://medium.com/p/ed3b1c7908f3</guid>
            <category><![CDATA[prompt-engineering]]></category>
            <category><![CDATA[ai]]></category>
            <category><![CDATA[artificial-intelligence]]></category>
            <category><![CDATA[chatgpt]]></category>
            <category><![CDATA[github-copilot]]></category>
            <dc:creator><![CDATA[Riley Manda]]></dc:creator>
            <pubDate>Sat, 23 Aug 2025 14:11:15 GMT</pubDate>
            <atom:updated>2025-08-23T14:11:15.948Z</atom:updated>
        </item>
        <item>
            <title><![CDATA[Solving Devise Mapping Errors for Email Validation with API Versioning in Rails]]></title>
            <link>https://rileymanda.medium.com/solving-devise-mapping-errors-with-api-versioning-in-rails-93261bd5a8e4?source=rss-68b19d8d61cd------2</link>
            <guid isPermaLink="false">https://medium.com/p/93261bd5a8e4</guid>
            <category><![CDATA[rails]]></category>
            <category><![CDATA[ruby-on-rails]]></category>
            <category><![CDATA[react]]></category>
            <category><![CDATA[debugging]]></category>
            <category><![CDATA[api]]></category>
            <dc:creator><![CDATA[Riley Manda]]></dc:creator>
            <pubDate>Fri, 27 Dec 2024 19:03:21 GMT</pubDate>
            <atom:updated>2024-12-28T08:06:23.340Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*cYewOEXCT_5_F4PyAuxjkQ.jpeg" /></figure><p>When working with Devise in a Rails API and implementing a feature to validate if a user email exists during form submission, you may encounter this error:</p><p>In this scenario, the main focus is checking for existing email when a user is filling in a form, keep in mind the user might or might not have an account yet, they are merely filling in a form as a guest and will signup later.But we need to validate their email and also check if the email exists in the database before wasting their time with filling in form fields just to end up failing to submit because they are not yet signed in.</p><p>In this case, our focus is on validating email availability using GET via exists/ endpoint, which we’ll test using curl. The goal is to avoid authentication complexities and provide a user-friendly experience during form submission.</p><p>We therefore test this scenario via curl and not focus too much on authentication, token management and sessions or the react form sending a request to the server.</p><pre>AbstractController::ActionNotFound (Could not find devise mapping for path &quot;/api/v1/users/exists?email=test7@email.com&quot;.<br>This may happen for two reasons:<br><br>1) You forgot to wrap your route inside the scope block. For example:<br>devise_scope :user do<br>  get &quot;/some/route&quot; =&gt; &quot;some_devise_controller&quot;<br>end<br>2) You are testing a Devise controller bypassing the router.<br>If so, you can explicitly tell Devise which mapping to use:<br>@request.env[&quot;devise.mapping&quot;] = Devise.mappings[:user]<br>):</pre><p>Using API versioning adds complexity, as the namespacing can affect route resolution. This necessitates defining routes in a way that aligns with the Devise framework. Here’s how to address and resolve the issue.</p><h3>Understanding the Problem</h3><p>The error typically occurs due to one of the following reasons:</p><ol><li><strong>Route Not Scoped Properly</strong>: Devise expects the route to be explicitly defined within a devise_scope block to establish the correct mapping for the user model.</li><li><strong>Bypassing the Router</strong>: When testing a Devise controller without routing through the Rails router, the mapping must be explicitly set in the controller.</li></ol><p>When using API versioning, the namespacing can complicate the route resolution, making it critical to ensure that the mapping aligns with the expected namespace and controller structure.</p><pre>curl -X GET &quot;http://localhost:3000/api/v1/users/exists?email=test@example.com&quot;</pre><p>You might assume the following would solve the problem:</p><p>However, this approach doesn’t work when namespacing your API. The default Devise mapping logic doesn’t automatically adapt for custom routes like users/exists. Instead, Devise requires an explicit mapping.</p><pre>devise_scope :user do<br>  get &#39;users/exists&#39;, to: &#39;users/registrations#exists&#39;<br>end</pre><p>Afterall the error cleary specifies wrapping the route in a devise scope:</p><pre>AbstractController::ActionNotFound (Could not find devise mapping for path &quot;/api/v1/users/exists?email=test7@email.com&quot;.<br>This may happen for two reasons:<br><br>1) You forgot to wrap your route inside the scope block. For example:<br>devise_scope :user do<br>  get &quot;/some/route&quot; =&gt; &quot;some_devise_controller&quot;<br>end</pre><p>But when working with Devise and namespaces in Rails, particularly with API versioning(api/v1/), the default mapping logic doesn&#39;t automatically work for custom routes like users/exists.Although method already exists in our controller:</p><pre>def exists<br>        email = params[:email]<br>        if email.blank?<br>          render json: { error: &#39;Email is required&#39; }, status: :bad_request<br>        else<br>          exists = User.exists?(email: email)<br>          render json: { exists: exists }<br>        end<br>      end</pre><p>And although we can verify that the route exists in our api:</p><pre>rails routes | grep users/exists</pre><pre>api_v1_users_exists GET /api/v1/users/exists(.:format) api/v1/users/registrations#exists</pre><p>But for some reason, the error persists when testing the check if email exists via curl.</p><pre>AbstractController::ActionNotFound (Could not find devise mapping for path &quot;/api/v1/users/exists?email=test7@email.com&quot;.<br>This may happen for two reasons:<br><br>1) You forgot to wrap your route inside the scope block. For example:<br>devise_scope :user do<br>  get &quot;/some/route&quot; =&gt; &quot;some_devise_controller&quot;<br>end<br>2) You are testing a Devise controller bypassing the router.<br>If so, you can explicitly tell Devise which mapping to use:<br>@request.env[&quot;devise.mapping&quot;] = Devise.mappings[:user]<br>):</pre><p>This issue can only be resolved by using devise_scope because <strong>Devise requires an explicit mapping to the resource (e.g., </strong><strong>User) for custom routes</strong>.Here&#39;s why and how this solution works:</p><pre>devise_scope :api_v1_user do<br>  get &#39;users/exists&#39;, to: &#39;users/registrations#exists&#39;<br>end</pre><h3>Solution: Using devise_scope with Namespaces</h3><p>Using devise_scope correctly ensures that Devise maps requests to the appropriate user model and controller within the specified namespace.</p><p>To fix this issue, ensure your routes.rb file includes the correct devise_scope declaration within the desired namespace. <strong>devise_scope :api_v1_user</strong> do instead of <strong>devise_scope :user do</strong></p><h4>Updated routes.rb File</h4><pre>Rails.application.routes.draw do<br>  mount Rswag::Ui::Engine =&gt; &#39;/api-docs&#39;<br>  mount Rswag::Api::Engine =&gt; &#39;/api-docs&#39;<br>..... # other routes<br><br> devise_scope :api_v1_user do<br>        get &#39;users/exists&#39;, to: &#39;users/registrations#exists&#39;<br>      end</pre><h3>Why this works:</h3><ol><li><strong>devise_scope</strong>: The devise_scope block ensures the correct mapping for the user model, making the users/exists route accessible within the api/v1 namespace.</li><li><strong>Controller Reference</strong>: Ensures the route points to the correct controller and action, e.g., users/registrations#exists.</li><li><strong>Namespace Compatibility</strong>: Placing the devise_scope inside namespace :api do ensures the route works seamlessly with API versioning.</li></ol><h3>The next step would be to ensure we have already added the exists Action in the RegistrationsController</h3><p>In the Api::V1::Users::RegistrationsController, add the exists action to handle the email existence check:</p><h4>Controller Code</h4><pre>class Api::V1::Users::RegistrationsController &lt; Devise::RegistrationsController<br>  skip_before_action :authenticate_user!, only: [:exists]<br><br>def exists<br>    email = params[:email]<br>    if email.blank?<br>      render json: { error: &#39;Email is required&#39; }, status: :bad_request<br>    else<br>      exists = User.exists?(email: email)<br>      render json: { exists: exists }<br>    end<br>  end<br>end</pre><h3>Testing the Endpoint</h3><p>Once the route and controller are correctly set up, test the endpoint using curl or any HTTP client:</p><h4>Testing with curl</h4><pre>curl -X GET &quot;http://localhost:3000/api/v1/users/exists?email=test@example.com&quot;</pre><p>Expected Response:</p><p>If user email exists:</p><pre>{<br>  &quot;exists&quot;: true<br>}</pre><h4>Testing with Axios in React</h4><p>If you are calling this endpoint from a React frontend, ensure your API request matches the updated route:</p><pre>import axios from &#39;axios&#39;;<br><br>export const checkEmailExists = async (email) =&gt; {<br>  try {<br>    const response = await axios.get(&#39;http://localhost:3000/api/v1/users/exists&#39;, {<br>      params: { email },<br>    });<br>    return response.data.exists;<br>  } catch (error) {<br>    console.error(&#39;Error checking email:&#39;, error);<br>    return false;<br>  }<br>};</pre><h3>Conclusion</h3><p>By properly defining the devise_scope and ensuring the route aligns with your API versioning structure, you can avoid AbstractController::ActionNotFound errors and seamlessly integrate Devise with your Rails API. This approach ensures compatibility between Devise and API versioning, making your authentication logic robust and maintainable.</p><p>Thank you for reading.</p><p>Leave a clap or comment with your solution to this issue so we can learn from each other.</p><p>Happy Coding.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=93261bd5a8e4" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Fixing .env Permission Issues In Rails-API]]></title>
            <link>https://rileymanda.medium.com/fixing-env-permission-issues-in-rails-api-93b19f1cda9c?source=rss-68b19d8d61cd------2</link>
            <guid isPermaLink="false">https://medium.com/p/93b19f1cda9c</guid>
            <category><![CDATA[env]]></category>
            <category><![CDATA[ruby-on-rails]]></category>
            <category><![CDATA[rails]]></category>
            <dc:creator><![CDATA[Riley Manda]]></dc:creator>
            <pubDate>Sat, 30 Nov 2024 20:02:58 GMT</pubDate>
            <atom:updated>2024-12-12T20:14:55.784Z</atom:updated>
            <content:encoded><![CDATA[<h3>Fixing .env Permission Issues In Rails-API</h3><p>In the bustling terminal streets of <strong>RailsVille</strong>, our heroic Rails developer — you — was on a noble mission: to bring life to the .env file and summon the all-powerful <strong>superadmin</strong> and <strong>admin</strong> credentials. However, a pesky permissions error loomed over the terminal like a dragon guarding its hoard in the midsts of an attempt to update and save the env file.</p><blockquote>“You don’t have the permission to save this file.”</blockquote><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*VEmMYmAQtxhSdL90xYc3gw.png" /></figure><p>Would this stop our brave dev? Of course not! This was just another boss battle in the great game of Rails development. Here’s how the quest unfolded.You tried selecteing the Retry as Sudo but the pesky error seemed to loom over your dev environment preventing you from saving your env file.</p><h3>⚔️ Level 1: Investigating the .env Dragon</h3><p>Like any seasoned Rails adventurer, you began with reconnaissance. To figure out who (or what) was locking the .env file, you wielded the <strong>ls -l</strong> command, an ancient incantation that reveals file ownership:Heres a fix:</p><pre>ls -l .env</pre><p>The culprit? The file wasn’t owned by <strong>you</strong>!But it was created by you and lives at the root of your file directory:There is the forensic evidence right under our noses.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/466/1*VnNF99cJyJ3SPpuh8GgHhw.png" /></figure><p>Time to reclaim your file with the <strong>chown spell</strong>:</p><pre>sudo chown $(whoami) .env</pre><p>Still, the file’s permissions were too tight for editing. To grant yourself the rightful power to write to it, you unleashed:</p><pre>chmod u+w .env</pre><p>With the file permissions restored, you attempted to save the file again. Success? If not, it was time for stronger magic.</p><h3>⚡️ Level 2: Wielding the Superuser’s Powers</h3><p>When the file refused to bow, it was time to don the cape of <strong>sudo</strong>. Armed with the <strong>nano</strong> text editor, you opened the .env file:</p><pre>sudo nano .env</pre><p>Inside the file, you inscribed the sacred credentials for superadmin and admin accounts:</p><pre>SUPERADMIN_EMAIL=superadmin@act-system<br>SUPERADMIN_PASSWORD=superpassword123<br>ADMIN_EMAIL=admin@test.com<br>ADMIN_PASSWORD=adminpassword123</pre><p>With a flourish (and the <strong>Ctrl+O</strong> command to save), you closed nano (<strong>Ctrl+X</strong>) and rejoiced!</p><p>But what if you were using <strong>Visual Studio Code</strong>?</p><h3>✨ Level 3: The Retry as Sudo Button</h3><p>For the modern Rails wizard working in <strong>VSCode</strong>, salvation came in the form of the <strong>Retry as Sudo</strong> button. This UI charm allowed you to directly save the .env file with elevated permissions after entering your system password.</p><h3>🛠️ Final Verification: The Rails Console Test</h3><p>The .env dragon now slain, you verified the environment variables in your Rails console. Opening the console with:</p><p>You summoned the environment variables to ensure they were properly loaded:</p><pre>puts ENV[&quot;SUPERADMIN_EMAIL&quot;]<br>puts ENV[&quot;SUPERADMIN_PASSWORD&quot;]</pre><p>Watching the variables echo back was like seeing fireworks on deployment day. The .env file was fully operational!</p><h3>🎉 And Thus, Order Was Restored</h3><p>With the .env file permissions fixed, you forged ahead, creating your users with confidence. The Rails app was back on track, and the permissions error was but a distant memory.</p><p>Now we can finally <strong>rails db:seed</strong> to feed our db and create our admin and super admin in our seed file and test the contents of our db in rails console.</p><p><strong>seeds.rb</strong></p><pre># Super Admin  credentials<br>superadmin_email = ENV[&quot;SUPERADMIN_EMAIL&quot;] || &quot;superadmin@example.com&quot;<br>superadmin_password = ENV[&quot;SUPERADMIN_PASSWORD&quot;]<br>if superadmin_password.nil?<br>puts &quot;Error: SUPERADMIN_PASSWORD environment variable is not set!&quot;<br>exit<br>end<br>User.find_or_create_by(email: superadmin_email) do |user|<br>user.password = superadmin_password<br>user.role = &quot;superadmin&quot;<br>user.auth_token ||= SecureRandom.hex(20)<br>end<br>puts &quot;Superadmin created: #{superadmin_email}&quot;<br><br># Admin credentials<br>admin_email = ENV[&quot;ADMIN_EMAIL&quot;] || &quot;admin@example.com&quot;<br>admin_password = ENV[&quot;ADMIN_PASSWORD&quot;]<br>if admin_password.nil?<br>puts &quot;Error: ADMIN_PASSWORD environment variable is not set!&quot;<br>exit<br>end<br>User.find_or_create_by(email: admin_email) do |user|<br>user.password = admin_password<br>user.role = &quot;admin&quot;<br>user.auth_token ||= SecureRandom.hex(20)<br>end<br>puts &quot;Admin created: #{admin_email}&quot;</pre><p>Executing this really cool command in our terminal should now give us a list of users we have successfully seeded to our db:</p><pre>User.select(:id, :email, :role, :auth_token).each do |user|<br>puts &quot;ID: #{user.id}, Email: #{user.email}, Role: #{user.role}, Token: #{user.auth_token}&quot;<br>end</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*2aOy6hy8vfEdR7aSFMRdYg.png" /></figure><p>Now our ApplicationController :<strong>The Boss</strong> which all our others controllers extend from can finally manage our admin and super admin sessions coupled with Devise for authentication.<br>There are off course multiple ways to achieve this with devise and rails admin. But hei, that’s an article for another time.<br>This is what our <strong>ApplicationController</strong>.<strong>rb</strong> file should look like on. the surface:</p><pre>class ApplicationController &lt; ActionController::API<br>  before_action :authenticate_user!, unless: -&gt; { request.path.start_with?(&#39;/assets&#39;, &#39;/public&#39;) }<br><br>  private<br><br>  def current_user<br>    @current_user ||= User.find_by(auth_token: request.headers[&quot;Authorization&quot;])<br>  end<br><br>  def authenticate_user!<br>    render json: { error: &quot;Unauthorized&quot; }, status: :unauthorized unless current_user<br>  end<br><br>  def authorize_superadmin<br>    render json: { error: &quot;Access denied&quot; }, status: :forbidden unless current_user&amp;.role == &quot;superadmin&quot;<br>  end<br><br>  def authorize_admin<br>    render json: { error: &quot;Access denied&quot; }, status: :forbidden unless current_user&amp;.role == &quot;admin&quot;<br>  end<br><br>  def authorize_client<br>    render json: { error: &quot;Access denied&quot; }, status: :forbidden unless current_user&amp;.role == &quot;client&quot;<br>  end<br><br>  def authorize_admin_or_superadmin<br>    render json: { error: &quot;Access denied&quot; }, status: :forbidden unless current_user&amp;.role.in?(%w[admin superadmin])<br>  end<br>end</pre><h3>📝 Pro Tip for Future Quests</h3><p>Remember, environment variables are the lifeblood of your Rails api, but permissions errors can strike at any time. Keep these tips in your developer toolkit:</p><ol><li><strong>Check file ownership</strong> with ls -l.</li><li><strong>Reclaim ownership</strong> using sudo chown.</li><li><strong>Grant yourself write access</strong> with chmod u+w.</li><li>Always verify your variables in the Rails console before proceeding.</li></ol><p>Go forth, Rails dev, and may your .env always be secure yet accessible when needed! 🚀</p><p>Thank you for reading.Please leave a clap…I could use the Standing-Ovation to motivate me to keep on writing these exciting dev quests for you.</p><p>Happy Coding!!</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=93b19f1cda9c" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[TRANSFORMATION IN RE-LEARNING]]></title>
            <link>https://rileymanda.medium.com/transformation-in-re-learning-a88686040fef?source=rss-68b19d8d61cd------2</link>
            <guid isPermaLink="false">https://medium.com/p/a88686040fef</guid>
            <category><![CDATA[motivation]]></category>
            <category><![CDATA[software-engineering]]></category>
            <category><![CDATA[my-journey]]></category>
            <dc:creator><![CDATA[Riley Manda]]></dc:creator>
            <pubDate>Sun, 29 Oct 2023 12:18:21 GMT</pubDate>
            <atom:updated>2023-10-29T12:18:21.801Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*fYvj2gDxvaCUocTc7hvbnw.png" /></figure><p>Have you ever woken up one morning and regrettably asked yourself the question:</p><p>How did I get to this point in my life?</p><p>This was me pre-covid, and during the pandemic and then I asked myself the exact same question again when I was jobless and struggling to feed myself, and yet again when I made a big mess of my career because I could not find the strength to keep going and was at the brink of giving up due to traumas that decided to knock at my mental doors like old and forgotten ghosts from a past life that not even 60+ hours of therapy could quench.</p><p>This feeling was a constant loop, almost identical to traveling in a time machine through time between past and present yet ever moving backwards in time.</p><p>I finally harnessed the power of the oceanic tides in my life to accept where I was and simply stop and accept the reality that I needed to slow down stop, heal and re-educate myself.</p><p>I had become so comfortable in my years of experience as a Software Engineer that I forgot to set aside some time to study, learn, and practice new technologies but more importantly re-learn what I thought I already knew up until I was pushed out of my comfort zone.</p><p>The ability to re-learn enabled me to spread my wings and build applications that truly showcased my <a href="https://github.com/RileyManda">skills</a>.</p><p>Not just applications for employers that remain locked in a private organizational repositories with only my experience as an indicator that I was there but open source Full stack applications that have pushed my limits with only a space of 3–5 days to complete, followed by a strict review process that has made me appreciate the importance of paying very close attention to requirements before rushing into building a project.</p><blockquote><em>One lesson I have learned throughout my journey is that, it is in not knowing that we truly open our minds to re-learning what we think we already know and improving the skills.This is what growth is.</em></blockquote><p>It was at the point of joining <a href="https://www.microverse.org/">Microverse</a> and building various application in a remote collaborative environment with people from all walks of life and various levels of experience in tech that fostered maturity and change in me that I learnt this critical lesson as a Software Engineer.</p><p>I have a Bachelor of Science Honors Degree In Software Engineering and Multimedia, and I always felt like I was on-top of things just because I could create 3D animation, produce Music at a professional level and build Software with the technology I knew and was so comfortable with.</p><p>But as a result all I did was chase after years of experience, high pay and never really set aside time to truly stop and learn and understand what I was building until I joined <a href="https://www.microverse.org/">Microverse</a>.</p><p>Any successful individual today will tell you that:</p><blockquote><em>“One must never get too comfortable in the “I know” mindset but rather approach all things in life with childlike curiosity that results in the willingness to listen” and re-learn despite the years of experience or number of achievements up one’s sleeve.</em></blockquote><p>Much like a skilled pilot who navigates an aircraft with careful attention, consideration for passenger safety, and a strict adherence to regulations, I’ve come to appreciate the vital importance of maintaining unwavering focus. Equally crucial is the humility to embrace the process of relearning, acknowledging that there is always more to discover and understand. Just as a pilot prioritizes safety and learning, I’ve adopted a similar ethos in my approach, recognizing the significance of focus and a humble willingness to continuously expand my knowledge at building secure and user friendly application.</p><p>And just as the saying goes:</p><blockquote><em>“Build it and they will come”</em></blockquote><p><a href="https://www.microverse.org/">Microverse</a> as an online learning platform was built and I was one out of many that came and through the process I grew,I matured,I recovered from my interview anxieties, improved my professional and communication skills and as a result built several meaningful projects and got to collaborate with some amazing individuals.</p><p>As I step into the final 3 weeks of my Full Stack Training:</p><p>I congratulate myself early for holding on and being strong throughout my journey at Microverse, despite the number of times i felt compelled to give up..I can now truly say that I am ready for the Software Industry and with confidence now own it:</p><blockquote><em>“I am a Full Stack Software Engineer”</em></blockquote><p>I look forward to what life will throw at me next.</p><p>For it was at a point when everyone abandoned me, while others laughed and judged me for my failures that the daily Morning meetings, collaborations and strict milestones that <a href="https://www.microverse.org/">Microverse</a> brought meaning and purpose to a life destroyed by covid.</p><p>I learnt from my failures, and if you are reading this and at the stage in your life of self doubt, its time to crawl out of your pit, because nobody is coming to save you.</p><p>Only YOU can rise above your very own limitations because they are simply after-shocks of the storm and earth quakes you are enduring at this stage in your life.</p><p>These After-shocks do not last very long, it is what we do when presented with the challenges and pain of falling and being thrown out of balance in life that matters most.</p><p>It is merely just a phase in your life and the most you can do for yourself is re-focus and understand why its happening because that very storm you dislike is an opportunity for you to re-discover yourself and a test of how badly you want to rise out of your pit.</p><p>So get up and rise, you owe yourself a second chance at life.</p><p>Its never too late to start over.</p><p>I chose to give myself a second chance,You can do it too.</p><p>Believe in yourself once more and rise.</p><p>Sending you love, light and peace.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=a88686040fef" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Crossing the Algorithmic Bridge]]></title>
            <link>https://rileymanda.medium.com/crossing-the-algorithmic-bridge-b51d6b8d1113?source=rss-68b19d8d61cd------2</link>
            <guid isPermaLink="false">https://medium.com/p/b51d6b8d1113</guid>
            <dc:creator><![CDATA[Riley Manda]]></dc:creator>
            <pubDate>Mon, 24 Jul 2023 08:07:30 GMT</pubDate>
            <atom:updated>2023-08-03T20:53:54.595Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="Image from https://www.facebook.com/enjoyalgorithms/photos/a.121978046185136/286184226431183/?type=3" src="https://cdn-images-1.medium.com/max/1024/1*TQzLd8_3SVAZynyK0iw1Bw.png" /><figcaption>Image from enjoyalgorithms</figcaption></figure><h4>Using your mind to think algorithms</h4><p>Imagine if you could use your mind to move objects around a room without lifting a finger, simply by thinking.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*2_7lMJmIdlOQpdNKfVtWyQ.png" /><figcaption><a href="https://www.cnet.com/pictures/doctor-strange-movie-marvel-benedict-cumberbatch-comic/">Image from cnet</a></figcaption></figure><p>Well, your brain is wired to do just exactly that, Think, and with a few extra steps Act, by assigning tasks to the specific organ(s) turning purposeful-actionable thought into something, such as making a cup of coffee or day-dreaming about your next job while working towards achieving that goal.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*KThHqCBriVUbbTdB4NQp5g.png" /><figcaption><a href="https://www.123rf.com/photo_114372564_left-and-right-brain-functions-concept-analytical-vs-creativity.html">Image from brain-function</a></figcaption></figure><p>The <strong>Algorithmic thinking</strong> process requires similar steps that are here depicted as Purposeful action which entails action behind each thought process coupled with purpose and action denoted as a function(steps) to derive an outcome.</p><p>Machines are wired in the exact same way. It takes a Trigger(click) to perform the Calculations, required to identify and understand a problem and print results. This requires determining an approach that works best to solve the problem in the most efficient way (time and space).</p><p>Suppose making a cup of coffee involved collecting coffee beans up a mountain, crushing them, sorting them, making a fire, heating up the water then preparing a cup of coffee. You would require energy, time, storage(variables), and knowledge(basic programming) obtained to achieve your goal.</p><p>Over millennia, humanity has come up with various mechanisms and tools to speed up day-to-day processes and tasks. Turning a nob on a microwave and setting the timer to 1 minute will instantly warm a cup of coffee, changing the mode to bake for 30 minutes will bake a cake. While it bakes, there are no further steps required until the timer elapses. But to get a really good cake, we need a set of ingredients in a recipe(steps) and time to achieve a tasty outcome.</p><p>In a similar manner, algorithms have a purpose (To achieve an outcome) by following a set of predefined steps(ingredients), speed(Efficiency), and storage(Space) and Time to produce the expected outcome such as counting children in a room.</p><p>Algorithmic thinking might seem like a daunting subject especially when presented with the complexity of understanding the problem statement while attempting to identify the most efficient and resourceful way to solve it. It simply requires an out-of-the-box thought process in its simplest form: Pseudocode.</p><p>If our goal is to count the number of children present in a room, we can employ algorithmic thinking by breaking the problem down into smaller steps. Pseudocode can be employed to help with this thought process which requires collecting data from the problem statement. <br>If the size of the array is not directly stated, and infinite loops break machines, we need to identify the result from the expectation identified in the problem statement.</p><p>We can then decide whether to start counting from 0 where no children are present in the room or 1 when iterating through the array. In this case, we can use a for loop that starts from 0 and continues until the index is less than or equal to the total number of children(10). Writing conditional statements would require basic programming knowledge as the first basic foundation to turn pseudocode into an algorithm. And Just as we need sugar to sweeten our coffee, we need some syntactic sugar to format our code and ingredients(values) to make our coffee(results).</p><p>Within the children for-loop, we iterate through the array, incrementing a counter variable(storage) each time we encounter a child. By the end of the iteration, the counter will hold the total count of children present.</p><pre>function countChildren(children) {<br>  let count = 0;<br>  for (let i = 0; i &lt; children.length; i++) {<br>    if (children[i] === true) {<br>      count++;<br>      if (count === 10) {<br>        break; // Terminate the loop if count reaches 10<br>      }<br>    }<br>  }<br>  return count;<br>}</pre><p>This simple algorithm demonstrates that solving problems involves understanding the problem statement, utilizing programming language knowledge, employing iteration, and using conditionals to track and count the desired elements in a similar manner the mountain man would require stamina, tools, and perhaps a coffee machine manual if he ever decided to move to the city to avoid lighting fires in his back yard to make that tasty coffee.</p><p><strong>Happy Coding</strong></p><figure><img alt="Image by iainlc" src="https://cdn-images-1.medium.com/max/386/1*8Ui_vJLznmuudSIhKKXtiw.png" /><figcaption>iainlc</figcaption></figure><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=b51d6b8d1113" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Flutter Doctor-Dart path warning]]></title>
            <link>https://rileymanda.medium.com/dart-warning-flutter-d7906733d5a7?source=rss-68b19d8d61cd------2</link>
            <guid isPermaLink="false">https://medium.com/p/d7906733d5a7</guid>
            <category><![CDATA[flutter]]></category>
            <category><![CDATA[dart-sdk]]></category>
            <category><![CDATA[dart]]></category>
            <category><![CDATA[flutter-sdk]]></category>
            <dc:creator><![CDATA[Riley Manda]]></dc:creator>
            <pubDate>Fri, 17 Mar 2023 16:45:35 GMT</pubDate>
            <atom:updated>2023-03-20T07:10:33.622Z</atom:updated>
            <content:encoded><![CDATA[<p>If you are experiencing this warning when you run flutter doctor:</p><p><strong><em>Warning: `dart` on your path resolves to<br> /usr/local/Cellar/dart/2.18.6/libexec/bin/dart, which is not inside your<br> current Flutter SDK</em></strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*eS0Py699BpdcxkYJOctLpw.png" /></figure><p>The latest flutter SDK already comes with dart installed.</p><p>To resolve this warning simply uninstall dart using brew:by running the command: brew uninstall dart on your terminal.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/690/1*tumAPN-OXCjiasFAvZK-gw.png" /></figure><p>Then run flutter doctor again:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*lWL4TxWty4BT454Oo2mOVQ.png" /></figure><p>And the warning disappears.</p><p>Thank you for reading.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=d7906733d5a7" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Unable to find bundled Java Version-Android Studio Electric Eel-Flutter-(Mac OS)]]></title>
            <link>https://rileymanda.medium.com/unable-to-find-bundled-java-version-android-studio-electric-eel-flutter-mac-os-87d769141232?source=rss-68b19d8d61cd------2</link>
            <guid isPermaLink="false">https://medium.com/p/87d769141232</guid>
            <category><![CDATA[flutter]]></category>
            <category><![CDATA[flutter-app-development]]></category>
            <category><![CDATA[android-studio]]></category>
            <category><![CDATA[jdk]]></category>
            <category><![CDATA[electric-eel]]></category>
            <dc:creator><![CDATA[Riley Manda]]></dc:creator>
            <pubDate>Fri, 17 Mar 2023 15:45:21 GMT</pubDate>
            <atom:updated>2023-03-17T15:45:21.119Z</atom:updated>
            <content:encoded><![CDATA[<p>If you are stuck with this error after upgrading android studio to Electric Eel and you just ran flutter doctor in your terminal:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/646/1*AR-zRvZcwDUSo6mXFAQz0w.png" /></figure><p>The solution is simple:</p><p>1: Navigate to Applications/Android Studio and right click on Android studio and select Show Package Contents.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/944/1*A9Akl1KWAuYbzd5vGThJEw.png" /></figure><p>2:Open the Contents directory and create a new directory and name the new directory:<strong>jre</strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/976/1*zmAyo83pupNG0sxkKndyDA.png" /></figure><p>3:Navigate to the <strong>jbr</strong> directory and copy the <strong><em>Contents</em></strong> directory inside <strong>jbr</strong> folder.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*6asrmcMvXbI5oWxC_esytA.png" /></figure><p>4:Paste the Contents folder you just copied from <strong>jbr</strong> into the new <strong>jre</strong> directory you created earlier.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*C1PpV-SVdzwMyKPTOwVljg.png" /></figure><p>5:Now close and reopen or clear your terminal and run flutter doctor command again.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*dRvPNGa8hgVQ270qjJQuqA.png" /></figure><p>And that&#39;s it. The error is resolved.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*K1gkUwIDU-9DytXH-DfZ4w.png" /></figure><p>And since I do not have Chrome installed on my machine (I use Brave Browser), my terminal indicated chrome web tools error.</p><p>If you feel you need to resolve this error too:</p><p>Simply install Chrome on your machine and execute $ export CHROME_EXECUTABLE=path/to/chrome in your terminal.</p><p>This tutorial assumes that you already have java, Xcode tools installed and you have already downloaded the flutter SDK and configured your environment variables on your machine.</p><p>Check out these resources for more guidance.</p><p><a href="https://docs.flutter.dev/get-started/install/macos">Flutter Sdk installation</a></p><p><a href="https://docs.oracle.com/javase/8/docs/technotes/guides/install/mac_jdk.html">JDK Installation Mac</a></p><p>Thank you for reading. Please leave a Clap to encourage me to keep writing tech content. Thank you.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=87d769141232" width="1" height="1" alt="">]]></content:encoded>
        </item>
    </channel>
</rss>