1

I'm trying to install Ruby on Rails on Solaris 10 box. I managed to build Ruby 1.9.3 from source and I installed gems but when I run gem command every time I get this message:

# gem list
/usr/local/lib/ruby/1.9.1/yaml.rb:56:in `<top (required)>':
It seems your ruby installation is missing psych (for YAML output).
To eliminate this warning, please install libyaml and reinstall your ruby.

This is really anoying :)

So I tried to rebuild Ruby and here is what I noticed in the output of make.

configuring psych
libyaml is missing. Please install libyaml.
Failed to configure psych. It will not be installed.

I found the extconf.rb script that checks for that and I tried to run it manually:

# pwd
/root/pub/ruby-1.9.3-p194/ext/psych
#
# irb --simple-prompt
>> require 'mkmf'
=> true
>> find_header 'yaml.h'
checking for yaml.h... yes
=> true
>> find_library 'yaml', 'yaml_get_version'
checking for yaml_get_version() in -lyaml... yes
=> true
>> exit

Apparently extconf.rb could find libyaml but make could not. So I'm puzzled why make does not find it. Any thoughts?

Andrew Marshall
  • 95,083
  • 20
  • 220
  • 214
pn8830
  • 388
  • 3
  • 13

3 Answers3

0

There are a couple of walk-throughs online regarding the install of Rails on Solaris.

This is for Rails 3: https://www.machine-unix.com/2011/05/installing-rails3-on-solaris-10-910/

And this one talks about avoiding issues with incompatible libraries: http://www.nowastedmoves.com/2009/geekery/installing-ruby-on-rails-on-solaris-10-1008-2/

I've never tried this on Solaris, but hopefully this will be of help.

PhillipKregg
  • 9,358
  • 8
  • 49
  • 63
0

I had this problem with Mac OS, perhaps it helps: http://icodeapps.net/?p=8

Florian Salihovic
  • 3,921
  • 2
  • 19
  • 26
0

You need to install libyaml.

If you're install libyaml from a pre-built package, you will likely need a separate package with development headers, usually "libyaml-dev" or similar.

Alternatively you can install libyaml from source:

Download the source package: http://pyyaml.org/download/libyaml/yaml-0.1.4.tar.gz. To build and install LibYAML, run:

$ ./configure
$ make
# make install

(Note the last line begins with a #, indicated a root shell, prepend sudo when running as a normal user.)

Then reconfigure and recompile Ruby after installing libyaml.

Andrew Marshall
  • 95,083
  • 20
  • 220
  • 214
  • Funny thing is that I did that before posting :) and I was like .. cmon, I just built libyaml but ruby configure still does not see it.. LOL. I finally killed that warning and the fix seems to be (did not confirm yet): `export LD_LIBRARY_PATH="/usr/lib;/usr/local/lib"` – pn8830 Jun 18 '12 at 19:23
  • @Pavel If that works post it as an answer and you can accept it after 48 hours. – Andrew Marshall Jun 18 '12 at 20:46
  • @Pavel, if you're going to install lots of GNUish things under `/usr/local` (or elsewhere) check out `crle(1)` to set the global library path. – Martin Carpenter Jun 19 '12 at 08:58
  • On top of the answer given by Andrew, if you're considering installing Ruby from source, it's probably necessary to perform a `export CPPFLAGS=-L/my/yaml/include` and `export LDFLAGS=-L/my/yaml/lib` before the `make` of Ruby. – Gerard Yin Jul 25 '12 at 12:15