title: Ruby 'cannot load such file --RMagick'
body: <p>I have a default installation of a jekyll project (created with <code>jekyll new sample</code>) and have included a plugin, <a href="https://github.com/mattvh/JekyllGalleryTag" rel="nofollow">JekyllGalleryTag</a>. </p>
  
  <p>The plugin depends upon ImageMagick and RMagick. I have installed ImageMagick and RMagick successfully on Xubuntu 14.04 using these commands. </p>
  
  <pre><code>sudo apt-get update
  sudo apt-get install imagemagick --fix-missing
  sudo apt-get install libmagickcore-dev
  sudo apt-get install libmagickwand-dev
  </code></pre>
  
  <p>ImageMagick commands are functional, eg <code>convert logo.gif logo.jpg</code> works as expected.</p>
  
  <p>I am running ruby-2.3.0 via rvm 1.27.0</p>
  
  <pre><code>gem install rmagick
  </code></pre>
  
  <p>RMagick installs without any error messages.</p>
  
  <p>JekyllGalleryTag needs galleries.rb put in /_plugins, which I have done. The first line of galleries.rb reads ...</p>
  
  <pre><code>require 'RMagick'
  </code></pre>
  
  <p>The plugin requires some code in _config.yml, which looks like this...</p>
  
  <pre><code>gallerytag:
      dir: images/galleries
      url: /images/galleries
      thumb_width: 150
      thumb_height: 150
      columns: 4
  </code></pre>
  
  <p>My gallery images are located in /images/galleries/dig/</p>
  
  <p>I created an html file with some Liquid code to display the result. Here's the code in dig.html</p>
  
  <pre><code>---
  layout: default
  title: Dig In Italy
  ---
  {% gallery dig %}
  dig/current001.jpg:: A caption goes here!
  {% endgallery %}
  </code></pre>
  
  <p>When I preview the site, with <code>jekyll serve</code>, I get this error message...</p>
  
  <pre><code>Configuration file: /mnt/hgfs/proj/practice/jekyll/sample/_config.yml
  Dependency Error: Yikes! It looks like you don't have /mnt/hgfs/proj/practice/jekyll/sample/_plugins/galleries.rb or one of its dependencies installed. 
  In order to use Jekyll as currently configured, you'll need to install this gem. 
  The full error message from Ruby is: 'cannot load such file -- RMagick' 
  If you run into trouble, you can find helpful resources at http://jekyllrb.com/help/! 
  jekyll 3.1.6 | Error:  /mnt/hgfs/proj/practice/jekyll/sample/_plugins/galleries.rb
  </code></pre>
  
  <p>I am new to ruby, jekyll, and linux generally.  I have googled and read and experimented for hours searching for a fix. The summarized sequence above is a result of all that research. I have installed every suggested library. </p>
  
  <p>Other fixes I tried and discarded were:</p>
  
  <ul>
  <li>including <code>require 'rubygems'</code> as the first line in galleries.rb (in addition to <code>require 'RMagick'</code>)</li>
  <li><code>require 'rmagick'</code> instead of <code>require 'RMagick'</code></li>
  <li>all 4 combinations of these require statements</li>
  </ul>
  
  <p>Additional wrinkles that may be relevant or not;</p>
  
  <ul>
  <li>Xubuntu 14.04 is running in VMware Player 7.1.2 </li>
  <li>The host OS is Windows 7 Pro 64 bit. </li>
  <li>My jekyll files are on the host NTFS filesystem, and I've been editing them with Notepad++ (a windows editor). The files are shared with the guest OS via VMware Player's Shared Folders option. This arrangement works fine for static sites and WordPress sites.</li>
  <li>I am using the terminal in the guest OS, Xubuntu, for all command line work. The Xubuntu OS contains the AMP stack, along with rvm and ruby.</li>
  <li>Though bundler is installed, I did not use it to install RMagick.</li>
  </ul>
  
  <p>How do I fix this?</p>
  
  <p><strong>UPDATE:</strong> </p>
  
  <p>I have verified that RMagick is working properly.  I made a couple of small .rb scripts from the code on the RMagick Usage page. Two identical script sets were stored, one in the linux filesystem, and one in the NTFS filesystem. Both execute as expected without errors. This demonstrates that ruby works and can find and use RMagick, and that RMagick can find and use ImageMagick. And that the location of the files doesn't make a difference.</p>
  
  <p>Yet file location does matter. I copied identical sample jekyll projects so there was one on the linux filesystem one on NTFS. 
  On linux <code>jekyll serve</code> executes but the plugin is not generating the thumbnail file version that jekyll is expecting. The build completes but with errors due to the missing thumbnail file.  So the build wont complete when the files reside on NTFS, but will when the files are on linux.</p>
  
  <p>At this point my theories are 1) weirdness caused by VMware Player file sharing (but one that does not affect ruby &amp; gems consistently) or 2) something in the plugin code, which I don't have the skill to assess.</p>
  
  <p>Any comments, ideas? </p>