title: for compiled libraries, like libyaml, where does Ruby (or the RVM) search within the filesystem in order to load or resolve them?
body: <p>Operating System: CentOS 6.2 x86_64<br>
  I apologize for indentation being wonky. This is my first SO post and I am new to setting up servers. I am learning though and will detail the steps I have gone through trying to solve this as well as where I looked for help. I'm an aspiring young web developer and I work on a server that someone else had configured, so this whole experience is new to me.</p>
  
  <p>I've be preparing a linode I recently purchased to run a rails app. I followed the initial installation guide provided here   <a href="http://blog.blenderbox.com/2011/01/07/installing-rvm-ruby-rails-passenger-nginx-on-centos/" rel="nofollow noreferrer">http://blog.blenderbox.com/2011/01/07/installing-rvm-ruby-rails-passenger-nginx-on-centos/</a>, as well as changing the step: <br>
  <code>sudo bash &lt; &lt;( curl -L http://bit.ly/rvm-install-system-wide )</code><br>
  To reflect the changes advised in this SO thread <a href="https://stackoverflow.com/questions/5421800/rvm-system-wide-install-script-url-broken-what-is-replacement/5422811#5422811">RVM system-wide install script url broken -- what is replacement?</a> <br></p>
  
  <pre><code>bash -c "bash &lt;( curl -L https://github.com/wayneeseguin/rvm/raw/1.3.0/contrib/install-system-wide ) --version '1.3.0'"
  </code></pre>
  
  <p>I stopped at the ngix installation because I am using Apache2. I also made sure to run <code>rvm requirements</code> and install the necessary packages prior to the installation of rails. This is where libyaml was tasked for install and the first error occurred with me trying to install it. However, yum reported that it did not exist. The initial install of RVM and Gems appeared to work, however I encountered an issue with Gems missing 'Psych' and then asked to install libyaml: 
  <br><br>
      <code>/usr/local/rvm/rubies/ruby-1.9.3-p194/lib/ruby/1.9.1/yaml.rb:56:in '&lt;top (required)&gt;':
      It seems your ruby installation is missing psych (for YAML output).
      To eliminate this warning, please install libyaml and reinstall your ruby.</code><br><br>
  So I first tried installing libyaml through Yum but received this error:</p>
  
  <pre><code>yum install libyaml
  Loaded plugins: fastestmirror, security
  Loading mirror speeds from cached hostfile
  * base: centosmirror.quintex.com
  * extras: centosmirror.quintex.com
  * updates: centosmirror.quintex.com
  Setting up Install Process
  No package libyaml available.
  Error: Nothing to do
  </code></pre>
  
  <p><br>
  Trying to install libyaml-devel and libyaml-dev had this same problem.<br><br>
  After doing some research I found this blog post by CollectiveIdea that detailed the same problem and offered a solution. <a href="http://collectiveidea.com/blog/archives/2011/10/31/install-ruby-193-with-libyaml-on-centos/" rel="nofollow noreferrer">Blog Post by Collective Idea</a> I followed the instructions and performed the install without any make or configure problems. I then performed the ruby reinstall provided. I was still presented with the same warning and searched further into SO for similar issues. As detailed by responses to this question regarding the same problem, <a href="https://stackoverflow.com/questions/9434002/how-to-solve-ruby-installation-is-missing-psych-error">how to solve &quot;ruby installation is missing psych&quot; error?</a> Using:</p>
  
  <pre><code>rvm pkg install libyaml
  Fetching yaml-0.1.4.tar.gz to /usr/local/rvm/archives
  Extracting yaml-0.1.4.tar.gz to /usr/local/rvm/src
  Prepare yaml in /usr/local/rvm/src/yaml-0.1.4.
  Configuring yaml in /usr/local/rvm/src/yaml-0.1.4.
  Compiling yaml in /usr/local/rvm/src/yaml-0.1.4.
  Installing yaml to /usr/local/rvm/usr
  </code></pre>
  
  <p><code>Please note that it's required to reinstall all rubies:</code><br><br></p>
  
  <p>It was advised to reinstall everything through RVM and I followed these instructions as well. </p>
  
  <pre><code>rvm reinstall all --force
  Removing /usr/local/rvm/src/ruby-1.9.3-p194...
  Removing /usr/local/rvm/rubies/ruby-1.9.3-p194...
  mv: overwrite `/usr/local/rvm/user/installs'? y
  No binary rubies available for: ///ruby-1.9.3-p194.
  Continuing with compilation. Please read 'rvm mount' to get more information on binary   rubies.
  Installing Ruby from source to: /usr/local/rvm/rubies/ruby-1.9.3-p194, this may take a while depending on your cpu(s)...
  ruby-1.9.3-p194 - #downloading ruby-1.9.3-p194, this may take a while depending on your connection...
  
  ruby-1.9.3-p194 - #extracting ruby-1.9.3-p194 to /usr/local/rvm/src/ruby-1.9.3-p194
  ruby-1.9.3-p194 - #extracted to /usr/local/rvm/src/ruby-1.9.3-p194
  ruby-1.9.3-p194 - #configuring
  ruby-1.9.3-p194 - #compiling
  ruby-1.9.3-p194 - #installing
  </code></pre>
  
  <p>Even after this the warning is still present. I have verified the ruby installation with <code>ruby -v</code> and it is in fact installed. The libyaml files were installed, they reside here:</p>
  
  <pre><code>[root@li543-100 ~]# ls -la /usr/local/lib
  total 19620
  drwxr-xr-x  5 root root     4096 Oct  1 15:40 .
  drwxr-xr-x 13 root root     4096 Oct  1 05:55 ..
  drwxr-xr-x  2 root root     4096 Oct  1 06:34 include
  lrwxrwxrwx  1 root root       16 Oct  1 15:40 libruby.so -&gt; libruby.so.1.9.1
  lrwxrwxrwx  1 root root       16 Oct  1 15:40 libruby.so.1.9 -&gt; libruby.so.1.9.1
  -rwxr-xr-x  1 root root  7457107 Oct  1 06:42 libruby.so.1.9.1
  -rw-r--r--  1 root root 11633486 Oct  1 15:39 libruby-static.a
  lrwxrwxrwx  1 root root       18 Oct  1 06:37 libyaml-0.so.2 -&gt; libyaml-0.so.2.0.2
  -rwxr-xr-x  1 root root   358698 Oct  1 06:37 libyaml-0.so.2.0.2
  -rw-r--r--  1 root root   565584 Oct  1 06:37 libyaml.a
  -rwxr-xr-x  1 root root      953 Oct  1 06:37 libyaml.la
  lrwxrwxrwx  1 root root       18 Oct  1 06:37 libyaml.so -&gt; libyaml-0.so.2.0.2
  drwxr-xr-x  2 root root     4096 Oct  1 06:45 pkgconfig
  drwxr-xr-x  6 root root     4096 Oct  1 06:45 ruby
  -rw-rw-r--  1 root rvm       194 Oct  1 05:55 rvm
  </code></pre>
  
  <p>You can also see that I tried to create a symbolic link between /usr/local/lib and /usr/local/rvm/lib, under the assumption that the yaml files may have been installed into the wrong directory or that rvm was not looking in the proper directory for them. I ran a which on ruby and thought because ruby was in the /rvm dir that could be the issue: </p>
  
  <pre><code>[root@li543-100 ~]# which ruby
  /usr/local/rvm/rubies/ruby-1.9.3-p194/bin/ruby
  [1]: http://collectiveidea.com/blog/archives/2011/10/31/install-ruby-193-with-libyaml-on-centos/ 
  </code></pre>
  
  <p>This did not help. So I am on the fence with where I went wrong or what I am not looking for.<br>
  1: Did I make an installation mistake by placing the files in the wrong dir?<br>
  2: Is ruby looking for the libyaml files in a different directory?<br>
  3: When I followed the blog posts did I fail to add some system specific feature to the installs?<br></p>
  
  <p>I have redeployed CentOS on my linode 4 times, hoping that this was an issue with me not following the scripts appropriately, I am on the 5th deploy with the same issue popping up.
  I am currently searching SO for number 2 and hopefully my post isn't inappropriate as this is clearly solved somewhere else. I would appreciate any help you could provide.  </p>
  
  <p>EDIT:</p>
  
  <p>So after redeploying the CentOS6.2 OS I ran altered setup like so:</p>
  
  <pre><code>yum -y install git
  yum -y install curl
  groupadd rvm
  usermod -a -G rvm root
  bash -c "bash &lt;( curl -L https://github.com/wayneeseguin/rvm/raw/1.3.0/contrib/install-system-wide) -- version'1.3.0'"
  echo '[[ -s "/usr/local/lib/rvm" ]] &amp;&amp; . "/usr/local/lib/rvm" #This loads RVM into a shell session' &gt;&gt; ~/.bash_profile
  source ~/.bash_profile
  yum install -y gcc-c++ patch readline readline-devel zlib zlib-devel libyaml-devel libffi-devel openssl-devel make bzip2 autoconf automake libtool bison iconv-devel
  rvm get head
  yum install readline readline-devel
  rvm package install libyaml -v
  rvm install 1.9.3 -v
  rvm use 1.9.3
  ruby -v 
  </code></pre>
  
  <p>This too still encountered the error:</p>
  
  <pre><code>/usr/local/rvm/rubies/ruby-1.9.3-p194/lib/ruby/1.9.1/yaml.rb:56:in `&lt;top (required)&gt;':
  It seems your ruby installation is missing psych (for YAML output).
  To eliminate this warning, please install libyaml and reinstall your ruby.
  </code></pre>
  
  <p>Running the previous commands to get libyaml from RVM and to then reinstall all rubies does not seem to fix the issue for me. When performing the rvm reinstall all --force, will the installation of the previous libyaml package be removed, overwritten or replaced? It appears to be in the correct directories.</p>
  
  <pre><code>[root@li543-100 src]# pwd
  /usr/local/rvm/src
  drwxrwsr-x  7 root rvm   4096 Oct  1 21:19 .
  drwxrwsr-x 24 root rvm   4096 Oct  1 20:51 ..
  drwxr-xr-x 24 root rvm   8192 Oct  1 21:22 ruby-1.9.3-p194
  drwxr-xr-x  7  501 games 4096 Apr 27 23:31 rubygems-1.8.24
  drwxrwsr-x 18 root rvm   4096 Oct  1 20:51 rvm
  drwxrwsrwx  8 root rvm   4096 Oct  1 20:27 yaml-0.1.3
  drwxr-xr-x  9 root rvm   4096 Oct  1 21:18 yaml-0.1.4
  </code></pre>
  
  <p>EDIT #2:<br>
  After failing another install on a new CentOS 5.6 redeploy I was clearly making a fatal flaw somewhere in the installation process. Prior to performing <code>rvm install 1.9.3</code>, I had to run <code>rvm install 1.8.7</code>. Also, I deployed a 32bit CentOS6.2 image this time instead<br><br></p>
  
  <p>Running gem on 1.8.7</p>
  
  <pre><code>[root@li543-100 ~]# gem -v
  1.8.24
  </code></pre>
  
  <p>Now I run <code>rvm install 1.9.2</code></p>
  
  <pre><code>[root@li543-100 ~]# rvm use 1.9.2
  ruby-1.9.2-p320 is not installed.
  To install do: 'rvm install ruby-1.9.2-p320'
  [root@li543-100 ~]# rvm install ruby-1.9.2-p320
  #CUT OUT INSTALL SHELL PROMPTS ETC
  [root@li543-100 ~]# rvm use 1.9.2-p320
  Using /usr/local/rvm/gems/ruby-1.9.2-p320
  [root@li543-100 ~]# gem -v
  1.8.24
  </code></pre>
  
  <p>Switching to 1.9.3: Error returns<br></p>
  
  <pre><code>[root@li543-100 ~]# rvm use 1.9.3-p194
  Using /usr/local/rvm/gems/ruby-1.9.3-p194
  [root@li543-100 ~]# gem -v
  /usr/local/rvm/rubies/ruby-1.9.3-p194/lib/ruby/1.9.1/yaml.rb:56:in `&lt;top (required)&gt;':
  It seems your ruby installation is missing psych (for YAML output).
  To eliminate this warning, please install libyaml and reinstall your ruby.
  1.8.24
  </code></pre>
  
  <p>So it looks like telling rvm to use 1.9.3 (mind you I am using -p194, i have not tested the ones prior) causes some sort of communication problem in terms of where <code>rvm</code> attempts to load libyaml. For now I will be using 1.9.2 as most of this stuff has been a little over my head. I'm sure I have made a mistake in lacking some sort of dependency that 1.9.3 requires or not adjusting a config file appropriately. At least this is my assumption, first server setup so much of this has been guessing. </p>