Trying to get RubyPython 0.3.0 working on Linux

11 views
Skip to first unread message

Austin Ziegler

unread,
Jan 19, 2011, 1:20:24 PM1/19/11
to rubyp...@googlegroups.com
Working with a slightly modified version as detailed in my fork here:


This mostly fixes an assumption about where the Python DLL will be and
introduces some fallback behaviour. As I start understanding what's
going on with the library, I'll probably look at introducing a different
change that delays the FFI import until the last possible moment
allowing a user to select which version of Python they want to use
(e.g., RubyPython.use_python_version('2.7') or something like that).

That's a separate problem than what I'm raising right now. I don't mind
debugging this, but I need some advice on how to debug it as I'm neither
a Python expert nor really familiar with FFI. The problem exists on both
a 64-bit Ubuntu 10.10 system that I've got (Python 2.6) and a 32-bit
CentOS 4.8 system where I've built Python 2.7 (the system Python version
is 2.3).

I'm using ruby-1.8.7-p302 through rvm in both cases.

In my rubypython work directory:

  % irb -I$(pwd)/lib
  ruby-1.8.7-p302 > require 'rubypython'
  => true 
  ruby-1.8.7-head > RubyPython::Python::PYTHON_VERSION
  => 2.6 
  ruby-1.8.7-head > RubyPython::Python::PYTHON_NAME
  => "python2.6" 
  ruby-1.8.7-head > RubyPython::Python::LIB_NAME
  => "libpython2.6" 
  ruby-1.8.7-head > RubyPython::Python::LIB_EXT
  => "so" 
  ruby-1.8.7-head > RubyPython::Python::LIB
  => "/usr/lib/libpython2.6.so
  ruby-1.8.7-head > RubyPython::Python::PYTHON_SYS_PREFIX
  => "/usr" 
  ruby-1.8.7-head > RubyPython::Python.instance_variable_get("@ffi_libs")
  => [#<FFI::DynamicLibrary:0x7f81fb6251b8>] 
  ruby-1.8.7-p302 > sys = RubyPython.import('sys')
  /home/austin/rubypython/lib/rubypython.rb:101: [BUG] Segmentation fault
  ruby 1.8.7 (2010-08-16 patchlevel 302) [i686-linux]
  zsh: abort      irb -I$(pwd)/lib

Help?

-a

Austin Ziegler

unread,
Jan 20, 2011, 12:41:11 AM1/20/11
to rubyp...@googlegroups.com
Nevermind.

I'm an idiot and forgot to .start the interpreter first.

-a

Zach Raines

unread,
Jan 20, 2011, 12:20:09 PM1/20/11
to RubyPython
I have done something like that quite a number of times while testing.

By the way, as you may have noticed, I have pulled your changes. Feel
free to contact me with any bugs, feature requests, or code of your
own. I may not always be actively developing RubyPython but I'm always
willing to respond to feedback.
Reply all
Reply to author
Forward
0 new messages