<?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: Michelle Loh</title>
    <description>The latest articles on DEV Community by Michelle Loh (@michellelwt).</description>
    <link>https://dev.to/michellelwt</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%2F671174%2F81947ede-d450-4e94-9ace-40f643d39652.jpg</url>
      <title>DEV Community: Michelle Loh</title>
      <link>https://dev.to/michellelwt</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/michellelwt"/>
    <language>en</language>
    <item>
      <title>Upgrade Rails 6 to Rails 7 and install Bootstrap v5</title>
      <dc:creator>Michelle Loh</dc:creator>
      <pubDate>Mon, 02 May 2022 06:00:59 +0000</pubDate>
      <link>https://dev.to/michellelwt/upgrade-rails-6-to-rails-7-and-install-bootstrap-v5-3kcc</link>
      <guid>https://dev.to/michellelwt/upgrade-rails-6-to-rails-7-and-install-bootstrap-v5-3kcc</guid>
      <description>&lt;p&gt;Let's first upgrade Rails to v7&lt;/p&gt;

&lt;h2&gt;
  
  
  Upgrade Rails to v7
&lt;/h2&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;// In Gemfile

gem 'rails', '~&amp;gt; 7.0.0' # Change to this
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;





&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;// In the terminal

$ bundle update
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h2&gt;
  
  
  Upgrade rails packages
&lt;/h2&gt;

&lt;p&gt;In &lt;code&gt;package.json&lt;/code&gt;, update all rails packages&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;$ yarn upgrade @rails/actioncable --latest
$ yarn upgrade @rails/activestorage --latest
$ yarn upgrade @rails/ujs --latest
$ yarn upgrade @rails/webpacker --latest
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h2&gt;
  
  
  Run update rails task
&lt;/h2&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;// In terminal

$ bin/rails app:update
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h2&gt;
  
  
  Verify framework defaults
&lt;/h2&gt;



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

# old
config.load_defaults 6.1 # Change to 7.0

# new
config.load_defaults 7.0 # After change to 7.0
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;If you encountered this error&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;PG::UndefinedTable: ERROR: relation "active_storage_blobs" does not exist
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Then do the following:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;// In terminal

$ rails active_storage:install
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;It will create a &lt;code&gt;create_active_storage_tables.active_storage.rb&lt;/code&gt; file in &lt;code&gt;db/migrate&lt;/code&gt;, then&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;// In terminal

$ rails db:migrate
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Then, go back to Verify framework defaults section, and proceed.&lt;br&gt;
Read this &lt;a href="https://stackoverflow.com/questions/59857774/pgundefinedtable-error-relation-active-storage-blobs-does-not-exist" rel="noopener noreferrer"&gt;stackoverflow solution&lt;/a&gt;&lt;/p&gt;



&lt;p&gt;Now, we will proceed to install bootstrap v5.&lt;/p&gt;
&lt;h2&gt;
  
  
  Install &lt;code&gt;bootstrap&lt;/code&gt; and &lt;code&gt;popperjs/core&lt;/code&gt; to dependencies
&lt;/h2&gt;


&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;// In terminal

$ yarn add bootstrap and popperjs/core
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;


&lt;p&gt;So, your &lt;code&gt;package.json&lt;/code&gt; file should have these 2 lines added:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;"dependencies": {
    "@popperjs/core": "^2.11.5",
    "bootstrap": "^5.1.3"
}
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Note: The versions here might be different but since our purpose is to install bootstrap v5, it must be something similar to &lt;code&gt;5.x.x&lt;/code&gt;.&lt;/p&gt;

&lt;h2&gt;
  
  
  Change &lt;code&gt;extract_css&lt;/code&gt; in &lt;code&gt;default&lt;/code&gt; to &lt;code&gt;true&lt;/code&gt;
&lt;/h2&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;// In config/webpacker.yml

default: &amp;amp;default
  extract_css: true # Change to true
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h2&gt;
  
  
  Change &lt;code&gt;stylesheet_link_tag&lt;/code&gt; to &lt;code&gt;stylesheet_pack_tag&lt;/code&gt;
&lt;/h2&gt;

&lt;p&gt;Since the original app is still with config of Rails v6, we would use Webpacker instead of Sprockets/Asset Pipeline&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;// In app/views/layouts/&amp;lt;filename&amp;gt;.html.erb
// My &amp;lt;filename&amp;gt; is application, so in app/views/layouts/application.html.erb

&amp;lt;%= stylesheet_link_tag 'application', media: 'all', 'data-turbolinks-track': 'reload' %&amp;gt; # Change this
&amp;lt;%= javascript_pack_tag 'application', 'data-turbolinks-track': 'reload' %&amp;gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Then, it should look like this:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;&amp;lt;%= stylesheet_pack_tag 'application', media: 'all', 'data-turbolinks-track': 'reload' %&amp;gt; # After changing
&amp;lt;%= javascript_pack_tag 'application', 'data-turbolinks-track': 'reload' %&amp;gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Note: The 'application' is your &lt;code&gt;&amp;lt;filename&amp;gt;&lt;/code&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  Import bootstrap in &lt;code&gt;app/javascript&lt;/code&gt;
&lt;/h2&gt;

&lt;p&gt;In &lt;code&gt;app/javascript&lt;/code&gt; create a folder &lt;code&gt;stylesheets&lt;/code&gt; and create &lt;code&gt;application.scss&lt;/code&gt; in the &lt;code&gt;stylesheets&lt;/code&gt; folder&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;// The file structure should look like this
// Note application.scss can be changed to &amp;lt;filename.scss&amp;gt;
app
 |_ javascript
     |_ stylesheets
         |_ application.scss
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Then, import the bootstrap in the file&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;// In app/javascript/stylesheets/application.scss

@import "bootstrap"
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Then, put the following code in the bottom of the &lt;code&gt;app/javascript/packs/application.js&lt;/code&gt; file&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;// In app/javascript/packs/application.js

import "bootstrap"
import "../stylesheets/application"

// Remember to change it to &amp;lt;filename&amp;gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h2&gt;
  
  
  Now, let's do testing
&lt;/h2&gt;

&lt;p&gt;In &lt;code&gt;app/views/layouts/application.html.erb&lt;/code&gt;, put the following code in your &lt;code&gt;&amp;lt;body&amp;gt;&lt;/code&gt; tag and before the &lt;code&gt;&amp;lt;%= yield %&amp;gt;&lt;/code&gt; tag.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;&amp;lt;body&amp;gt;
    &amp;lt;nav class="navbar navbar-expand-lg navbar-light bg-light"&amp;gt;
      &amp;lt;div class="container-fluid"&amp;gt;
        &amp;lt;a class="navbar-brand" href="#"&amp;gt;Navbar&amp;lt;/a&amp;gt;
        &amp;lt;button class="navbar-toggler" type="button" data-bs-toggle="collapse" data-bs-target="#navbarSupportedContent" aria-controls="navbarSupportedContent" aria-expanded="false" aria-label="Toggle navigation"&amp;gt;
          &amp;lt;span class="navbar-toggler-icon"&amp;gt;&amp;lt;/span&amp;gt;
        &amp;lt;/button&amp;gt;
        &amp;lt;div class="collapse navbar-collapse" id="navbarSupportedContent"&amp;gt;
          &amp;lt;ul class="navbar-nav me-auto mb-2 mb-lg-0"&amp;gt;
            &amp;lt;li class="nav-item"&amp;gt;
              &amp;lt;a class="nav-link active" aria-current="page" href="#"&amp;gt;Home&amp;lt;/a&amp;gt;
            &amp;lt;/li&amp;gt;
            &amp;lt;li class="nav-item"&amp;gt;
              &amp;lt;a class="nav-link" href="#"&amp;gt;Link&amp;lt;/a&amp;gt;
            &amp;lt;/li&amp;gt;
            &amp;lt;li class="nav-item dropdown"&amp;gt;
              &amp;lt;a class="nav-link dropdown-toggle" href="#" id="navbarDropdown" role="button" data-bs-toggle="dropdown" aria-expanded="false"&amp;gt;
                Dropdown
              &amp;lt;/a&amp;gt;
              &amp;lt;ul class="dropdown-menu" aria-labelledby="navbarDropdown"&amp;gt;
                &amp;lt;li&amp;gt;&amp;lt;a class="dropdown-item" href="#"&amp;gt;Action&amp;lt;/a&amp;gt;&amp;lt;/li&amp;gt;
                &amp;lt;li&amp;gt;&amp;lt;a class="dropdown-item" href="#"&amp;gt;Another action&amp;lt;/a&amp;gt;&amp;lt;/li&amp;gt;
                &amp;lt;li&amp;gt;&amp;lt;hr class="dropdown-divider"&amp;gt;&amp;lt;/li&amp;gt;
                &amp;lt;li&amp;gt;&amp;lt;a class="dropdown-item" href="#"&amp;gt;Something else here&amp;lt;/a&amp;gt;&amp;lt;/li&amp;gt;
              &amp;lt;/ul&amp;gt;
            &amp;lt;/li&amp;gt;
            &amp;lt;li class="nav-item"&amp;gt;
              &amp;lt;a class="nav-link disabled"&amp;gt;Disabled&amp;lt;/a&amp;gt;
            &amp;lt;/li&amp;gt;
          &amp;lt;/ul&amp;gt;
          &amp;lt;form class="d-flex"&amp;gt;
            &amp;lt;input class="form-control me-2" type="search" placeholder="Search" aria-label="Search"&amp;gt;
            &amp;lt;button class="btn btn-outline-success" type="submit"&amp;gt;Search&amp;lt;/button&amp;gt;
          &amp;lt;/form&amp;gt;
        &amp;lt;/div&amp;gt;
      &amp;lt;/div&amp;gt;
    &amp;lt;/nav&amp;gt;
    &amp;lt;%= yield %&amp;gt;
&amp;lt;/body&amp;gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Check whether the navbar (dropdown etc) is working.&lt;/p&gt;

&lt;h2&gt;
  
  
  Cheers~ Happy Coding!
&lt;/h2&gt;

</description>
    </item>
    <item>
      <title>Ruby on Rails: Switch From sqlite3 to Postgres using asdf</title>
      <dc:creator>Michelle Loh</dc:creator>
      <pubDate>Thu, 03 Mar 2022 07:45:31 +0000</pubDate>
      <link>https://dev.to/michellelwt/ruby-on-rails-switch-from-sqlite3-to-postgres-using-asdf-44cm</link>
      <guid>https://dev.to/michellelwt/ruby-on-rails-switch-from-sqlite3-to-postgres-using-asdf-44cm</guid>
      <description>&lt;p&gt;This article will be using &lt;code&gt;asdf&lt;/code&gt; to install postgres and then refer to the article &lt;a href="https://medium.com/geekculture/ruby-on-rails-switch-from-sqlite3-to-postgres-590009645c25" rel="noopener noreferrer"&gt;Ruby on Rails: Switch From sqlite3 to Postgres&lt;/a&gt; by Brenden Thornton to switch from sqlite3 to Postgres in Ruby on Rails.&lt;/p&gt;




&lt;h2&gt;
  
  
  Install required libraries in Ubuntu
&lt;/h2&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;sudo apt-get install build-essential libssl-dev libreadline-dev zlib1g-dev libcurl4-openssl-dev uuid-dev
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;






&lt;p&gt;If you have not installed &lt;code&gt;asdf&lt;/code&gt;, kindly checkout &lt;a href="https://dev.to/michellelwt/install-asdf-ruby-nodejs-and-yarn-in-wsl2-207o"&gt;Install asdf (ruby, nodejs and yarn) in WSL2&lt;/a&gt; to install &lt;code&gt;asdf&lt;/code&gt;, else just follow the following steps:&lt;/p&gt;

&lt;h2&gt;
  
  
  Add postgres plugin
&lt;/h2&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;$ asdf plugin add postgres
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;






&lt;h2&gt;
  
  
  Install postgres
&lt;/h2&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;asdf install postgres latest
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;ul&gt;
&lt;li&gt;Then, check the version installed (the versions mentioned here is the latest version I downloaded)
&lt;/li&gt;
&lt;/ul&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;$ asdf list
postgres
  14.2
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;ul&gt;
&lt;li&gt;Add to your shell
&lt;/li&gt;
&lt;/ul&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;asdf shell postgres 14.2
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;ul&gt;
&lt;li&gt;Add to global
&lt;/li&gt;
&lt;/ul&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;asdf global postgres 14.2
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h2&gt;
  
  
  Start postgres
&lt;/h2&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;pg_ctl start
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;The rest refer &lt;a href="https://medium.com/geekculture/ruby-on-rails-switch-from-sqlite3-to-postgres-590009645c25" rel="noopener noreferrer"&gt;Ruby on Rails: Switch From sqlite3 to Postgres&lt;/a&gt; from Update Gemfile to the end of the article.&lt;/p&gt;




&lt;p&gt;NOTE: &lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;For replacing &lt;code&gt;sqlite3&lt;/code&gt; to &lt;code&gt;postgres&lt;/code&gt; in &lt;code&gt;database.yml&lt;/code&gt; configuration, remember to switch the database and username to your database name and your username (check the code below with &lt;code&gt;[]&lt;/code&gt;). You can checkout &lt;a href="https://gist.github.com/jwo/4512764" rel="noopener noreferrer"&gt;GitHub&lt;/a&gt; on the configuration of &lt;code&gt;database.yml&lt;/code&gt;. Note that the [database_name] should be different for different environment.
&lt;/li&gt;
&lt;/ul&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;development:
  &amp;lt;&amp;lt;: *default
  database: [database_name_dev]

test:
  &amp;lt;&amp;lt;: *default
  database: [database_name_test]

production:
  &amp;lt;&amp;lt;: *default
  database: [database_name_prod]
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;ul&gt;
&lt;li&gt;I use
&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:create:all
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;instead of&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:setup
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;to create database since I also want to create production database. By default, &lt;code&gt;rake db:setup&lt;/code&gt; will not create production database even though we have mentioned &lt;code&gt;production&lt;/code&gt; in the &lt;code&gt;database.yml&lt;/code&gt;. Checkout &lt;a href="https://stackoverflow.com/questions/10301794/difference-between-rake-dbmigrate-dbreset-and-dbschemaload" rel="noopener noreferrer"&gt;Stackoverflow&lt;/a&gt; to understand the differences of some of the commands.&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;code&gt;rake db:create&lt;/code&gt; creates the database for that particular environment (either is development, test or production) but &lt;code&gt;rake db:create:all&lt;/code&gt; creates the databases for all these 3 environments.&lt;/li&gt;
&lt;li&gt;Remember to separate development database, test database and production database with different names!&lt;/li&gt;
&lt;li&gt;Check out "Run" and "Stop" to run and stop &lt;code&gt;postgres&lt;/code&gt; in &lt;a href="https://github.com/smashedtoatoms/asdf-postgres#run" rel="noopener noreferrer"&gt;asdf-postgres documentation&lt;/a&gt;
&lt;/li&gt;
&lt;/ul&gt;




&lt;p&gt;Cheers~ Happy Coding!&lt;/p&gt;




</description>
      <category>wsl2</category>
      <category>asdf</category>
      <category>sql</category>
      <category>postgres</category>
    </item>
    <item>
      <title>Install wsl2(GUI), asdf, dart, flutter, and android studio</title>
      <dc:creator>Michelle Loh</dc:creator>
      <pubDate>Tue, 05 Oct 2021 03:16:33 +0000</pubDate>
      <link>https://dev.to/michellelwt/install-wsl2-gui-asdf-flutter-and-android-studio-346e</link>
      <guid>https://dev.to/michellelwt/install-wsl2-gui-asdf-flutter-and-android-studio-346e</guid>
      <description>&lt;h2&gt;
  
  
  Install VMware Workstation Player and Ubuntu
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;Download here: &lt;a href="https://www.vmware.com/asean/products/workstation-player.html" rel="noopener noreferrer"&gt;VMware Workstation Player&lt;/a&gt;
&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F5cv4hwa2qe15j3dl4ckd.png" alt="VMware1"&gt;
&lt;/li&gt;
&lt;li&gt;Note that I download the 16.0 version (you may choose to download the latest version)
&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fkm1cd1oy07n76s1ztoen.png" alt="VMware2"&gt;
&lt;/li&gt;
&lt;li&gt;Follow video: &lt;a href="https://www.youtube.com/watch?v=9rUhGWijf9U&amp;amp;list=PLW1T-ydybWi4pW7Tg9KNHWvsyC_j5RS_p&amp;amp;index=4&amp;amp;t=43s" rel="noopener noreferrer"&gt;Install Ubuntu 20.04 LTS on VMware Workstation Player&lt;/a&gt; (whole video)&lt;/li&gt;
&lt;/ul&gt;




&lt;h2&gt;
  
  
  Update Software Updater
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;You can directly click the software updater icon (it will automatically check for updates)
&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fmmurw16dueaxs1bsbjab.png" alt="Software-Updater"&gt;
&lt;/li&gt;
&lt;/ul&gt;




&lt;h2&gt;
  
  
  Restart VMware
&lt;/h2&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Faxp13h3llycakxvlpiac.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Faxp13h3llycakxvlpiac.png" alt="Restart"&gt;&lt;/a&gt;&lt;/p&gt;




&lt;h2&gt;
  
  
  Install Visual Studio Code
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;In Ubuntu Software, install VSCode
&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Ft8n43v0vqzasnenrue3n.png" alt="VSCode"&gt;
&lt;/li&gt;
&lt;/ul&gt;




&lt;h2&gt;
  
  
  Setup in VSCode
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;After installation, open up VSCode, download plugins for Flutter and Dart&lt;/li&gt;
&lt;li&gt;Restart VSCode&lt;/li&gt;
&lt;/ul&gt;




&lt;h2&gt;
  
  
  Install Android Studio
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;In Ubuntu Software, install Android Studio
&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fbyjoeo4jujl188up8bq4.png" alt="Android Studio"&gt;
&lt;/li&gt;
&lt;li&gt;Open Android Studio, finish installation according to recommendation settings (you may customise the settings)&lt;/li&gt;
&lt;/ul&gt;




&lt;h2&gt;
  
  
  Setup in Android Studio
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;After installation, open up Android Studio, on your left, click &lt;code&gt;Plugins&lt;/code&gt; and search for Flutter&lt;/li&gt;
&lt;li&gt;When install Flutter plugins, Android Studio will ask to install Dart, allow it to install Dart
&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F8gv0rkgysq317t427573.png" alt="Flutter plugins"&gt;
&lt;/li&gt;
&lt;li&gt;Restart Android Studio by clicking &lt;code&gt;Restart IDE&lt;/code&gt; after installation&lt;/li&gt;
&lt;/ul&gt;




&lt;h2&gt;
  
  
  Install asdf
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;Open Linux terminal (Ctrl + Alt + T)&lt;/li&gt;
&lt;li&gt;In your terminal, type &lt;code&gt;code .&lt;/code&gt; to open up VSCode&lt;/li&gt;
&lt;li&gt;Close Linux terminal and open another terminal in VSCode&lt;/li&gt;
&lt;li&gt;Download package information from all configured sources by typing the following code
```
&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;$ sudo apt-get update&lt;/p&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;- Follow the documentation in [asdf virtual manager Documentation](http://asdf-vm.com/) to install `asdf`
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;$ sudo apt install curl git&lt;br&gt;
$ git clone &lt;a href="https://github.com/asdf-vm/asdf.git" rel="noopener noreferrer"&gt;https://github.com/asdf-vm/asdf.git&lt;/a&gt; ~/.asdf --branch v0.8.1&lt;/p&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;- Add the following lines at the end of `.bashrc` file
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;. $HOME/.asdf/asdf.sh&lt;br&gt;
. $HOME/.asdf/completions/asdf.bash&lt;/p&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;- Save the `.bashrc` file and close the file
- Call `code ~/.bashrc` in your terminal to double check whether the lines is saved

---

## Close and refresh terminal
- Close your terminal by clicking the rubbish bin icon
- Reopen the terminal

---

## Install flutter and dart using asdf
- Install flutter and dart plugins
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;$ asdf plugin add flutter&lt;br&gt;
$ asdf plugin add dart&lt;/p&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;- List all flutter and dart versions
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;$ asdf list all flutter&lt;br&gt;
$ asdf list all dart&lt;/p&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;(The picture below shows the all the flutter versions)
![Flutter-versions](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/7dmumugu4b548jlsa1rg.png)
- Install dart and the flutter stable version (mine here is 2.5.2-stable)
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;$ asdf install flutter 2.5.2-stable&lt;br&gt;
$ asdf install dart 2.14.3&lt;/p&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;- After installation, put the versions in global
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;$ asdf global flutter 2.5.2-stable&lt;br&gt;
$ asdf global dart 2.14.3&lt;/p&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;- Open flutter doctor to check
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;$ flutter doctor&lt;/p&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;![CMD-line-missing](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/lfe7geg2hsd44u6x5tcp.png)

---

## Fix cmdline-tools component is missing
- Follow video: [Fix-missing-cmdline-tools](https://www.youtube.com/watch?v=XHZ1CyIBKD8&amp;amp;list=PLW1T-ydybWi4pW7Tg9KNHWvsyC_j5RS_p&amp;amp;index=5)
- Check again using `flutter doctor`
![flutter-license](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/qw4f0q3m5ur6brajgkh0.png)

## Support license
- Agree the license
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;$ flutter doctor --android-licenses&lt;/p&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;- Check again using `flutter doctor`
![All-done](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/uk93fdka0wrxxo9djgp5.png)

---

## Copy the installed PATH
- Find where flutter and dart are installed
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;$ asdf where flutter&lt;br&gt;
$ asdf where dart&lt;/p&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;- Remember the following lines(or copy them to a text file)
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;/home/[user]/.asdf/installs/flutter/2.5.2-stable&lt;br&gt;
/home/[user]/.asdf/installs/dart/2.14.3&lt;/p&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;NOTE: the [user] above is refer to the user name in Linux

---

## Export Flutter PATH in VSCode
- Open the Command Palette in VSCode (Ctrl + Shift + P)
- Type out the `Flutter: New Project`
![Command-Palette](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/79fhijle4blnarn50d60.png)
- It will show `Could not find a Flutter SDK`
![Flutter-SDK](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/xa3471t9b1jvbkzlfk6f.png)
- Select `Locate SDK`
- Go to `home &amp;gt; [user]`
- List out the hidden files `Ctrl + H`
- Go to `asdf &amp;gt; installs &amp;gt; flutter`
- Select `2.5.2-stable` as SDK (note that my version file may differ from yours)

---

## Export Dart PATH in VSCode
- Open the Command Palette in VSCode (Ctrl + Shift + P)
- Type out the `Dart: New Project`
- It will show `Could not find a Dart SDK`
- Select `Locate SDK`
- Go to `home &amp;gt; [user]`
- List out the hidden files `Ctrl + H`
- Go to `asdf &amp;gt; installs &amp;gt; dart`
- Select `2.14.3` as SDK (note that my version file may differ from yours)

---

## Export PATH in Android Studio
- Open your Android Studio
- Go to `Customize &amp;gt; All Settings`
![Customize](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/ry7tex830ie9j8i6065l.png)
- Go to `Appearance &amp;gt; Path Variables` and Click the `+` icon
![PATH](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/g8tcy3zos2og16ibe6qg.png)
- Set the PATH Variables (You can refer the picture below)
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h1&gt;
  
  
  For Flutter
&lt;/h1&gt;

&lt;p&gt;Name: FLUTTER_SDK&lt;br&gt;
Value: /home/[user]/.asdf/installs/flutter/2.5.2-stable&lt;/p&gt;

&lt;h1&gt;
  
  
  For Dart
&lt;/h1&gt;

&lt;p&gt;Name: DART_SDK&lt;br&gt;
Value: /home/[user]/.asdf/installs/dart/2.14.3&lt;/p&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;![lIKE-THIS](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/wlk1spel1ovdfx29byih.png)
- Finally, click `OK` and `OK`

---

## Refresh VSCode and Android Studio
- Close your VSCode and Android Studio
- Open VSCode and Android Studio
- Now, you are good to go😉
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;

</description>
      <category>flutter</category>
      <category>dart</category>
      <category>android</category>
      <category>mobile</category>
    </item>
    <item>
      <title>Install asdf (ruby, nodejs and yarn) in WSL2</title>
      <dc:creator>Michelle Loh</dc:creator>
      <pubDate>Mon, 30 Aug 2021 10:03:10 +0000</pubDate>
      <link>https://dev.to/michellelwt/install-asdf-ruby-nodejs-and-yarn-in-wsl2-207o</link>
      <guid>https://dev.to/michellelwt/install-asdf-ruby-nodejs-and-yarn-in-wsl2-207o</guid>
      <description>&lt;h2&gt;
  
  
  What is WSL2
&lt;/h2&gt;

&lt;p&gt;Read &lt;a href="https://docs.microsoft.com/en-us/windows/wsl/install-win10" rel="noopener noreferrer"&gt;Microsoft WSL2 Documentation&lt;/a&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  What is asdf
&lt;/h2&gt;

&lt;p&gt;Read &lt;a href="http://asdf-vm.com/" rel="noopener noreferrer"&gt;asdf virtual manager Documentation&lt;/a&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  Install WSL2
&lt;/h2&gt;

&lt;p&gt;Video Reference: &lt;a href="https://www.youtube.com/watch?v=_fntjriRe48&amp;amp;t=704s" rel="noopener noreferrer"&gt;WSL 2: Getting started&lt;/a&gt; (Watch from Overview until PowerShell Commands (0:00 - 8.23))&lt;/p&gt;

&lt;h2&gt;
  
  
  Before installing asdf
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;In your Ubuntu, type &lt;code&gt;code .&lt;/code&gt; to open up Visual Studio Code (VS Code)&lt;/li&gt;
&lt;li&gt;Open your terminal in VS Code&lt;/li&gt;
&lt;li&gt;In your terminal, it should be in already be Linux not Windows (You are in Windows if you have something like &lt;code&gt;PS C:\Users\&amp;gt;&lt;/code&gt;), go to linux by typing &lt;code&gt;wsl&lt;/code&gt;
&lt;/li&gt;
&lt;/ul&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;$ PS C:\Users\&amp;gt;wsl

# Go to root directory
$ &amp;lt;user_name&amp;gt;: cd /
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;ul&gt;
&lt;li&gt;Do the following to get dependencies for wsl2 (else you might get the error when install ruby: &lt;code&gt;BUILD FAILED (Ubuntu 20.04 using ruby-build 20210804)&lt;/code&gt;)&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;For more information related to solving this problem: read &lt;a href="https://discuss.rubyonrails.org/t/installing-rails-on-ubuntu-20-04-showing-build-failed-error/75642/4" rel="noopener noreferrer"&gt;here&lt;/a&gt;&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;$ sudo apt-get update
$ sudo apt install autoconf bison build-essential libssl-dev libyaml-dev libreadline-dev zlib1g-dev libncurses-dev libffi-dev libgdbm-dev
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;






&lt;h2&gt;
  
  
  Install asdf
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;Follow the documentation of in &lt;a href="http://asdf-vm.com/" rel="noopener noreferrer"&gt;asdf virtual manager Documentation&lt;/a&gt;
&lt;/li&gt;
&lt;/ul&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;$ sudo apt install curl git
$ git clone https://github.com/asdf-vm/asdf.git ~/.asdf --branch v0.8.1
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;ul&gt;
&lt;li&gt;Add &lt;code&gt;. $HOME/.asdf/asdf.sh&lt;/code&gt; and &lt;code&gt;. $HOME/.asdf/completions/asdf.bash&lt;/code&gt; in the end of &lt;code&gt;.bashrc&lt;/code&gt; file&lt;/li&gt;
&lt;li&gt;Call &lt;code&gt;code ~/.bashrc&lt;/code&gt; in your terminal&lt;/li&gt;
&lt;/ul&gt;




&lt;h2&gt;
  
  
  Close and refresh terminal
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;Close your terminal by clicking the rubbish bin icon&lt;/li&gt;
&lt;li&gt;Reopen the terminal&lt;/li&gt;
&lt;/ul&gt;




&lt;h2&gt;
  
  
  Add plugins
&lt;/h2&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;$ asdf plugin add ruby
$ asdf plugin add nodejs
$ asdf plugin add yarn
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;






&lt;h2&gt;
  
  
  Install language
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;Install ruby, nodejs and yarn latest version (or you can specify the version needed)
&lt;/li&gt;
&lt;/ul&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;$ asdf install ruby latest
$ asdf install nodejs latest
$ asdf install yarn latest
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;ul&gt;
&lt;li&gt;Check the version installed (the versions mentioned here is the latest version I downloaded)
&lt;/li&gt;
&lt;/ul&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;$ asdf list
nodejs
  16.8.0
ruby
  3.0.2
yarn
  1.22.11
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;ul&gt;
&lt;li&gt;Add to your shell
&lt;/li&gt;
&lt;/ul&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;$ asdf shell ruby 3.0.2
$ asdf shell nodejs 16.8.0
$ asdf shell yarn 1.22.11
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;ul&gt;
&lt;li&gt;Add to global
&lt;/li&gt;
&lt;/ul&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;$ asdf global ruby 3.0.2
$ asdf global nodejs 16.8.0
$ asdf global yarn 1.22.11
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;






&lt;h2&gt;
  
  
  Install gems
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;Check where is languages installed
&lt;/li&gt;
&lt;/ul&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;$ type -a ruby
ruby is /home/&amp;lt;user&amp;gt;/.asdf/shims/ruby

$ type -a node
node is /home/&amp;lt;user&amp;gt;/.asdf/shims/node

$ type -a yarn
yarn is /home/&amp;lt;user&amp;gt;/.asdf/shims/yarn
yarn is /mnt/c/Program Files (x86)/Yarn/bin/yarn
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;ul&gt;
&lt;li&gt;Check which ruby and gems your directory is referring to (in case you have more than 1 ruby version installed)
&lt;/li&gt;
&lt;/ul&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;$ which ruby
/home/&amp;lt;user&amp;gt;/.asdf/shims/ruby

$ which gem
/home/&amp;lt;user&amp;gt;/.asdf/shims/gem
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;ul&gt;
&lt;li&gt;If not in &lt;code&gt;.asdf/shims&lt;/code&gt;, do &lt;code&gt;asdf reshim ruby 3.0.2&lt;/code&gt; (specify the version yourself, mine here is 3.0.2)&lt;/li&gt;
&lt;li&gt;Install gems
&lt;/li&gt;
&lt;/ul&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;$ gem install rails
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;ul&gt;
&lt;li&gt;The rest can follow &lt;a href="https://www.youtube.com/watch?v=Ji2jhj7t0bk&amp;amp;t=317s" rel="noopener noreferrer"&gt;Installing Ruby on Rails Using asdf&lt;/a&gt; (starting 5:24)&lt;/li&gt;
&lt;/ul&gt;




&lt;h2&gt;
  
  
  References
&lt;/h2&gt;

&lt;ol&gt;
&lt;li&gt;&lt;a href="https://docs.microsoft.com/en-us/windows/wsl/install-win10" rel="noopener noreferrer"&gt;Microsoft WSL2 Documentation&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="http://asdf-vm.com/" rel="noopener noreferrer"&gt;asdf virtual manager Documentation&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://www.youtube.com/watch?v=_fntjriRe48&amp;amp;t=704s" rel="noopener noreferrer"&gt;WSL 2: Getting started&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://discuss.rubyonrails.org/t/installing-rails-on-ubuntu-20-04-showing-build-failed-error/75642/4" rel="noopener noreferrer"&gt;BUILD FAILED (Ubuntu 20.04 using ruby-build 20210804)&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://www.youtube.com/watch?v=njM3-eejlho" rel="noopener noreferrer"&gt;Installing asdf and using it to install Go, Python &amp;amp; Terraform&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://www.youtube.com/watch?v=Ji2jhj7t0bk&amp;amp;t=317s" rel="noopener noreferrer"&gt;Installing Ruby on Rails Using asdf&lt;/a&gt;&lt;/li&gt;
&lt;/ol&gt;

</description>
      <category>wsl2</category>
      <category>asdf</category>
      <category>ruby</category>
      <category>node</category>
    </item>
  </channel>
</rss>
