title: Ubuntu 18.04.03 LTS - bundle install throws error because of rMagick
body: <p>I am setting-up my VM Ubuntu 18.04.03 on MacOS. 
  GIVEN:
        <code>
         Ubuntu 18.04.03 LTS 
         ImageMagick 6.9.7-4 Q16 x86_64 20170114 http://www.imagemagick.org 
         ruby 2.1.2p95 (2014-05-08 revision 45877) [x86_64-linux] 
         Expected Rails version set in Gemfile is '4.2.7.1'
         The system suggests to run gem install rmagick -v '2.13.2'
  </code></p>
  
  <p>When I run bundle install in the terminal I am getting the following error:</p>
  
  <pre><code>Installing rmagick 2.13.2 with native extensions
  Gem::Ext::BuildError: ERROR: Failed to build gem native extension.
  
  current directory:
  /home/i.k/.rvm/gems/ruby-2.1.2/gems/rmagick-2.13.2/ext/RMagick
  /usr/share/rvm/rubies/ruby-2.1.2/bin/ruby -I
  /usr/share/rvm/rubies/ruby-2.1.2/lib/ruby/site_ruby/2.1.0 -r
  ./siteconf20200113-25302-1t913rc.rb extconf.rb
  checking for Ruby version &gt;= 1.8.5... yes
  checking for gcc... yes
  checking for Magick-config... no
  Can't install RMagick 2.13.2. Can't find Magick-config in
  /usr/lib/x86_64-linux-gnu/ImageMagick-6.8.9/bin-Q16:/usr/lib/x86_64-linux-gnu/ImageMagick-6.8.9/bin-Q16:/home/i.k/.rvm/gems/ruby-2.1.2/bin:/home/i.k/.rvm/gems/ruby-2.1.2@global/bin:/usr/share/rvm/rubies/ruby-2.1.2/bin:/sbin:/bin:/usr/bin:/usr/local/bin:/snap/bin:/usr/share/rvm/bin
  
  *** extconf.rb failed ***
  Could not create Makefile due to some reason, probably lack of necessary
  libraries and/or headers.  Check the mkmf.log file for more details.  You may
  need configuration options.
  
  Provided configuration options:
      --with-opt-dir
      --without-opt-dir
      --with-opt-include
      --without-opt-include=${opt-dir}/include
      --with-opt-lib
      --without-opt-lib=${opt-dir}/lib
      --with-make-prog
      --without-make-prog
      --srcdir=.
      --curdir
      --ruby=/usr/share/rvm/rubies/ruby-2.1.2/bin/ruby
  
  To see why this extension failed to compile, please check the mkmf.log which can
  be found here:
  
  /home/i.k/.rvm/gems/ruby-2.1.2/extensions/x86_64-linux/2.1.0/rmagick-2.13.2/mkmf.log
  
  extconf failed, exit code 1
  
  Gem files will remain installed in
  /home/i.k/.rvm/gems/ruby-2.1.2/gems/rmagick-2.13.2 for inspection.
  Results logged to
  /home/i.k/.rvm/gems/ruby-2.1.2/extensions/x86_64-linux/2.1.0/rmagick-2.13.2/gem_make.out
  
  An error occurred while installing rmagick (2.13.2), and Bundler cannot
  continue.
  Make sure that `gem install rmagick -v '2.13.2' --source 'https://rubygems.org/'` succeeds before bundling.
  
  In Gemfile:
    rmagick
  </code></pre>
  
  <p>When I run the <code>gem install rmagick -v'2.13.2' --source 'https://rubygems.org/'</code> I am getting the following error </p>
  
  <pre><code>Building native extensions. This could take a while...
  ERROR:  Error installing rmagick:
      ERROR: Failed to build gem native extension.
  
      current directory: /home/i.k/.rvm/gems/ruby-2.1.2/gems/rmagick-2.13.2/ext/RMagick
  /usr/share/rvm/rubies/ruby-2.1.2/bin/ruby -I /usr/share/rvm/rubies/ruby-2.1.2/lib/ruby/site_ruby/2.1.0 -r ./siteconf20200114-15956-1hlaeuw.rb extconf.rb
  checking for Ruby version &gt;= 1.8.5... yes
  checking for gcc... yes
  checking for Magick-config... no
  Can't install RMagick 2.13.2. Can't find Magick-config in /usr/lib/x86_64-linux-gnu/ImageMagick-6.8.9/bin-Q16:/usr/lib/x86_64-linux-gnu/ImageMagick-6.8.9/bin-Q16:/home/i.k/.rvm/gems/ruby-2.1.2/bin:/home/i.k/.rvm/gems/ruby-2.1.2@global/bin:/usr/share/rvm/rubies/ruby-2.1.2/bin:/sbin:/bin:/usr/bin:/usr/local/bin:/snap/bin:/usr/share/rvm/bin
  
  *** extconf.rb failed ***
  Could not create Makefile due to some reason, probably lack of necessary
  libraries and/or headers.  Check the mkmf.log file for more details.  You may
  need configuration options.
  
  Provided configuration options:
      --with-opt-dir
      --without-opt-dir
      --with-opt-include
      --without-opt-include=${opt-dir}/include
      --with-opt-lib
      --without-opt-lib=${opt-dir}/lib
      --with-make-prog
      --without-make-prog
      --srcdir=.
      --curdir
      --ruby=/usr/share/rvm/rubies/ruby-2.1.2/bin/ruby
  
  To see why this extension failed to compile, please check the mkmf.log which can be found here:
  
    /home/i.k/.rvm/gems/ruby-2.1.2/extensions/x86_64-linux/2.1.0/rmagick-2.13.2/mkmf.log
  
  extconf failed, exit code 1
  
  Gem files will remain installed in /home/i.k/.rvm/gems/ruby-2.1.2/gems/rmagick-2.13.2 for inspection.
  Results logged to /home/i.k/.rvm/gems/ruby-2.1.2/extensions/x86_64-linux/2.1.0/rmagick-2.13.2/gem_make.out
  </code></pre>
  
  <p>I already tried the following :</p>
  
  <p><code>sudo apt install imagemagick libmagickcore-dev libmagickwand-dev</code>
   0 gems installed - no result</p>
  
  <p><code>sudo apt install libmagickcore-dev</code>
  0 gems installed -no result</p>
  
  <p><code>PATH="/usr/lib/x86_64-linux-gnu/ImageMagick-6.8.9/bin-Q16:$PATH"</code>
  nothing happened when I ran gem rmagick install - the error stayed the same</p>
  
  <p>UPD.
  mkmf.log says:</p>
  
  <pre><code>find_executable: checking for Magick-config... -------------------- no
  
  --------------------
  
  Can't install RMagick 2.13.2. Can't find Magick-config in /home/i.k/.rvm/gems/ruby-2.1.2/bin:/home/i.k/.rvm/gems/ruby-2.1.2@global/bin:/usr/share/rvm/rubies/ruby-2.1.2/bin:/sbin:/bin:/usr/bin:/usr/local/bin:/snap/bin:/usr/share/rvm/bin
  </code></pre>
  
  <p>Any help would be appreciated</p>