Skip to content

fatal error: ruby/io.h: No such file or directory #8

Description

@flaccid

From execution of make in https://github.com/Lytro/chef_ruby/blob/master/recipes/default.rb#L17

...
04:33:11: make[2]: Entering directory/var/cache/rightscale/chef/ruby-1.9.3-p194/ext/openssl'
04:33:11: gcc -I. -I. -I/usr/lib/ruby/1.8/x86_64-linux -I. -DRUBY_EXTCONF_H="extconf.h" -D_FORTIFY_SOURCE=2 -D_FORTIFY_SOURCE=2 -fPIC -fno-strict-aliasing -g -g -O2 -fPIC -c ossl_ssl_session.c
04:33:11: In file included from ossl_ssl_session.c:5:0:
ossl.h:32:21: fatal error: ruby/io.h: No such file or directory
04:33:11: compilation terminated.
04:33:11: make[2]: *** [ossl_ssl_session.o] Error 1
04:33:11: make[2]: Leaving directory /var/cache/rightscale/chef/ruby-1.9.3-p194/ext/openssl' 04:33:11: make[1]: *** [ext/openssl/all] Error 2 make: *** [build-ext] Error 2 04:33:11: make[1]: Leaving directory/var/cache/rightscale/chef/ruby-1.9.3-p194'
04:33:11: Script duration: 53.677533
*ERROR> 04:33:11: bash[unpack ruby-1.9.3-p194.tar.bz2 and build](chef_ruby::default line 17) has had an error

*ERROR> 04:33:11: bash[unpack ruby-1.9.3-p194.tar.bz2 and build](/var/cache/rightscale/cookbooks/default/b3974743a4af3caaea749ca758add829/cookbooks/chef_ruby/recipes/default.rb:17:in from_file') had an error: bash[unpack ruby-1.9.3-p194.tar.bz2 and build](chef_ruby::default line 17) had an error: RightScale::Exceptions::Exec: ""bash" "/tmp/chef-script20130916-1423-fjqvv1-0"" exited with 2, expected 0.

This comes up on Google quite a bit, but I am not sure what the right solution actually is. But, I am pretty sure it would be this as I tested it:

sudo apt-get install libssl-dev cd ~/.rvm/src/ruby-1.8.7/ext/openssl ruby extconf.rb make && make install

From http://cjohansen.no/en/ruby/ruby_version_manager_ubuntu_and_openssl

I'll submit a pull request.

Activity

  1. flaccid commented on Sep 17, 2013

    @flaccid
    ContributorAuthor

    Ok so this appears to be an environmental issue. My host had a ruby already installed, ruby-1.8, so ruby has issues using the correct CFLAGS when running make and I couldn't find a graceful solution, but I'm sure it must be able to be done using -I with make or gcc directly for the build (ruby/include). It raises the broader question on how we deal with this recipe/cookbook working with hosts that already have a ruby installed such as by system package.
    It could also be the reason why I needed to do #6.

    I am wondering if the official ruby and other cookbooks such as rvm suffer from this issue. Another thought is why do we need to install ruby from source? This is very slow on a underpowered machine such as a t1.micro or m1.small on EC2. Possible we could depend on one of those cookbooks instead for https://github.com/Lytro/aws_developer_tools ?

  2. anujbiyani commented on Sep 17, 2013

    @anujbiyani
    Contributor

    It raises the broader question on how we deal with this recipe/cookbook working with hosts that already have a ruby installed such as by system package.

    Hmm alright I might revert #6 then until we get a more complete solution to the problem, or decide that the problem isn't worth solving. Are there a lot of AMIs that come with a Ruby installed? I was under the impression that the best AMIs for starting a Chef setup with would be as barebones as possible; let Chef do all the heavy lifting.

    Another thought is why do we need to install ruby from source?

    There are 3 options: rvm/rbenv, source, or via package manager. This cookbook is intended for use on systems that don't need rvm/rbenv, and it's harder to install a specific version and patch number using package numbers.

    I wrote this because I really just wanted a specific version of Ruby installed and didn't want to go through the fuss of dealing with aptitude or rvm/rbenv. Installing from source is super slow on weaker instances, though, so alternative installation methods could be added to this cookbook.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions