title: Installing Ruby on Rails latest version matching Ruby 3.0
body: <p>When I try the following, after installing Ruby 3.0 from snap on Ubuntu 18.04::</p>
  <pre><code>gem install rails
  </code></pre>
  <p>I get this error:</p>
  <pre><code>/snap/ruby/201/lib/ruby/3.0.0/x86_64-linux/rbconfig.rb:13:in `&lt;module:RbConfig&gt;': ruby lib version (3.0.0) doesn't match executable version (2.5.1) (RuntimeError)
  </code></pre>
  <p>It was right after using</p>
  <pre><code>rails new rest-api-messages --api --database=postgresql
  </code></pre>
  <p>and trying to install PostGRES</p>
  <pre><code>gem install pg -v '1.2.3' --source 'https://rubygems.org/'
  </code></pre>
  <p>How could I solve this? is Ruby on Rails only for version 2.5.1 and lower?</p>
  <hr />
  <p>edit: Then I got</p>
  <pre><code>Can't find the 'libpq-fe.h header when trying to install pg gem
  </code></pre>
  <p>Solved with</p>
  <pre><code>sudo apt-get install libpq-dev
  </code></pre>
  <p>Duplicate from <a href="https://stackoverflow.com/questions/6040583/cant-find-the-libpq-fe-h-header-when-trying-to-install-pg-gem">Can&#39;t find the &#39;libpq-fe.h header when trying to install pg gem</a></p>