<?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: florianfelsing</title>
    <description>The latest articles on DEV Community by florianfelsing (@florianfelsing).</description>
    <link>https://dev.to/florianfelsing</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%2F869103%2F0d22f2f8-d0dc-4a1d-bf56-eb4b8224fced.jpeg</url>
      <title>DEV Community: florianfelsing</title>
      <link>https://dev.to/florianfelsing</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/florianfelsing"/>
    <language>en</language>
    <item>
      <title>How to Add Custom Folders to the Rails Asset Pipeline</title>
      <dc:creator>florianfelsing</dc:creator>
      <pubDate>Fri, 23 Sep 2022 10:29:13 +0000</pubDate>
      <link>https://dev.to/florianfelsing/how-to-add-custom-folders-to-the-rails-asset-pipeline-ok4</link>
      <guid>https://dev.to/florianfelsing/how-to-add-custom-folders-to-the-rails-asset-pipeline-ok4</guid>
      <description>&lt;p&gt;Sometimes you may find yourself in the situation of wanting to add a custom folder to the Rails assets pipeline in order to keep your Rails application neatly organized.&lt;/p&gt;

&lt;p&gt;Say, for example, you would like to have additional folders called "fonts" or "icons" for placing your custom fonts and icons there, keeping them out of the "images" folder.&lt;/p&gt;

&lt;p&gt;This can be achieved very easily.&lt;/p&gt;

&lt;p&gt;Go to &lt;code&gt;config/assets.rb&lt;/code&gt;, where you will find the following line, which is telling you what to do:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight ruby"&gt;&lt;code&gt;&lt;span class="c1"&gt;# Add additional assets to the asset load path.&lt;/span&gt;
&lt;span class="c1"&gt;# Rails.application.config.assets.paths &amp;lt;&amp;lt; Emoji.images_path&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;In order to register a custom folder within your application's assets folder, go ahead and add the following line:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight ruby"&gt;&lt;code&gt;&lt;span class="no"&gt;Rails&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;application&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;config&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;assets&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;paths&lt;/span&gt; &lt;span class="o"&gt;&amp;lt;&amp;lt;&lt;/span&gt; &lt;span class="no"&gt;Rails&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;root&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;join&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s2"&gt;"app"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="s2"&gt;"assets"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="s2"&gt;"fonts"&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;code&gt;Rails.root&lt;/code&gt; returns a &lt;a href="https://ruby-doc.org/stdlib-2.6.3/libdoc/pathname/rdoc/Pathname.html"&gt;Pathname object&lt;/a&gt;, which is plain old Ruby and adds it to the assets paths of your application.&lt;/p&gt;

&lt;p&gt;Now you can reference a downloaded font - say, for example in a stylesheet - like this:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight scss"&gt;&lt;code&gt;&lt;span class="k"&gt;@font-face&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
  &lt;span class="nl"&gt;font-family&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="s2"&gt;"Inter"&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
  &lt;span class="nl"&gt;src&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="sx"&gt;url("Inter-Medium.woff2")&lt;/span&gt; &lt;span class="nf"&gt;format&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s2"&gt;"woff2"&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="o"&gt;,&lt;/span&gt;
       &lt;span class="sx"&gt;url("Inter-Medium.woff")&lt;/span&gt; &lt;span class="nf"&gt;format&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s2"&gt;"woff"&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="o"&gt;,&lt;/span&gt;
       &lt;span class="sx"&gt;url("Inter-Medium.ttf")&lt;/span&gt; &lt;span class="nf"&gt;format&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s2"&gt;"truetype"&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
  &lt;span class="nl"&gt;font-weight&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="m"&gt;500&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
  &lt;span class="nl"&gt;font-style&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="nb"&gt;normal&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Further reading: &lt;a href="https://guides.rubyonrails.org/asset_pipeline.html"&gt;https://guides.rubyonrails.org/asset_pipeline.html&lt;/a&gt;&lt;/p&gt;

</description>
      <category>rails</category>
    </item>
    <item>
      <title>The Best Ruby on Rails Tutorials, Courses &amp; Resources (2023 and Beyond)</title>
      <dc:creator>florianfelsing</dc:creator>
      <pubDate>Wed, 27 Jul 2022 14:52:00 +0000</pubDate>
      <link>https://dev.to/florianfelsing/the-best-ruby-on-rails-tutorials-courses-resources-2022-and-beyond-2caj</link>
      <guid>https://dev.to/florianfelsing/the-best-ruby-on-rails-tutorials-courses-resources-2022-and-beyond-2caj</guid>
      <description>&lt;p&gt;&lt;em&gt;Last Update: 2022-01-13&lt;/em&gt;&lt;/p&gt;

&lt;p&gt;I'll keep this article always up to date, so come back from time to time.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Rails Tutorials for Beginners&lt;/strong&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;a href="https://open.appacademy.io/learn/full-stack-online"&gt;&lt;strong&gt;FREE App Academy Open&lt;/strong&gt;&lt;/a&gt; by App Academy&lt;/li&gt;
&lt;li&gt;
&lt;a href="https://www.learnenough.com/ruby-on-rails-7th-edition"&gt;&lt;strong&gt;$$$ Ruby on Rails Tutorial&lt;/strong&gt;&lt;/a&gt; by Michael Hartl&lt;/li&gt;
&lt;li&gt;
&lt;a href="https://learnetto.com/users/hrishio/courses/full-stack-rails"&gt;&lt;strong&gt;$$$ Full Stack Rails&lt;/strong&gt;&lt;/a&gt; by Hrishi Mittal&lt;/li&gt;
&lt;li&gt;
&lt;a href="https://www.theodinproject.com/paths/full-stack-ruby-on-rails/courses/ruby-on-rails"&gt;&lt;strong&gt;FREE Ruby on Rails&lt;/strong&gt;&lt;/a&gt; by The Odin Project&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;strong&gt;Advanced Rails Tutorials&lt;/strong&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;a href="https://rebuilding-rails.com/"&gt;&lt;strong&gt;$$$ Rebuilding Rails&lt;/strong&gt;&lt;/a&gt; by Noah Gibbs&lt;/li&gt;
&lt;li&gt;
&lt;a href="https://sustainable-rails.com/"&gt;&lt;strong&gt;$$$ Sustainable Web Development
with Ruby on Rails&lt;/strong&gt;&lt;/a&gt; by David Bryant Copeland&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;strong&gt;Rails Testing&lt;/strong&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;a href="https://www.codewithjason.com/complete-guide-to-rails-testing/"&gt;&lt;strong&gt;$$$ The Complete Guide to Rails Testing&lt;/strong&gt;&lt;/a&gt; by Jason Swett&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;strong&gt;Turbo &amp;amp; Hotwire&lt;/strong&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;a href="https://store.afomera.dev/learn-hotwire"&gt;&lt;strong&gt;FREE Learn Hotwire by Building a Forum&lt;/strong&gt;&lt;/a&gt; by Andrea Fomera&lt;/li&gt;
&lt;li&gt;
&lt;a href="https://pragmaticstudio.com/courses/hotwire-rails"&gt;&lt;strong&gt;$$$ Hotwire for Rails Developers&lt;/strong&gt;&lt;/a&gt; by The Pragmatic Studio&lt;/li&gt;
&lt;li&gt;
&lt;a href="https://www.hotrails.dev/turbo-rails"&gt;&lt;strong&gt;FREE The Turbo Rails Tutorial&lt;/strong&gt;&lt;/a&gt; by Alexandre Ruban&lt;/li&gt;
&lt;li&gt;
&lt;a href="https://hotrails.podia.com/rebuilding-turbo-rails"&gt;&lt;strong&gt;$$$ The Rebuilding turbo-rails Tutorial&lt;/strong&gt;&lt;/a&gt; by Alexandre Ruban&lt;/li&gt;
&lt;li&gt;
&lt;a href="https://railsandhotwirecodex.com/"&gt;&lt;strong&gt;$$$ The Rails and Hotwire Codex&lt;/strong&gt;&lt;/a&gt; by Ayush Newatia&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;strong&gt;JavaScript&lt;/strong&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;a href="https://pragmaticstudio.com/courses/unpacked-single-page-app-with-vue-rails"&gt;&lt;strong&gt;$$$ UnPacked: A Single-Page App with Vue.js and Rails&lt;/strong&gt;&lt;/a&gt; by The Pragmatic Studio&lt;/li&gt;
&lt;li&gt;
&lt;a href="https://learnetto.com/users/hrishio/courses/react-rails-course"&gt;&lt;strong&gt;$$$ The Complete React on Rails Course&lt;/strong&gt;&lt;/a&gt; by Hrishi Mittal&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;strong&gt;Other Tutorials&lt;/strong&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;a href="https://www.learnenough.com/action-cable"&gt;&lt;strong&gt;$$$ Learn Enough Action Cable to be Dangerous&lt;/strong&gt;&lt;/a&gt; by Michael Hartl&lt;/li&gt;
&lt;li&gt;
&lt;a href="https://julianrubisch.gumroad.com/l/acr/bf-2022"&gt;&lt;strong&gt;$$$ Advanced CableReady&lt;/strong&gt;&lt;/a&gt; by Julian Rubisch&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;strong&gt;DevOps&lt;/strong&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;a href="https://learnetto.com/users/jasonswett/courses/docker-for-beginners"&gt;&lt;strong&gt;$$$ Docker for Beginners&lt;/strong&gt;&lt;/a&gt; by Jason Swett&lt;/li&gt;
&lt;li&gt;
&lt;a href="https://diveintodocker.com/"&gt;&lt;strong&gt;$$$ Dive Into Docker&lt;/strong&gt;&lt;/a&gt; by Nick Janetakis&lt;/li&gt;
&lt;/ul&gt;




&lt;p&gt;&lt;strong&gt;YouTube Channels&lt;/strong&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;a href="https://www.youtube.com/c/Mixandgo"&gt;&lt;strong&gt;Mix &amp;amp; Go&lt;/strong&gt;&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://www.youtube.com/c/Deanin"&gt;&lt;strong&gt;Deanin&lt;/strong&gt;&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://www.youtube.com/c/GorailsTV"&gt;&lt;strong&gt;GoRails&lt;/strong&gt;&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://www.youtube.com/c/SupeRails"&gt;&lt;strong&gt;SupeRails by Yaroslav Shmarov&lt;/strong&gt;&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;




&lt;p&gt;&lt;strong&gt;Mentorship&lt;/strong&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;a href="https://firstrubyfriend.org"&gt;&lt;strong&gt;FREE firstrubyfriend.org&lt;/strong&gt;&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://mentorcruise.com/experts/rubyonrails"&gt;&lt;strong&gt;$$$ MentorCruise&lt;/strong&gt;&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;




&lt;p&gt;&lt;strong&gt;Podcasts&lt;/strong&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;a href="https://remoteruby.com/"&gt;&lt;strong&gt;Remote Ruby&lt;/strong&gt;&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://podcasts.apple.com/us/podcast/ruby-for-all/id1636775711"&gt;&lt;strong&gt;Ruby for All&lt;/strong&gt;&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://www.codewithjason.com/podcast/"&gt;&lt;strong&gt;The Code with Jason Podcast&lt;/strong&gt;&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;




&lt;p&gt;&lt;em&gt;Did I miss anything important? Is any of the linked to resources above no longer available our outdated? Please let me know in the comments!&lt;/em&gt;&lt;/p&gt;

</description>
      <category>rails</category>
      <category>ruby</category>
      <category>tutorial</category>
      <category>programming</category>
    </item>
    <item>
      <title>How To Set up a Ruby on Rails 7 Development Environment on Ubuntu 22.04 LTS</title>
      <dc:creator>florianfelsing</dc:creator>
      <pubDate>Wed, 01 Jun 2022 14:36:55 +0000</pubDate>
      <link>https://dev.to/florianfelsing/how-to-set-up-a-ruby-on-rails-7-development-environment-on-ubuntu-2204-lts-hki</link>
      <guid>https://dev.to/florianfelsing/how-to-set-up-a-ruby-on-rails-7-development-environment-on-ubuntu-2204-lts-hki</guid>
      <description>&lt;p&gt;In this post I will go through the steps required to set up a development environment for Ruby on Rails 7 on Ubuntu 22.04 LTS.&lt;/p&gt;

&lt;p&gt;I will be running &lt;a href="https://dev.to/florianfelsing/how-to-run-an-ubuntu-vm-on-windows-11-4oef"&gt;Ubuntu on a virtual machine&lt;/a&gt; using VirtualBox, however, the steps are basically the same when Ubuntu is your main OS.&lt;/p&gt;

&lt;h2&gt;
  
  
  Before You Start
&lt;/h2&gt;

&lt;p&gt;Before you get started, run these commands to update the list of available packages and to upgrade them, if an upgrade is available.&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 update
sudo apt upgrade
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h2&gt;
  
  
  Google Chrome
&lt;/h2&gt;

&lt;p&gt;Feel free to go with any browser you are comfortable working with in your development environment. Personally, I like working with Google Chrome.&lt;/p&gt;

&lt;p&gt;If you also like using Chrome, just download the .deb package via &lt;a href="https://www.google.com/chrome/?platform=linux"&gt;this page&lt;/a&gt; and install.&lt;/p&gt;

&lt;h2&gt;
  
  
  VSCode
&lt;/h2&gt;

&lt;p&gt;My go-to code-editor is Microsoft Visual Studio Code. The fastest way to install it goes via terminal. Simply execute the following command and you should be good to go:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;sudo snap install --classic code
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;In case you run VSCode on multiple machines and would like to automatically sync your settings between them, don't forget to turn on Settings Sync via the head icon on the bottom left of the screen.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--2-n_YTgQ--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/vnr7jrkg5r31lgervzsr.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--2-n_YTgQ--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/vnr7jrkg5r31lgervzsr.png" alt="Image description" width="880" height="694"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  Git
&lt;/h2&gt;

&lt;p&gt;Any developer needs Git, so let's install it.&lt;/p&gt;

&lt;p&gt;The quickest option here is install with default packages, which is fine unless you explicitly need to run the latest version of Git with all the newest available features.&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 install git
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;By running &lt;code&gt;git --version&lt;/code&gt; you can now check, which Git version is installed on your machine.&lt;/p&gt;

&lt;p&gt;There are also some standard configurations that I like to apply right away.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;git config --global user.name "Your Name"
git config --global user.email "your.email@example.com"
git config --global init.defaultBranch main
git config --global alias.co checkout
git config --global credential.helper "cache --timeout=86400"
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;This is what the above commands will do (in this exact order):&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Configure your username&lt;/li&gt;
&lt;li&gt;Configure your email address&lt;/li&gt;
&lt;li&gt;Set the name of the default branch to "main" (as opposed to "master")&lt;/li&gt;
&lt;li&gt;Create "co" as an alias for "checkout" - that way you won't need to write "git checkout main" anymore and go with "git co main" instead&lt;/li&gt;
&lt;li&gt;Make Git remember credentials for 24 hours&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;em&gt;Don't forget to replace the "Your Name" and "&lt;a href="mailto:your.email@example.com"&gt;your.email@example.com&lt;/a&gt;" values, before you execute those commands.&lt;/em&gt;&lt;/p&gt;

&lt;p&gt;By running &lt;code&gt;git config --list&lt;/code&gt; you should now be able to confirm that all of the above settings have been applied successfully.&lt;/p&gt;

&lt;h2&gt;
  
  
  rbenv and Ruby
&lt;/h2&gt;

&lt;p&gt;For managing my apps' Ruby environments, I like to roll with rbenv (short for &lt;em&gt;RuBy ENVironment&lt;/em&gt;).&lt;/p&gt;

&lt;p&gt;Install rbenv by executing the following commands:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;# Install dependencies required to install Ruby
sudo apt install git curl libssl-dev libreadline-dev zlib1g-dev autoconf bison build-essential libyaml-dev libreadline-dev libncurses5-dev libffi-dev libgdbm-dev

# Install rbenv via GitHub
curl -fsSL https://github.com/rbenv/rbenv-installer/raw/HEAD/bin/rbenv-installer | bash

# Add ~/.rbenv/bin to $PATH
echo 'export PATH="$HOME/.rbenv/bin:$PATH"' &amp;gt;&amp;gt; ~/.bashrc

# Load rbenv automatically
echo 'eval "$(rbenv init -)"' &amp;gt;&amp;gt; ~/.bashrc

# Apply changes to current Shell sessions
source ~/.bashrc
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Now run &lt;code&gt;type rbenv&lt;/code&gt;. If the output is as in the screenshot below, you have done everything correctly up to this point.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--eG4MSkpQ--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/e0ijcb6u5951c4hyf637.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--eG4MSkpQ--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/e0ijcb6u5951c4hyf637.png" alt="Image description" width="786" height="533"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Next, you'll want to run the following commands:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;# Download Ruby build plugin via GitHub
git clone https://github.com/rbenv/ruby-build.git

# Install Ruby build plugin
cat ruby-build/install.sh
PREFIX=/usr/local sudo ./ruby-build/install.sh
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Now everything is set up and ready to install Ruby. The next command will show you the latest stable releases for each Ruby implementation:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;rbenv install -l
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;I'll go with the (at the time of writing) latest Ruby version 3.1.2.&lt;/p&gt;

&lt;p&gt;These commands will install it via rbenv and make it the global (= standard) Ruby version to run on your system:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;rbenv install 3.1.2
rbenv global 3.1.2
rbenv rehash
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;To conclude this segment, let's also install some gems that you will definitely need in your Rails development environment:&lt;br&gt;
&lt;/p&gt;

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

&lt;/div&gt;



&lt;p&gt;Feel free to install any other gems at this point, that you know you'll need later on.&lt;/p&gt;

&lt;h2&gt;
  
  
  SQLite
&lt;/h2&gt;

&lt;p&gt;When you are developing with Rails, there is a high chance that at some point you will run into an SQLite database, especially with small projects that have been mostly set up for testing and experimenting.&lt;/p&gt;

&lt;p&gt;Install SQLite3 by running the following command:&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 install sqlite3
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Confirm that running &lt;code&gt;sqlite3 –version&lt;/code&gt; works and shows you the SQLite version installed on your system now.&lt;/p&gt;

&lt;h2&gt;
  
  
  PostgreSQL
&lt;/h2&gt;

&lt;p&gt;Run the following command to install PostgreSQL on your machine:&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 install postgresql postgresql-contrib
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Since we are not intending to connect to PostgreSQL databases from other machines, we can follow the [simple PostgreSQL setup] guide (&lt;a href="https://help.ubuntu.com/community/PostgreSQL"&gt;https://help.ubuntu.com/community/PostgreSQL&lt;/a&gt;) as described in the linked article.&lt;/p&gt;

&lt;p&gt;&lt;em&gt;"Since the only user who can connect to a fresh install is the postgres user, here is how to create yourself a database account (which is in this case also a database superuser) with the same name as your login name and then create a password for the user:"&lt;/em&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 -u postgres createuser --superuser $USER
sudo -u postgres psql
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;You will also want to create a password for your user:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;postgres=# \password &amp;lt;username&amp;gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Running the above command will trigger a dialogue that will allow you to set it.&lt;/p&gt;

&lt;p&gt;Lastly, also pay attention to this advice given on ubuntu.com:&lt;/p&gt;

&lt;p&gt;&lt;em&gt;Client programs, by default, connect to the local host using your Ubuntu login name and expect to find a database with that name too. So to make things REALLY easy, use your new superuser privileges granted above to create a database with the same name as your login name:&lt;/em&gt;&lt;/p&gt;

&lt;p&gt;So let's do just this:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;sudo -u postgres createdb $USER
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;You should be able to run &lt;code&gt;psql&lt;/code&gt; without any error messages now.&lt;/p&gt;

&lt;h2&gt;
  
  
  nvm and Node.js
&lt;/h2&gt;

&lt;p&gt;Just like with Ruby, we will want to use a version manager with Node to help us manage any conflicts between versions and dependencies.&lt;/p&gt;

&lt;p&gt;The version manager will be nvm and you can install it using 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;# Download and run nvm install script
curl -o- https://raw.githubusercontent.com/nvm-sh/nvm/v0.39.1/install.sh | bash
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Apply these changes to current Shell session using &lt;code&gt;source ~/.bashrc&lt;/code&gt; before you continue so that the &lt;code&gt;nvm&lt;/code&gt; command becomes available.&lt;/p&gt;

&lt;p&gt;Now run the following command to install and use the latest stable version of Node:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;nvm install --lts
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;If everything went well, &lt;code&gt;node -v&lt;/code&gt; should now return you the latest stable Node version.&lt;/p&gt;

&lt;p&gt;&lt;em&gt;I hope this guide was helpful to you. And please let me know in case you have any questions, suggestions or comments.&lt;/em&gt;&lt;/p&gt;

</description>
      <category>rails</category>
      <category>ubuntu</category>
      <category>tutorial</category>
    </item>
    <item>
      <title>How To Run an Ubuntu VM on Windows 11</title>
      <dc:creator>florianfelsing</dc:creator>
      <pubDate>Sat, 28 May 2022 16:33:05 +0000</pubDate>
      <link>https://dev.to/florianfelsing/how-to-run-an-ubuntu-vm-on-windows-11-4oef</link>
      <guid>https://dev.to/florianfelsing/how-to-run-an-ubuntu-vm-on-windows-11-4oef</guid>
      <description>&lt;p&gt;In this post, I will show you how to create an Ubuntu VM (&lt;em&gt;virtual machine&lt;/em&gt;) on Windows 11, using &lt;a href="https://www.virtualbox.org/" rel="noopener noreferrer"&gt;VirtualBox&lt;/a&gt;.&lt;/p&gt;

&lt;p&gt;The Ubuntu version used in this guide is going to be 22.04 LTS, however, the process should look pretty much identical for other versions of Ubuntu.&lt;/p&gt;

&lt;h2&gt;
  
  
  Download and Install VirtualBox
&lt;/h2&gt;

&lt;p&gt;Download the VirtualBox platform packages for Windows hosts on &lt;a href="https://www.virtualbox.org/wiki/Downloads" rel="noopener noreferrer"&gt;this page&lt;/a&gt; and then simply install the software on your computer.&lt;/p&gt;

&lt;h2&gt;
  
  
  Download an Ubuntu Image
&lt;/h2&gt;

&lt;p&gt;&lt;a href="https://ubuntu.com/download/desktop" rel="noopener noreferrer"&gt;Download&lt;/a&gt; an Ubuntu image, in this case Ubuntu 22.04 LTS.&lt;/p&gt;

&lt;p&gt;The .iso file is over 3 GB in size, so depending on your connection, this step may take a while.&lt;/p&gt;

&lt;h2&gt;
  
  
  Creating the Ubuntu Virtual Machine
&lt;/h2&gt;

&lt;p&gt;Open VirtualBox and click "New".&lt;/p&gt;

&lt;p&gt;Enable &lt;em&gt;Expert Mode&lt;/em&gt;, give your VM a name, choose "Linux" as type and indicate, which version of Linux you will be using.&lt;/p&gt;

&lt;p&gt;Also, make sure to allocate your VM enough memory. In my case, I went with 4 GB, although less should easily do in most cases. As a minimum, I'd recommend you go with 2 GB.&lt;/p&gt;

&lt;p&gt;This is a value you can change easily later on, so don't worry about it too much.&lt;/p&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%2Frs9259db007ji1s88xj0.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%2Frs9259db007ji1s88xj0.png" alt="Creating an Ubuntu VM inside VirtualBox"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;When you are done, click the "Create" button.&lt;/p&gt;

&lt;p&gt;In the next window, confirm the directory where your VM file is going to be stored.&lt;/p&gt;

&lt;p&gt;Unless you know what you are doing, choose "VDI (VirtualBox Disk Image)" as the hard disk file type and decide, how much space you would like to allocate to your virtual machine.&lt;/p&gt;

&lt;p&gt;The latter is a bit more complicated to change later on than for example the available RAM, so best go with a value that will be enough for quite a while. In my case, I went with dynamically allocated 100 GB. As a minimum, I'd recommend 15 GB.&lt;/p&gt;

&lt;p&gt;The main advantage of dynamic allocation is that on your host OS only the actual space used by the VM will be used, whereas with fixed allocation, the amount of space you choose will be taken immediately.&lt;/p&gt;

&lt;p&gt;Fixed allocation can have a performance benefit, however, in &lt;em&gt;most&lt;/em&gt; cases you will not notice the difference at all.&lt;/p&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%2Fezzotuao54occxdxhhjz.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%2Fezzotuao54occxdxhhjz.png" alt="Settings for Ubuntu VM"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Click the "Create" button.&lt;/p&gt;

&lt;h2&gt;
  
  
  Optimal Settings
&lt;/h2&gt;

&lt;p&gt;Before you move on to the next step, choose "Settings". Then apply the optimal settings described next.&lt;/p&gt;

&lt;p&gt;&lt;em&gt;&lt;strong&gt;Attention:&lt;/strong&gt; These are no hard-written rules, so take them with a grain of salt and feel free to adapt to your own needs.&lt;/em&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;System &amp;gt; Motherboard:&lt;/strong&gt; Enable EFI&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;System &amp;gt; Processor:&lt;/strong&gt; Set CPU cores to half of your available cores&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;System &amp;gt; Display:&lt;/strong&gt; Increase video memory to 128 MB, enable 3D acceleration&lt;/li&gt;
&lt;/ul&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%2Fs5j0137pj055sk200v2g.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%2Fs5j0137pj055sk200v2g.png" alt="Optimal settings for Ubuntu VMs"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  Installing Ubuntu
&lt;/h2&gt;

&lt;p&gt;Start your virtual machine now and choose the Ubuntu image your downloaded earlier as your startup disk.&lt;/p&gt;

&lt;p&gt;Choose "Try or install Ubuntu" and simply follow the normal Ubuntu installation flow, choosing the settings you deem adequate.&lt;/p&gt;

&lt;p&gt;If you need help at any time, you may consult this guide: &lt;a href="https://ubuntu.com/tutorials/install-ubuntu-desktop#5-installation-setup" rel="noopener noreferrer"&gt;&lt;/a&gt;&lt;/p&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%2Fyfppo449mt3ryu081ibg.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%2Fyfppo449mt3ryu081ibg.png" alt="Installing Ubuntu on VirtualBox"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  What To Do After Ubuntu Has Been Installed?
&lt;/h2&gt;

&lt;p&gt;Congratulations, Ubuntu should now be up and running. Here is a list of things you might want to do before you proceed:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Change screen resolution to the resolution of your monitor, as the default will be 800 x 600&lt;/li&gt;
&lt;li&gt;Run any updates that Ubuntu is suggesting&lt;/li&gt;
&lt;li&gt;Switch between windowed mode and full screen mode by pressing your host key + F; your host key is the one displayed on the bottom right of your VM instance, in my case &lt;em&gt;"STRG-Rechts"&lt;/em&gt; (German for "CTRL-right"&lt;/li&gt;
&lt;li&gt;Connect with your Google account, as this will give you instant access to your Google Drive files from within Ubuntu&lt;/li&gt;
&lt;li&gt;Install Guest Additions (more below)&lt;/li&gt;
&lt;li&gt;Set up a shared folder (more even further below)&lt;/li&gt;
&lt;/ul&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%2Fhawo23j7xexesib40p4n.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%2Fhawo23j7xexesib40p4n.png" alt="Ubuntu Desktop"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;em&gt;&lt;strong&gt;Note:&lt;/strong&gt; There are some cases where the native resolution of your monitor just won't show up, despite everything apparently having been set up correctly. I've published a &lt;a href="https://github.com/florianfelsing/ubuntu-change-screen-resolution-shell-script" rel="noopener noreferrer"&gt;Shell script on GitHub&lt;/a&gt; that can help you fix this, by forcing the desired screen resolution.&lt;/em&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  Installing Guest Additions
&lt;/h2&gt;

&lt;p&gt;This point is specific to Ubuntu as a virtual machine. Guest Additions is an additional piece of software that improves&lt;br&gt;
integration between your virtual machine your host OS.&lt;/p&gt;

&lt;p&gt;In order to install Guest Additions, first boot to the Desktop, then select &lt;em&gt;Devices &amp;gt; Insert Guest Additions CD&lt;/em&gt;.&lt;/p&gt;

&lt;p&gt;In some cases you can now simply install Guest Additions and you are good to go.&lt;/p&gt;

&lt;p&gt;It's also possible, however, that clicking the "Run Software" button won't do anything. In this case, do a right click and open the CD folder in your terminal.&lt;/p&gt;

&lt;p&gt;Execute by typing 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;sudo ./VBoxLinuxAdditions.run
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;If installing guest additions didn't work for you before, your terminal will now give you some information about &lt;em&gt;why&lt;/em&gt; it didn't work.&lt;/p&gt;

&lt;p&gt;In my case, a required package was missing, which I was able to install by executing the following commands:&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-get install build-essential gcc make perl dkms
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;After that, everything went smoothly.&lt;/p&gt;

&lt;p&gt;Installing Guest Additions can sometimes be a bit tricky - so feel free to comment in case you are struggling and I will try to help.&lt;/p&gt;

&lt;h2&gt;
  
  
  Setting up a Shared Folder
&lt;/h2&gt;

&lt;p&gt;In order to set up a shared folder, again go to your VMs settings and this time navigate to "Shared Folders".&lt;/p&gt;

&lt;p&gt;Now choose a path for your shared folder on the host OS and apply the same settings you can see in the screenshot below.&lt;/p&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%2Fl8bzldr5i1b0ror1tgkr.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%2Fl8bzldr5i1b0ror1tgkr.png" alt="Setting up a shared folder for Ubuntu VM"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;When you start your VM again now, the shared folder should already be showing up, however, it is likely that you are receiving the following error message when you try to open it: &lt;/p&gt;

&lt;p&gt;&lt;em&gt;This location could not be displayed. You do not have the permissions necessary to view the contents of "Shared_Folder"&lt;/em&gt;&lt;/p&gt;

&lt;p&gt;In order to fix this simply run 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;sudo adduser $USER vboxsf
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Then reboot your VM and you should be good to go.&lt;/p&gt;

</description>
      <category>ubuntu</category>
      <category>beginners</category>
      <category>tutorial</category>
      <category>virtualmachine</category>
    </item>
  </channel>
</rss>
