title: How can I solve "incompatible library version" problem with ruby 2.7.4 on ubuntu 20.04?
body: <p>Hello it's my first question here.
  I'm trying to build a redmine system on my server but facing some problems.</p>
  <p>my system -  ubuntu20.04 + nginx1.18 + mariadb10.3.30 + ruby2.7.4 + redmine4.2.2 / use rbenv to install ruby</p>
  <p>when I'm trying to connect the redmine server, I got this error</p>
  <pre><code>App 716658 output: Error: The application encountered the following error: libruby.so.2.7: cannot open shared object file: No such file or directory - /opt/redmine/vendor/cache/ruby/2.7.0/gems/mysql2-0.5.3/lib/mysql2/mysql2.so (LoadError)
  </code></pre>
  <p>so I did
  <code>cd /usr/lib</code></p>
  <p><code>ln -s /root/.rbenv/versions/2.7.4/lib/libruby.so.2.7 libruby.so.2.7</code></p>
  <p>then incompatible library version error occurred</p>
  <pre><code>App 722799 output: Error: The application encountered the following error: incompatible library version - /opt/redmine/vendor/cache/ruby/2.7.0/gems/mysql2-0.5.3/lib/mysql2/mysql2.so (LoadError)
  </code></pre>
  <p>I tried <code>gem pristine --all</code> but not worked.</p>
  <p>How can I solve this problem? so many errors occurred so I guess there is a problem on my setting.</p>
  <p><strong>gem env</strong></p>
  <pre><code> - RUBYGEMS VERSION: 3.2.25
   - RUBY VERSION: 2.7.4 (2021-07-07 patchlevel 191) [x86_64-linux]
   - INSTALLATION DIRECTORY: /root/.rbenv/versions/2.7.4/lib/ruby/gems/2.7.0
   - USER INSTALLATION DIRECTORY: /root/.gem/ruby/2.7.0
   - RUBY EXECUTABLE: /root/.rbenv/versions/2.7.4/bin/ruby
   - GIT EXECUTABLE: /usr/bin/git
   - EXECUTABLE DIRECTORY: /root/.rbenv/versions/2.7.4/bin
   - SPEC CACHE DIRECTORY: /root/.gem/specs
   - SYSTEM CONFIGURATION DIRECTORY: /root/.rbenv/versions/2.7.4/etc
   - RUBYGEMS PLATFORMS:
      - ruby
      - x86_64-linux
   - GEM PATHS:
      - /root/.rbenv/versions/2.7.4/lib/ruby/gems/2.7.0
      - /root/.gem/ruby/2.7.0
   - GEM CONFIGURATION:
      - :update_sources =&gt; true
      - :verbose =&gt; true
      - :backtrace =&gt; false
      - :bulk_threshold =&gt; 1000
   - REMOTE SOURCES:
      - https://rubygems.org/
   - SHELL PATH:
      - /root/.rbenv/versions/2.7.4/bin
      - /root/.rbenv/libexec
      - /root/.rbenv/plugins/ruby-build/bin
      - /root/.rbenv/shims
      - /root/.rbenv/bin
      - /usr/local/sbin
      - /usr/local/bin
      - /usr/sbin
      - /usr/bin
      - /sbin
      - /bin
      - /usr/games
      - /usr/local/games
      - /snap/bin
  </code></pre>
  <p><strong>bundle env</strong></p>
  <pre><code>Bundler       2.2.25
    Platforms   ruby, x86_64-linux
  Ruby          2.7.4p191 (2021-07-07 revision a21a3b7d23704a01d34bd79d09dc37897e00922a) [x86_64-linux]
    Full Path   /root/.rbenv/versions/2.7.4/bin/ruby
    Config Dir  /root/.rbenv/versions/2.7.4/etc
  RubyGems      3.2.25
    Gem Home    /root/.rbenv/versions/2.7.4/lib/ruby/gems/2.7.0
    Gem Path    /root/.gem/ruby/2.7.0:/root/.rbenv/versions/2.7.4/lib/ruby/gems/2.7.0
    User Home   /root
    User Path   /root/.gem/ruby/2.7.0
    Bin Dir     /root/.rbenv/versions/2.7.4/bin
  Tools         
    Git         2.25.1
    RVM         not installed
    rbenv       rbenv 1.1.2-61-g585ed84
    chruby      not installed
  </code></pre>
  <h2>Bundler Build Metadata</h2>
  <pre><code>Built At          2021-07-30
  Git SHA           7f0f257c7a
  Released Version  true
  </code></pre>