Search code examples
rubyrbenv

rbenv/ruby-build and shared libraries (libruby.so)


I am trying to to use rbenv with ruby-build.

After seemingly successful installation of both tools and ruby version I cannot find the shared library libruby.so

Are there are any specific instructions that I have to give to rbenv/ruby-build when I am installing ruby?

Have tried with ruby 2.1.0 and 2.1.2.

Any help would be appreciated!


Solution

  • When compiling Ruby from source, you need to set --enable-shared to build shared libraries. With Rbenv, you can try to set this in RUBY_CONFIGURE_OPTS before installing Ruby:

    export RUBY_CONFIGURE_OPTS="--enable-shared"
    rbenv install 2.1.2
    

    Or alternatively:

    RUBY_CONFIGURE_OPTS="--enable-shared" rbenv install 2.1.2