Skip to content
This repository was archived by the owner on Jan 11, 2022. It is now read-only.
This repository was archived by the owner on Jan 11, 2022. It is now read-only.

problem with python2.7 #18

@halostatue

Description

@halostatue

Hi,
I have both python2.6 and python2.7 installed on my system and when trying to use a gem depends on 'rubypython' i got this error "/home/aboelnour/.rvm/gems/ruby-1.9.3-p0/gems/ffi-1.0.11/lib/ffi/library.rb:121:in `block in ffi_lib': Could not open library '/usr/local/lib/libpython2.7.a': /usr/local/lib/libpython2.7.a: invalid ELF header (LoadError)"

i dig in the rubypython gem code and find this lines in '/lib/rubypython/python.rb':

EXEC = RubyPython::PythonExec.new(RubyPython.options[:python_exe])
PYTHON_LIB = EXEC.library
FFI::DynamicLibrary::RTLD_LAZY | FFI::DynamicLibrary::RTLD_GLOBAL
ffi_lib_flags :lazy, :global
ffi_lib EXEC.library

and found that EXEC.library points to -> "/usr/local/lib/libpython2.7.a" which is a static library, and as i know 'ffi' gem don't load static libraries but it loads shared objects (dynamic libraries) so i set manually PYTHON_LIB to the dynamic lib path and the issue is solved.
thanks.

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