Questions tagged [rubypython]

RubyPython is a bridge between the Ruby and Python interpreters.

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.

Project homepage.

According to the project's README it is no longer being maintained as of January 2015.

14 questions
4
votes
1 answer

How to test Python code with Ruby rspec?

I tried to test rubypython with the following: bundle exec irb require 'rubypython' RubyPython.start This resulted in an error. The error message is: Python-2.7.5 python --version Python 2.7.6 ➜ Python-2.7.5 cd .. ➜ code ls design Gemfile …
Satchel
  • 16,414
  • 23
  • 106
  • 192
4
votes
1 answer

ruby equivalent of destructor

I'm using RubyPython to import a Python module. I am doing RubyPython.start in the constructor (initialize), and I suppose I should symmetrically do RubyPython.stop in the destructor, but unfortunately it seems that there is no destructor in…
nonbeing
  • 6,907
  • 6
  • 36
  • 46
4
votes
1 answer

Rubypython error during importing NLTK

I have problem with command "import nltk" in my jRuby/Rails project. The interesting thing is, that everything works well if I run the code with "import nltk" on webrick server for first time after restart webrick. Any other attempt to run code…
Volt
  • 127
  • 2
  • 14
2
votes
1 answer

Executing arbitrary blocks of python code with RubyPython

I'm trying to use the RubyPython module (https://github.com/halostatue/rubypython) to execute Python code from within a Ruby script. I have the module all set up correctly, but am very confused how to use it. If I had a block of Python code as…
Bryce
  • 2,802
  • 1
  • 21
  • 46
2
votes
2 answers

How to setup environment variables with behave (Python BDD framework)?

So our test environments dynamically change depending on the release that we are working on. For example: for abc release the URL for the test environment would be feature-abc.mycompany.com, for xyz release the URL for the test environment would be…
Carlos Melo
  • 899
  • 1
  • 8
  • 9
2
votes
3 answers

Ruby Dir.foreach in System32 misses files / File.exists? returns false for existing files

When I print out all files in the windows 7 system32 directory using ruby, some files are missing. I use this simple directory iteration: Dir.foreach("C:\\Windows\\System32") do |fname| puts fname end I am specifically looking for python27.dll,…
CodeSalad
  • 1,375
  • 2
  • 14
  • 22
1
vote
1 answer

RubyPython can't import nltk on OS X Lion

I've got a copy of Lion with all the dev tools installed. Both Python (2.7) and Ruby (1.8) are running just fine. I've installed the Natural Language Tool Kit for Python and tried it out in the Python interpreter and it works import nltk >>true So…
jbrennan
  • 11,943
  • 14
  • 73
  • 115
1
vote
2 answers

Ruby 2.1.5 and RubyPython 0.6.3- RubyPython::InvalidInterpreter: An invalid interpreter was specified

I'm trying to use RubyPython on Debian 8 and have been unable to. RubyPython.start always raises an InvalidInterpreter exception. I've tried specifying the python interpreter executable but it doesn't matter. The snipped below shows my versions and…
Adam Drew
  • 225
  • 2
  • 10
1
vote
0 answers

RubyPython can't import class in Ruby on Rails

I'm try to run a Python script I wrote from a Ruby on Rails controller using RubyPython Version numbers are Ruby 2.1.2p95 Rails 4.1.6 RubyPython 0.6.3 Python 3.2.3 The Python class isn't stored in the controller…
TheLukeMcCarthy
  • 2,253
  • 2
  • 25
  • 34
1
vote
1 answer

RubyPython imports

I'm fairly new to both python and ruby. I've created a python script that imports it's dependencies like this: import sys sys.path.append("/usr/share/anki") from anki import Collection from anki.importing import TextImporter How do I achieve the…
Deiwin
  • 420
  • 5
  • 21
0
votes
0 answers

Installing rubypython ruby gem on mac m1

We recently upgraded to Mac M1 and trying to install rubypython gem. https://github.com/halostatue/rubypython/blob/master/rubypython.gemspec As per the gem specification, it only allows FFI version of 1.0.x s.add_dependency(%q, ["~>…
user27111987
  • 995
  • 2
  • 10
  • 26
0
votes
0 answers

RubyPython doesn't work on Ubuntu 14.04

I'm having a problem with my Rails application in production, RubyPython won't run; I get the following error: RubyPython::InvalidInterpreter: An invalid interpreter was specified. I'm using ruby 2.3.0, the python version is 2.7.6 (CPython). It's…
rubyist
  • 389
  • 4
  • 22
0
votes
3 answers

Using the rubypython gem in ruby on rails, how do you call a python script from the lib folder?

I know ruby pretty well, but I've never used python before. There's this great python script called colorific. I've checked this script out in the lib folder in my rails app and installed the rubypython gem. I was wondering how I now import this…
CafeHey
  • 5,699
  • 19
  • 82
  • 145
0
votes
2 answers

calling standard python functions from rubypython

I am trying to use the rubypython gem. Not sure how to call standard python functions like len and set. In the python examples I see len(text3) and set(text3). How do I call these in rubypython? Here is the link to rubypython:…
nilanjan
  • 661
  • 3
  • 9
  • 18