raineszm / rubypython Goto Github PK
View Code? Open in Web Editor NEWRubypython is no longer being maintained. Apologies for any inconvenience this might cause.
License: Other
Rubypython is no longer being maintained. Apologies for any inconvenience this might cause.
License: Other
Was using pygments.rb 0.2.13, rubypython 0.5.3 and FFI 1.0.11 with Python 2.7.3 on Fedora 17 and got this error.
/home/hal/.rvm/gems/ruby-1.9.3-p194/gems/rubypython-0.6.2/lib/rubypython/pyobject.rb:82: [BUG] Segmentation fault ruby 1.9.3p194 (2012-04-20 revision 35410) [x86_64-linux] -- Control frame information ----------------------------------------------- c:0037 p:---- s:0162 b:0162 l:000161 d:000161 CFUNC :PyObject_HasAttrString c:0036 p:0024 s:0157 b:0157 l:000156 d:000156 METHOD /home/hal/.rvm/gems/ruby-1.9.3-p194/gems/rubypython-0.6.2/lib/rubypython/pyobject.rb:82 c:0035 p:0181 s:0153 b:0153 l:000152 d:000152 METHOD /home/hal/.rvm/gems/ruby-1.9.3-p194/gems/rubypython-0.6.2/lib/rubypython/rubypyproxy.rb:165 c:0034 p:---- s:0139 b:0139 l:000138 d:000138 FINISH c:0033 p:0044 s:0137 b:0137 l:000136 d:000136 METHOD /home/hal/.rvm/gems/ruby-1.9.3-p194/gems/pygments.rb-0.2.13/lib/pygments/ffi.rb:120 c:0032 p:0182 s:0132 b:0132 l:000131 d:000131 METHOD /home/hal/.rvm/gems/ruby-1.9.3-p194/gems/pygments.rb-0.2.13/lib/pygments/ffi.rb:95 c:0031 p:0048 s:0121 b:0120 l:000119 d:000119 METHOD /home/hal/.rvm/gems/ruby-1.9.3-p194/gems/jekyll-0.11.2/lib/jekyll/tags/highlight.rb:54 c:0030 p:0043 s:0114 b:0114 l:000113 d:000113 METHOD /home/hal/.rvm/gems/ruby-1.9.3-p194/gems/jekyll-0.11.2/lib/jekyll/tags/highlight.rb:44 c:0029 p:0029 s:0110 b:0110 l:000100 d:000109 BLOCK /home/hal/.rvm/gems/ruby-1.9.3-p194/gems/liquid-2.3.0/lib/liquid/block.rb:94 c:0028 p:---- s:0106 b:0106 l:000105 d:000105 FINISH c:0027 p:---- s:0104 b:0104 l:000103 d:000103 CFUNC :collect c:0026 p:0012 s:0101 b:0101 l:000100 d:000100 METHOD /home/hal/.rvm/gems/ruby-1.9.3-p194/gems/liquid-2.3.0/lib/liquid/block.rb:92 c:0025 p:0016 s:0096 b:0096 l:000095 d:000095 METHOD /home/hal/.rvm/gems/ruby-1.9.3-p194/gems/liquid-2.3.0/lib/liquid/block.rb:82 c:0024 p:0417 s:0092 b:0092 l:000091 d:000091 METHOD /home/hal/.rvm/gems/ruby-1.9.3-p194/gems/liquid-2.3.0/lib/liquid/template.rb:124 c:0023 p:0124 s:0085 b:0083 l:000082 d:000082 METHOD /home/hal/.rvm/gems/ruby-1.9.3-p194/gems/jekyll-0.11.2/lib/jekyll/convertible.rb:79 c:0022 p:0053 s:0074 b:0074 l:000073 d:000073 METHOD /home/hal/.rvm/gems/ruby-1.9.3-p194/gems/jekyll-0.11.2/lib/jekyll/page.rb:100 c:0021 p:0021 s:0068 b:0068 l:000059 d:000067 BLOCK /home/hal/.rvm/gems/ruby-1.9.3-p194/gems/jekyll-0.11.2/lib/jekyll/site.rb:204 c:0020 p:---- s:0065 b:0065 l:000064 d:000064 FINISH c:0019 p:---- s:0063 b:0063 l:000062 d:000062 CFUNC :each c:0018 p:0044 s:0060 b:0060 l:000059 d:000059 METHOD /home/hal/.rvm/gems/ruby-1.9.3-p194/gems/jekyll-0.11.2/lib/jekyll/site.rb:203 c:0017 p:0041 s:0055 b:0055 l:000054 d:000054 METHOD /home/hal/.rvm/gems/ruby-1.9.3-p194/gems/jekyll-0.11.2/lib/jekyll/site.rb:41 c:0016 p:0065 s:0052 b:0052 l:000f40 d:000051 BLOCK /home/hal/.rvm/gems/ruby-1.9.3-p194/gems/jekyll-0.11.2/bin/jekyll:253 c:0015 p:---- s:0048 b:0048 l:000047 d:000047 FINISH c:0014 p:---- s:0046 b:0046 l:000045 d:000045 CFUNC :call c:0013 p:0019 s:0042 b:0042 l:000032 d:000041 BLOCK /home/hal/.rvm/gems/ruby-1.9.3-p194/gems/directory_watcher-1.4.1/lib/directory_watcher.rb:580 c:0012 p:---- s:0038 b:0038 l:000037 d:000037 FINISH c:0011 p:---- s:0036 b:0036 l:000035 d:000035 CFUNC :each c:0010 p:0013 s:0033 b:0033 l:000032 d:000032 METHOD /home/hal/.rvm/gems/ruby-1.9.3-p194/gems/directory_watcher-1.4.1/lib/directory_watcher.rb:579 c:0009 p:0012 s:0029 b:0029 l:0001a0 d:000028 BLOCK /home/hal/.rvm/gems/ruby-1.9.3-p194/gems/directory_watcher-1.4.1/lib/directory_watcher.rb:334 c:0008 p:---- s:0026 b:0026 l:000025 d:000025 FINISH c:0007 p:---- s:0024 b:0024 l:000023 d:000023 CFUNC :call c:0006 p:0032 s:0020 b:0020 l:000019 d:000019 METHOD /home/hal/.rvm/gems/ruby-1.9.3-p194/gems/directory_watcher-1.4.1/lib/directory_watcher/scanner.rb:224 c:0005 p:0085 s:0017 b:0017 l:000016 d:000016 METHOD /home/hal/.rvm/gems/ruby-1.9.3-p194/gems/directory_watcher-1.4.1/lib/directory_watcher/scanner.rb:102 c:0004 p:0042 s:0012 b:0012 l:000011 d:000011 METHOD /home/hal/.rvm/gems/ruby-1.9.3-p194/gems/directory_watcher-1.4.1/lib/directory_watcher/scanner.rb:150 c:0003 p:0013 s:0007 b:0007 l:001008 d:000006 BLOCK /home/hal/.rvm/gems/ruby-1.9.3-p194/gems/directory_watcher-1.4.1/lib/directory_watcher/scanner.rb:45 c:0002 p:---- s:0004 b:0004 l:000003 d:000003 FINISH c:0001 p:---- s:0002 b:0002 l:000001 d:000001 TOP -- Ruby level backtrace information ---------------------------------------- /home/hal/.rvm/gems/ruby-1.9.3-p194/gems/directory_watcher-1.4.1/lib/directory_watcher/scanner.rb:45:in `block in start' /home/hal/.rvm/gems/ruby-1.9.3-p194/gems/directory_watcher-1.4.1/lib/directory_watcher/scanner.rb:150:in `run_loop' /home/hal/.rvm/gems/ruby-1.9.3-p194/gems/directory_watcher-1.4.1/lib/directory_watcher/scanner.rb:102:in `run_once' /home/hal/.rvm/gems/ruby-1.9.3-p194/gems/directory_watcher-1.4.1/lib/directory_watcher/scanner.rb:224:in `notify' /home/hal/.rvm/gems/ruby-1.9.3-p194/gems/directory_watcher-1.4.1/lib/directory_watcher/scanner.rb:224:in `call' /home/hal/.rvm/gems/ruby-1.9.3-p194/gems/directory_watcher-1.4.1/lib/directory_watcher.rb:334:in `block in initialize' /home/hal/.rvm/gems/ruby-1.9.3-p194/gems/directory_watcher-1.4.1/lib/directory_watcher.rb:579:in `notify_observers' /home/hal/.rvm/gems/ruby-1.9.3-p194/gems/directory_watcher-1.4.1/lib/directory_watcher.rb:579:in `each' /home/hal/.rvm/gems/ruby-1.9.3-p194/gems/directory_watcher-1.4.1/lib/directory_watcher.rb:580:in `block in notify_observers' /home/hal/.rvm/gems/ruby-1.9.3-p194/gems/directory_watcher-1.4.1/lib/directory_watcher.rb:580:in `call' /home/hal/.rvm/gems/ruby-1.9.3-p194/gems/jekyll-0.11.2/bin/jekyll:253:in `block in ' /home/hal/.rvm/gems/ruby-1.9.3-p194/gems/jekyll-0.11.2/lib/jekyll/site.rb:41:in `process' /home/hal/.rvm/gems/ruby-1.9.3-p194/gems/jekyll-0.11.2/lib/jekyll/site.rb:203:in `render' /home/hal/.rvm/gems/ruby-1.9.3-p194/gems/jekyll-0.11.2/lib/jekyll/site.rb:203:in `each' /home/hal/.rvm/gems/ruby-1.9.3-p194/gems/jekyll-0.11.2/lib/jekyll/site.rb:204:in `block in render' /home/hal/.rvm/gems/ruby-1.9.3-p194/gems/jekyll-0.11.2/lib/jekyll/page.rb:100:in `render' /home/hal/.rvm/gems/ruby-1.9.3-p194/gems/jekyll-0.11.2/lib/jekyll/convertible.rb:79:in `do_layout' /home/hal/.rvm/gems/ruby-1.9.3-p194/gems/liquid-2.3.0/lib/liquid/template.rb:124:in `render' /home/hal/.rvm/gems/ruby-1.9.3-p194/gems/liquid-2.3.0/lib/liquid/block.rb:82:in `render' /home/hal/.rvm/gems/ruby-1.9.3-p194/gems/liquid-2.3.0/lib/liquid/block.rb:92:in `render_all' /home/hal/.rvm/gems/ruby-1.9.3-p194/gems/liquid-2.3.0/lib/liquid/block.rb:92:in `collect' /home/hal/.rvm/gems/ruby-1.9.3-p194/gems/liquid-2.3.0/lib/liquid/block.rb:94:in `block in render_all' /home/hal/.rvm/gems/ruby-1.9.3-p194/gems/jekyll-0.11.2/lib/jekyll/tags/highlight.rb:44:in `render' /home/hal/.rvm/gems/ruby-1.9.3-p194/gems/jekyll-0.11.2/lib/jekyll/tags/highlight.rb:54:in `render_pygments' /home/hal/.rvm/gems/ruby-1.9.3-p194/gems/pygments.rb-0.2.13/lib/pygments/ffi.rb:95:in `highlight' /home/hal/.rvm/gems/ruby-1.9.3-p194/gems/pygments.rb-0.2.13/lib/pygments/ffi.rb:120:in `formatter_for' /home/hal/.rvm/gems/ruby-1.9.3-p194/gems/rubypython-0.6.2/lib/rubypython/rubypyproxy.rb:165:in `method_missing' /home/hal/.rvm/gems/ruby-1.9.3-p194/gems/rubypython-0.6.2/lib/rubypython/pyobject.rb:82:in `hasAttr' /home/hal/.rvm/gems/ruby-1.9.3-p194/gems/rubypython-0.6.2/lib/rubypython/pyobject.rb:82:in `PyObject_HasAttrString' -- C level backtrace information ------------------------------------------- Segmentation fault (core dumped)
When using using rubypython-0.5.3 with python2.7 in Debian (testing) observe the following:
/usr/local/rvm/gems/ruby-1.9.3-p392/gems/blankslate-3.1.2/lib/blankslate.rb:51: warning: undefining `object_id' may cause serious problems
rake aborted!
Could not open library 'lib.so': lib.so: cannot open shared object file: No such file or directory
/usr/local/rvm/gems/ruby-1.9.3-p392/gems/ffi-1.0.11/lib/ffi/library.rb:121:in `block in ffi_lib'
/usr/local/rvm/gems/ruby-1.9.3-p392/gems/ffi-1.0.11/lib/ffi/library.rb:88:in `map'
/usr/local/rvm/gems/ruby-1.9.3-p392/gems/ffi-1.0.11/lib/ffi/library.rb:88:in `ffi_lib'
/usr/local/rvm/gems/ruby-1.9.3-p392/gems/rubypython-0.5.3/lib/rubypython/python.rb:29:in `<module:Python>'
/usr/local/rvm/gems/ruby-1.9.3-p392/gems/rubypython-0.5.3/lib/rubypython/python.rb:21:in `<top (required)>'
/usr/local/rvm/gems/ruby-1.9.3-p392/gems/activesupport-3.2.13/lib/active_support/dependencies.rb:245:in `load'
/usr/local/rvm/gems/ruby-1.9.3-p392/gems/activesupport-3.2.13/lib/active_support/dependencies.rb:245:in `block in load'
/usr/local/rvm/gems/ruby-1.9.3-p392/gems/activesupport-3.2.13/lib/active_support/dependencies.rb:236:in `load_dependency'
/usr/local/rvm/gems/ruby-1.9.3-p392/gems/activesupport-3.2.13/lib/active_support/dependencies.rb:245:in `load'
/usr/local/rvm/gems/ruby-1.9.3-p392/gems/rubypython-0.5.3/lib/rubypython.rb:261:in `reload_library'
/usr/local/rvm/gems/ruby-1.9.3-p392/gems/rubypython-0.5.3/lib/rubypython.rb:104:in `start'
/usr/local/rvm/gems/ruby-1.9.3-p392/gems/pygments.rb-0.2.13/lib/pygments/ffi.rb:8:in `start'
/usr/local/rvm/gems/ruby-1.9.3-p392/gems/pygments.rb-0.2.13/lib/pygments/ffi.rb:42:in `lexers'
/usr/local/rvm/gems/ruby-1.9.3-p392/gems/pygments.rb-0.2.13/lib/pygments/lexer.rb:147:in `<module:Pygments>'
/usr/local/rvm/gems/ruby-1.9.3-p392/gems/pygments.rb-0.2.13/lib/pygments/lexer.rb:1:in `<top (required)>'
/usr/local/rvm/gems/ruby-1.9.3-p392/gems/github-linguist-2.3.4/lib/linguist/language.rb:221:in `initialize'
/usr/local/rvm/gems/ruby-1.9.3-p392/gems/github-linguist-2.3.4/lib/linguist/language.rb:30:in `new'
/usr/local/rvm/gems/ruby-1.9.3-p392/gems/github-linguist-2.3.4/lib/linguist/language.rb:30:in `create'
/usr/local/rvm/gems/ruby-1.9.3-p392/gems/github-linguist-2.3.4/lib/linguist/language.rb:458:in `block in <module:Linguist>'
/usr/local/rvm/gems/ruby-1.9.3-p392/gems/github-linguist-2.3.4/lib/linguist/language.rb:434:in `each'
/usr/local/rvm/gems/ruby-1.9.3-p392/gems/github-linguist-2.3.4/lib/linguist/language.rb:434:in `<module:Linguist>'
/usr/local/rvm/gems/ruby-1.9.3-p392/gems/github-linguist-2.3.4/lib/linguist/language.rb:8:in `<top (required)>'
/usr/local/rvm/gems/ruby-1.9.3-p392/gems/activesupport-3.2.13/lib/active_support/dependencies.rb:251:in `require'
/usr/local/rvm/gems/ruby-1.9.3-p392/gems/activesupport-3.2.13/lib/active_support/dependencies.rb:251:in `block in require'
/usr/local/rvm/gems/ruby-1.9.3-p392/gems/activesupport-3.2.13/lib/active_support/dependencies.rb:236:in `load_dependency'
/usr/local/rvm/gems/ruby-1.9.3-p392/gems/activesupport-3.2.13/lib/active_support/dependencies.rb:251:in `require'
/usr/local/rvm/gems/ruby-1.9.3-p392/gems/github-linguist-2.3.4/lib/linguist/blob_helper.rb:2:in `<top (required)>'
/usr/local/rvm/gems/ruby-1.9.3-p392/gems/activesupport-3.2.13/lib/active_support/dependencies.rb:251:in `require'
/usr/local/rvm/gems/ruby-1.9.3-p392/gems/activesupport-3.2.13/lib/active_support/dependencies.rb:251:in `block in require'
/usr/local/rvm/gems/ruby-1.9.3-p392/gems/activesupport-3.2.13/lib/active_support/dependencies.rb:236:in `load_dependency'
/usr/local/rvm/gems/ruby-1.9.3-p392/gems/activesupport-3.2.13/lib/active_support/dependencies.rb:251:in `require'
/usr/local/rvm/gems/ruby-1.9.3-p392/gems/github-linguist-2.3.4/lib/linguist.rb:1:in `<top (required)>'
/usr/local/rvm/gems/ruby-1.9.3-p392@global/gems/bundler-1.3.5/lib/bundler/runtime.rb:72:in `require'
/usr/local/rvm/gems/ruby-1.9.3-p392@global/gems/bundler-1.3.5/lib/bundler/runtime.rb:72:in `block (2 levels) in require'
/usr/local/rvm/gems/ruby-1.9.3-p392@global/gems/bundler-1.3.5/lib/bundler/runtime.rb:70:in `each'
/usr/local/rvm/gems/ruby-1.9.3-p392@global/gems/bundler-1.3.5/lib/bundler/runtime.rb:70:in `block in require'
/usr/local/rvm/gems/ruby-1.9.3-p392@global/gems/bundler-1.3.5/lib/bundler/runtime.rb:59:in `each'
/usr/local/rvm/gems/ruby-1.9.3-p392@global/gems/bundler-1.3.5/lib/bundler/runtime.rb:59:in `require'
/usr/local/rvm/gems/ruby-1.9.3-p392@global/gems/bundler-1.3.5/lib/bundler.rb:132:in `require'
/srv/rosa_build/current/config/application.rb:11:in `<top (required)>'
/srv/rosa_build/current/Rakefile:4:in `require'
/srv/rosa_build/current/Rakefile:4:in `<top (required)>'
/usr/local/rvm/gems/ruby-1.9.3-p392@global/gems/rake-10.1.0/lib/rake/rake_module.rb:25:in `load'
/usr/local/rvm/gems/ruby-1.9.3-p392@global/gems/rake-10.1.0/lib/rake/rake_module.rb:25:in `load_rakefile'
/usr/local/rvm/gems/ruby-1.9.3-p392@global/gems/rake-10.1.0/lib/rake/application.rb:637:in `raw_load_rakefile'
/usr/local/rvm/gems/ruby-1.9.3-p392@global/gems/rake-10.1.0/lib/rake/application.rb:94:in `block in load_rakefile'
/usr/local/rvm/gems/ruby-1.9.3-p392@global/gems/rake-10.1.0/lib/rake/application.rb:165:in `standard_exception_handling'
/usr/local/rvm/gems/ruby-1.9.3-p392@global/gems/rake-10.1.0/lib/rake/application.rb:93:in `load_rakefile'
/usr/local/rvm/gems/ruby-1.9.3-p392@global/gems/rake-10.1.0/lib/rake/application.rb:77:in `block in run'
/usr/local/rvm/gems/ruby-1.9.3-p392@global/gems/rake-10.1.0/lib/rake/application.rb:165:in `standard_exception_handling'
/usr/local/rvm/gems/ruby-1.9.3-p392@global/gems/rake-10.1.0/lib/rake/application.rb:75:in `run'
/usr/local/rvm/gems/ruby-1.9.3-p392@global/gems/rake-10.1.0/bin/rake:33:in `<top (required)>'
/usr/local/rvm/gems/ruby-1.9.3-p392@global/bin/rake:19:in `load'
/usr/local/rvm/gems/ruby-1.9.3-p392@global/bin/rake:19:in `<main>'
/usr/local/rvm/gems/ruby-1.9.3-p392/bin/ruby_noexec_wrapper:14:in `eval'
/usr/local/rvm/gems/ruby-1.9.3-p392/bin/ruby_noexec_wrapper:14:in `<main>'
Excavations have shown that rubypython can not find libpython2.7.so, because the public library located in /usr/lib/x86_64-linux-gnu/:
$ ls -l /usr/lib/x86_64-linux-gnu/libpython*
lrwxrwxrwx 1 root root 51 Jun 2 18:19 /usr/lib/x86_64-linux-gnu/libpython2.7.a -> ../python2.7/config-x86_64-linux-gnu/libpython2.7.a
lrwxrwxrwx 1 root root 17 Jun 2 18:19 /usr/lib/x86_64-linux-gnu/libpython2.7.so -> libpython2.7.so.1
lrwxrwxrwx 1 root root 19 Jun 2 18:19 /usr/lib/x86_64-linux-gnu/libpython2.7.so.1 -> libpython2.7.so.1.0
-rw-r--r-- 1 root root 3262616 Jun 2 18:19 /usr/lib/x86_64-linux-gnu/libpython2.7.so.1.0
Options to fix: add the path matching condition /usr/lib/*-linux-gnu/ to the search libraries path.
I tried building rubypython from hg source, but the gemspec which Hoe generated was out of date (particularly gem.files
). Consider using a live gemspec which calls hg manifest
to list the files. Here is one such gemspec generated by Ore.
# -*- encoding: utf-8 -*- require File.expand_path('../lib/rubypython/version', __FILE__) Gem::Specification.new do |gem| gem.name = "rubypython" gem.version = RubyPython::VERSION gem.summary = %q{RubyPython is a bridge between the Ruby and Python interpreters} gem.description = %q{ RubyPython is a bridge between the Ruby and Python interpreters. It embeds a running Python interpreter in the Ruby application's process using FFI and provides a means for wrapping, converting, and calling Python objects and methods. RubyPython uses FFI to marshal the data between the Ruby and Python VMs and make Python calls. You can: * Inherit from Python classes. * Configure callbacks from Python. * Run Python generators (on Ruby 1.9.2 or later). }.strip gem.license = "MIT" gem.authors = ['Steeve Morin', 'Austin Ziegler', 'Zach Raines'] gem.email = [ '[email protected]', '[email protected]', '[email protected]' ] gem.homepage = 'http://raineszm.bitbucket.org/rubypython/' gem.files = `hg manifest`.split($/) gem.executables = gem.files.grep(%r{^bin/}).map{ |f| File.basename(f) } gem.test_files = gem.files.grep(%r{^(test|spec|features)/}) gem.require_paths = ['lib'] gem.requirements = 'Python >= 2.4' gem.add_dependency 'ffi', '~> 1.0.7' gem.add_dependency 'blankslate', '>= 2.1.2.3' gem.add_development_dependency 'rspec', '~> 2.0' gem.add_development_dependency 'tilt', '~> 1.0' end
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.