<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:dc="http://purl.org/dc/elements/1.1/">
  <channel>
    <title>DEV Community: Maya Sheriff</title>
    <description>The latest articles on DEV Community by Maya Sheriff (@mayas1111).</description>
    <link>https://dev.to/mayas1111</link>
    <image>
      <url>https://media2.dev.to/dynamic/image/width=90,height=90,fit=cover,gravity=auto,format=auto/https:%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Fuser%2Fprofile_image%2F1329978%2F6e43a9fe-5f45-49d4-8963-cfa3d40e5b6d.jpeg</url>
      <title>DEV Community: Maya Sheriff</title>
      <link>https://dev.to/mayas1111</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/mayas1111"/>
    <language>en</language>
    <item>
      <title>The importance of making your "Workspace" folder on your root path😅</title>
      <dc:creator>Maya Sheriff</dc:creator>
      <pubDate>Wed, 28 Aug 2024 23:39:11 +0000</pubDate>
      <link>https://dev.to/mayas1111/the-importance-of-making-your-workspace-folder-on-your-root-path-18lo</link>
      <guid>https://dev.to/mayas1111/the-importance-of-making-your-workspace-folder-on-your-root-path-18lo</guid>
      <description>&lt;p&gt;I've been deep into my personal project, &lt;a href="https://github.com/MayaS1111/Construction_Chat" rel="noopener noreferrer"&gt;BuiltBetter&lt;/a&gt;, and hit a couple of snags while redeploying. I’ve already shared how I tackled the first issue – you can check out that post &lt;a href="https://dev.to/mayas1111/error-with-render-27fj"&gt;here&lt;/a&gt;. The fix involved adding x86_64-linux to my lock file so that Render could use it instead of arm64-darwin-21. But that wasn’t the end of my adventure – oh no!&lt;/p&gt;

&lt;p&gt;On the same day, I stumbled into another problem. &lt;/p&gt;

&lt;p&gt;My Workspace folder wasn’t on my root path... it was nestled in my iCloud 😅.&lt;/p&gt;

&lt;p&gt;Upon starting my project, I wanted quick and easy access, so I created a folder on my desktop, thinking it would be smooth sailing. Turns out, I was wrong! Fast forward a month, and while trying to redeploy my site to Render, I ran into all sorts of problems.&lt;/p&gt;

&lt;p&gt;Here’s the lowdown:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Bundler and Ruby versions seemed inconsistent between local and global environments.&lt;/li&gt;
&lt;li&gt;Bundler was having a tantrum – it wasn’t reading from the Gemfile but from somewhere else entirely.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;My troubleshooting attempts were a comedy of errors:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;bundle didn’t work.&lt;/li&gt;
&lt;li&gt;gem install bundler didn’t work.&lt;/li&gt;
&lt;li&gt;bundle clean didn’t work.&lt;/li&gt;
&lt;li&gt;Uninstalling and reinstalling Ruby? Nope, still no luck.
It seemed like any Bundler commands were completely off the table.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;My lovely mentor &lt;a class="mentioned-user" href="https://dev.to/heratyian"&gt;@heratyian&lt;/a&gt;, finally ran the command.&lt;br&gt;
'sudo bundle'&lt;br&gt;
And just like that, Bundler started working! 🚀&lt;/p&gt;

&lt;p&gt;But wait, there was more. He highlighted this red flag 🚩 to me, then went searching in my files and found that my desktop folder (where my project was located) was nested in my iCloud. &lt;/p&gt;

&lt;p&gt;Run code from your iCloud is crazy and I should probably be in developer prison 😂.&lt;/p&gt;

&lt;h2&gt;
  
  
  Takeaways:
&lt;/h2&gt;

&lt;p&gt;Even if my desktop was in iCloud or not, it's ALWASYS best practice to keep your Workspace on your root path. It saves you from a world of confusion and problems down the line.&lt;/p&gt;

&lt;p&gt;I hope this story helps you in your coding escapades or was just interesting to read. Feel free to share your own lessons learned or ask questions. Happy coding!&lt;/p&gt;

</description>
      <category>learning</category>
      <category>errorandsolution</category>
      <category>todayilearned</category>
      <category>storytime</category>
    </item>
    <item>
      <title>Render Error: arm64-darwin-21 vs x86_64-linux</title>
      <dc:creator>Maya Sheriff</dc:creator>
      <pubDate>Wed, 28 Aug 2024 22:23:43 +0000</pubDate>
      <link>https://dev.to/mayas1111/error-with-render-27fj</link>
      <guid>https://dev.to/mayas1111/error-with-render-27fj</guid>
      <description>&lt;p&gt;This week, while working on a personal project, I ran into an error that ended up teaching me a bit more about computer processors, so I figured I’d share my findings!&lt;/p&gt;

&lt;h2&gt;
  
  
  Problem:
&lt;/h2&gt;

&lt;p&gt;While redeploying my web app to Render.com, I encountered the following error: &lt;br&gt;
"Your bundle only supports platforms ["arm64-darwin-21"] but your local platform is x86_64-linux."&lt;/p&gt;
&lt;h2&gt;
  
  
  Explanation:
&lt;/h2&gt;

&lt;p&gt;This error occurred because the platform my development machine is running on is different from the platform required by Render. Here’s a breakdown:&lt;/p&gt;

&lt;p&gt;"arm64-darwin-21":&lt;/p&gt;

&lt;p&gt;"arm64": Refers to the ARM 64-bit architecture used in Macs with M1 or M2 chips.&lt;br&gt;
"darwin": Refers to the operating system, which is macOS in this case.&lt;br&gt;
"21": Indicates the version of macOS, specifically macOS 12 (Monterey).&lt;/p&gt;

&lt;p&gt;"x86_64-linux":&lt;/p&gt;

&lt;p&gt;"x86_64": Refers to the 64-bit extension of the original x86 architecture, which is widely used in Intel and AMD processors.&lt;br&gt;
"linux": Refers to the Linux operating system.&lt;/p&gt;

&lt;p&gt;In other words, Render.com is running Linux on an x86_64 architecture, while my development environment is on a Mac with an ARM64 architecture. The error is occurring because the bundle created for macOS (arm64-darwin-21) is not compatible with the Linux (x86_64) environment on Render.&lt;/p&gt;
&lt;h2&gt;
  
  
  Solution:
&lt;/h2&gt;

&lt;p&gt;To resolve this, I had to add support for the x86_64-linux platform to my bundle, so I used this command:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;bundle lock --add-platform x86_64-linux
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;This command updates the lock file to include x86_64-linux, allowing Render to use this platform specification instead of trying to use the macOS-specific arm64-darwin-21.&lt;/p&gt;

</description>
      <category>macintosh</category>
      <category>errorandsolution</category>
      <category>learning</category>
      <category>todayilearned</category>
    </item>
    <item>
      <title>Rails Migration Tips and Examples (not a full step by step)</title>
      <dc:creator>Maya Sheriff</dc:creator>
      <pubDate>Wed, 26 Jun 2024 16:21:43 +0000</pubDate>
      <link>https://dev.to/mayas1111/rails-migration-tips-and-examples-not-a-full-step-by-step-3g1d</link>
      <guid>https://dev.to/mayas1111/rails-migration-tips-and-examples-not-a-full-step-by-step-3g1d</guid>
      <description>&lt;p&gt;Generates the model and migration, but also all of the RCAVs for index, show, create, update, and destroy.&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;The model name must be singular.&lt;/li&gt;
&lt;li&gt;Separate column names and datatypes with colons (NO SPACES).&lt;/li&gt;
&lt;li&gt;Separate name:datatype pairs with spaces (NO COMMAS).
&lt;/li&gt;
&lt;/ul&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;rails generate draft:resource &amp;lt;MODEL_NAME_SINGULAR&amp;gt; &amp;lt;COLUMN_1_NAME&amp;gt;:&amp;lt;COLUMN_1_DATATYPE&amp;gt; &amp;lt;COLUMN_2_NAME&amp;gt;:&amp;lt;COLUMN_2_DATATYPE&amp;gt; # etc

EX:
rails generate draft:resource board name:string
        OR
rails generate draft:resource post title:string body:text expires_on:date board_id:integer
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Execute the generated migrations with:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;rake db:migrate
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;This will remove all the files that rails generate draft:resource post ... had previously added. You can then correct your error and re-generate from scratch.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;rails destroy draft:resource post
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;If you made a mistake when generating your draft:resource AND you’ve already run rake db:migrate, then first you have to run the command:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;rake db:rollback
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Adding and Removing columns&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;Ex:
rails g migration AddImageToPosts
    OR
rails g migration RemoveExpiresOnFromPosts
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;ul&gt;
&lt;li&gt;If your database gets into a weird state (usually caused by deleting old migration files), your ultimate last resort is&lt;/li&gt;
&lt;li&gt;This will destroy your entire database and all the data within it. Then, you can fix your migrations and re-run all from scratch with rake db:migrate, then rake sample_data to recover the sample data.
&lt;/li&gt;
&lt;/ul&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;rake db:drop
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



</description>
      <category>migration</category>
      <category>ruby</category>
      <category>database</category>
      <category>generate</category>
    </item>
    <item>
      <title>How to Install Devise</title>
      <dc:creator>Maya Sheriff</dc:creator>
      <pubDate>Wed, 26 Jun 2024 16:15:20 +0000</pubDate>
      <link>https://dev.to/mayas1111/how-to-install-devise-28pd</link>
      <guid>https://dev.to/mayas1111/how-to-install-devise-28pd</guid>
      <description>&lt;p&gt;Use Devise for Users&lt;/p&gt;

&lt;p&gt;Install&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;rails generate devise:install
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Change :delete to :getin devise file&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;# config/initializers/devise.rb, Line 269

config.sign_out_via = :get
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Set a root route in routes&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;# config/routes.rb

root "boards#index"
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Use our new generator supplied by the gem to create the User model and routes&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;rails generate devise user
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Then Migrate&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;rake  db:migrate
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



</description>
      <category>devise</category>
      <category>users</category>
      <category>programming</category>
      <category>ruby</category>
    </item>
    <item>
      <title>Tips and Tricks for Visual Studio Code</title>
      <dc:creator>Maya Sheriff</dc:creator>
      <pubDate>Tue, 04 Jun 2024 13:52:33 +0000</pubDate>
      <link>https://dev.to/mayas1111/tips-and-tricks-for-visual-studio-code-2ln1</link>
      <guid>https://dev.to/mayas1111/tips-and-tricks-for-visual-studio-code-2ln1</guid>
      <description>&lt;p&gt;Terminal info:&lt;br&gt;
-Our standard bash prompt environment for entering commands like rake grade or bin/server&lt;br&gt;
-Pry for interacting with a database (we could also run rails console for that)&lt;br&gt;
-Irb for typing in pure Ruby code&lt;/p&gt;

&lt;p&gt;Commands:&lt;br&gt;
   -Reopen a pane&lt;br&gt;
        -Left&lt;br&gt;
            Mac OS: ⌘ + B&lt;br&gt;
            Windows: Ctrl + B&lt;br&gt;
        -Bottom&lt;br&gt;
            Mac OS: ⌘ + J&lt;br&gt;
            Windows: Ctrl + J&lt;/p&gt;

&lt;p&gt;-Clear Terminal&lt;br&gt;
        Mac OS: ⌘ + K&lt;br&gt;
        Windows: Ctrl + K&lt;/p&gt;

&lt;p&gt;-Interrupt command&lt;br&gt;
        Mac OS: ⌘ + C&lt;br&gt;
        Windows: Ctrl + C&lt;/p&gt;

&lt;p&gt;-Quick Open file&lt;br&gt;
        Mac OS: ⌘ + P&lt;br&gt;
        Windows: Ctrl + P&lt;/p&gt;

&lt;p&gt;-Command Palette&lt;br&gt;
        Mac OS: ⌘ + Shift + P&lt;br&gt;
        Windows: Ctrl + Shift + P&lt;/p&gt;

&lt;p&gt;-Jump to end of line&lt;br&gt;
        Mac OS: ⌘ + E&lt;br&gt;
        Windows: Ctrl + E&lt;/p&gt;

&lt;p&gt;-Exit&lt;br&gt;
        Mac OS: Q&lt;br&gt;
        Windows: Q&lt;/p&gt;

&lt;p&gt;-Toggle Code&lt;br&gt;
        Mac OS: ⌘ + /&lt;br&gt;
        Windows: Ctrl + /&lt;/p&gt;

&lt;p&gt;-Find Next Selection&lt;br&gt;
        Mac OS: Command + D&lt;br&gt;
        Windows: Ctrl + D    &lt;/p&gt;

&lt;p&gt;-Move line&lt;br&gt;
        Mac OS: Option + ⬇&lt;br&gt;
        Windows: Alt + ⬇&lt;/p&gt;

&lt;p&gt;-Duplicate line&lt;br&gt;
        Mac OS: Shift + Option + ⬇&lt;br&gt;
        Windows: Shift + Alt + ⬇&lt;/p&gt;

&lt;p&gt;Other:&lt;br&gt;
    -rails console = opens an interactive Ruby environment with your Rails application's context-loaded&lt;br&gt;
    -reload! = reload the application's code without exiting the console&lt;/p&gt;

</description>
      <category>vscode</category>
      <category>softwaredevelopment</category>
      <category>beginners</category>
    </item>
    <item>
      <title>Git Commands</title>
      <dc:creator>Maya Sheriff</dc:creator>
      <pubDate>Mon, 03 Jun 2024 21:53:41 +0000</pubDate>
      <link>https://dev.to/mayas1111/git-commands-2mm</link>
      <guid>https://dev.to/mayas1111/git-commands-2mm</guid>
      <description>&lt;p&gt;Main Git Commands that are important to know!&lt;/p&gt;

&lt;p&gt;-Initialize a Repo&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;% git init
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;

&lt;p&gt;-Create a Commit&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;% git add -A
% git commit -m "Title of your snapshot"    
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;

&lt;p&gt;-Stage file on at a Time (not using "add -A")&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;% git add path/to/file1
% git add location/of/file2
% git commit -m "My surgical commit"
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;

&lt;p&gt;-Check your status often&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;% git status
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;

&lt;p&gt;-See what’s changed with diff&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;% git diff
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;

&lt;p&gt;-Create a new branch&lt;/p&gt;

&lt;p&gt;% git checkout -b fancy-new-version-name&lt;/p&gt;

&lt;p&gt;-Switch to a different branch&lt;br&gt;
    To list all branches:&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;    % git branch


To switch to another existing branch:

    % git checkout branch-name
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;

&lt;p&gt;-See the git log&lt;br&gt;
    To see the history of your current branch:&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;    % git log


To see a graph of all your branches at once, try:
    % git log --oneline --decorate --graph --all -30
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;p&gt;Jumpback to a Previous Commit&lt;/p&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;% git checkout [SHA of commit you want to go back to]
&lt;/code&gt;&lt;/pre&gt;
&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;-Push&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;    % git push


The very first time you push to a branch, it may ask you to do something like:

    % git push --set-upstream origin your-branch-name
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;

&lt;p&gt;-Start on a new task&lt;br&gt;
    Start on a new task&lt;br&gt;
    When you’re ready to start on a new task, the best practice is to first switch back to the main branch, get the freshest version, and then to start a new branch from there:&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;    % git checkout main
    % git pull
    % git checkout -b my-next-task
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;

</description>
      <category>git</category>
      <category>beginners</category>
      <category>programming</category>
      <category>terminal</category>
    </item>
    <item>
      <title>First Day With Ruby!</title>
      <dc:creator>Maya Sheriff</dc:creator>
      <pubDate>Wed, 06 Mar 2024 22:37:50 +0000</pubDate>
      <link>https://dev.to/mayas1111/first-day-with-ruby-402o</link>
      <guid>https://dev.to/mayas1111/first-day-with-ruby-402o</guid>
      <description>&lt;p&gt;Hello, world!&lt;/p&gt;

&lt;p&gt;Today I had my first ruby lesson. I created a webpage with the use of GitHub and Render!&lt;/p&gt;

&lt;p&gt;Feel free to check out the site &lt;a href="https://hello-world-57gc.onrender.com"&gt;here&lt;/a&gt; or for a look at the repository click &lt;a href="https://github.com/MayaS1111/hello-world"&gt;here&lt;/a&gt;!&lt;/p&gt;

&lt;p&gt;-Maya&lt;/p&gt;

</description>
      <category>webdev</category>
      <category>github</category>
      <category>ruby</category>
      <category>html</category>
    </item>
  </channel>
</rss>
