Questions tagged [rubinius]

Rubinius is an implementation of the Ruby programming language using LLVM.

Rubinius is an implementation of the Ruby programming language.The Rubinius bytecode virtual machine is written in C++, incorporating LLVM to compile bytecode to machine code at runtime. The bytecode compiler and vast majority of the core classes are written in pure Ruby

76 questions
3
votes
1 answer

Does the Ruby interpreter compile to byte-code in a lazy way? How?

For MRI 1.9+ and Rubinius implementation, Ruby source code is compiled into byte-code, and then that byte-code is interpreted by the VM. I want to know the details of this mechanism when running a Ruby script from command-line using the…
lucianolev
  • 519
  • 5
  • 5
3
votes
0 answers

Can't use special characters in Rails app with Rubinius

I'm using Rails 4.2.0 with Rubinius 2.4.1, installed on OSX 10.10 with RVM. But when I write in the rails console puts 'é', for example, I'm getting the following list of hostile errors: An exception occurred running bin/rails: "\xC3" to UTF-8 in…
Hassen
  • 6,966
  • 13
  • 45
  • 65
3
votes
1 answer

How can Rubinius and JRuby possibly be this slow?

I decided to see how long it would take to iterate through an array of hashes. Below is the code: pairs = [{name: "firstname", value: "string"},{name: "lastname", value: "string"},{name: "country", value: "string"},{name: "city", value:…
Ten Bitcomb
  • 2,316
  • 1
  • 25
  • 39
3
votes
1 answer

rbx tests fail with "Requested binary installation but no rubies are available to download"

I am writing a gem and I'm targeting Ruby, JRuby, and Rubinius. I'm using Travis CI to build my library. When I target Ruby and JRuby, my gem builds correctly, but when targeting Rubinius, it does not work. Here is the error: Using worker:…
Max
  • 15,157
  • 17
  • 82
  • 127
3
votes
1 answer

What does Rubinius.primitive do?

I'm reading through the Rubinius source code, and I keep coming across methods that go something like this: def self.do_something Rubinius.primitive :vm_do_something raise SomeError, "primitive failed to do something" end For example,…
Michael Dorst
  • 8,210
  • 11
  • 44
  • 71
3
votes
1 answer

Cross-Implementation Deterministic Array#shuffle

It is possible to pass a random number generator to Array#shuffle that makes the shuffle deterministic. For example, in MRI 1.9.3p327: [1, 2, 3, 4].shuffle(random: Random.new(0)) # => [1, 2, 4, 3] [1, 2, 3, 4].shuffle(random: Random.new(0)) # => [1,…
Sam Goldman
  • 1,446
  • 13
  • 13
3
votes
2 answers

Differences between Ruby VMs

What are the advantages/disadvantages of the major Ruby VMs (things like features, compatibility, performance, and quirks?) I know there are also some bonus features like being able to use Java interfaces through JRuby, too. Those would also be…
Zach
  • 24,496
  • 9
  • 43
  • 50
3
votes
2 answers

Rubinius: how to generate enumerator as the official way?

I have this simple code to generate a lazy array: lazy_arr = Enumerator.new { |y| i = 1 loop { y << i i+=1 } } p lazy_arr.take(5) In official Ruby 1.9.3, the output is [1,2,3,4,5], which is what I want. But in Rubinius,…
SwiftMango
  • 15,092
  • 13
  • 71
  • 136
2
votes
0 answers

Ruby interpreters, method execution

I'm doing some research into how different Ruby interpreters do method execution (e.g. when you call a method in ruby, what steps does the interpreter take to find and execute it, and which structures are involved in this). I am trying to compare…
mrbrdo
  • 7,968
  • 4
  • 32
  • 36
2
votes
1 answer

__respond_to_eh__ in Rubinius, eh?

In Rubinius, if you do rbx-head > Object.instance_methods.grep(/^_.*/) => ["__extend__", "__show__", "__marshal__", "__instance_of__", "__instance_variable_get__", "__send__", "__id__", "__instance_variable_set__", "__respond_to_eh__",…
Andrew Grimm
  • 78,473
  • 57
  • 200
  • 338
2
votes
1 answer

create a connection with a postgresql database using sequel and puma

For the past few weeks I've been learning Ruby and I must say that it hasn't been easy to get a grasp of some things. That leads me to asking this question, I'm trying to setup a project which uses Rubinius as ruby engine, puma as webserver (since…
Roland
  • 9,321
  • 17
  • 79
  • 135
2
votes
1 answer

Migrating to rubinius

I'm trying to migrate my project from mri to rubinius to get concurrency advantage. I've started the server and open first page and then got error: Puma caught this error: undefined method `=~' for Pathname (NameError) kernel/common/module.rb:212:in…
megas
  • 21,401
  • 12
  • 79
  • 130
2
votes
1 answer

Change Rubinius Ruby Version

Is there anyway to change the Ruby version that Rubinius (rbx) uses by default without having to specify the option each time by a flag?: rbx -X19
Andrew Clarkson
  • 295
  • 1
  • 7
2
votes
3 answers

Adding a "source" attribute to ruby objects using Rubinius

I'm attempting to (for fun and profit) add the ability to inspect objects in ruby and discover their source code. Not the generated bytecode, and not some decompiled version of the internal representation, but the actual source that was parsed to…
dave paola
  • 1,815
  • 3
  • 16
  • 27
2
votes
2 answers

How to compare Rails ''executables" before and after refactor?

In C, I could generate an executable, do an extensive rename only refactor, then compare executables again to confirm that the executable did not change. This was very handy to ensure that the refactor did not break anything. Has anyone done…
Kyle Heironimus
  • 7,741
  • 7
  • 39
  • 51