Questions tagged [jruby]

JRuby is an open-source Java implementation of the Ruby programming language. It is Ruby for the JVM. Using idiomatic Ruby syntax, JRuby can consume Java classes and libraries with ease.

JRuby is an open-source Java implementation of the Ruby programming language. It is Ruby for the JVM. Using idiomatic Ruby syntax, JRuby can consume Java classes and libraries with ease.

The tight integration of JRuby with the JVM affords JRuby many advantages which include concurrency, native threads, a mature and efficient garbage collector and significant performance boosts via JIT compilation.

2833 questions
8
votes
2 answers

Why is ActiveSupport::JSON.encode so slow?

JRuby 9.2, Rails 4.2 I've been work with reading/dumping large JSON objects, 100+MB files, which would routinely hang for a few minutes then run out of memory when writing them out. I noticed it specifically happens when using to_json. Below is with…
Karl
  • 6,035
  • 5
  • 30
  • 39
8
votes
4 answers

Require Nokogiri? No such file to load

I'm trying to get started with using Nokogiri. I ran the command gem install nokogiri as an administrator in Windows 7 (64-Bit). The console said "successfully installed" and "1 gem installed". When I type in gem list --local OR gem q --local I…
Derek
  • 833
  • 2
  • 9
  • 13
8
votes
1 answer

Missing constant and "const_missing" inside "class << self" definition

I'm greatly confused by Ruby's behavior when defining const_missing and other class methods inside a class << self definition as opposed to using the def self.foo syntax. I was trying to do something like this: class Foo class << self def…
martido
  • 373
  • 2
  • 9
8
votes
2 answers

Conditional gem dependencies

Is it possible to conditionally set a dependency on a gem at install time? Here's my situation which will hopefully clarify the question. There is a gem I maintain that depends on the json gem. However, I frequently use jruby which has a port of the…
jshen
  • 11,507
  • 7
  • 37
  • 59
8
votes
2 answers

Can I import Java class files into JRuby?

The documentation seems to suggest that in order for me to import Java classes into JRuby, that they must be in a JAR file: "In order to use resources within a jar file from JRuby the jar file must either be on the classpath or you can make it…
bjnortier
  • 2,008
  • 18
  • 18
8
votes
2 answers

Combining 2 rails apps to a single codebase

Our company started out with a single product, a rails app backed by some java services, then decided they wanted another product that was initially considerably different than the first, but as time has gone on we've realized they are starting to…
brad
  • 31,987
  • 28
  • 102
  • 155
8
votes
1 answer

JRuby gemspec local jar dependencies

I would like to include in gemspec 'jar dependencies' that are local such as /opt/someplugin/lib/somejar.jar Currently the only way I found to use a local jar file in a project is within *.rb file by require /opt/someplugin/lib/somejar.jar It will…
Tal.Bary
  • 450
  • 2
  • 16
8
votes
3 answers

Using a self-signed certificate

I am just trying to get my head around SSL. I have set up a Jetty server on my localhost, and generated my own certificate using Keytool. Now when I go to https://localhost:8443/ I get the can't trust this certificate error. I use keytool -export…
Mongus Pong
  • 11,337
  • 9
  • 44
  • 72
8
votes
3 answers

HBase shell scan bytes to string conversion

I would like to scan hbase table and see integers as strings (not their binary representation). I can do the conversion but have no idea how to write scan statement by using Java API from hbase shell: org.apache.hadoop.hbase.util.Bytes.toString( …
Yuri Levinsky
  • 1,515
  • 2
  • 13
  • 26
8
votes
1 answer

Using OrientDB's JDBC driver with ActiveRecord

What is the proper way of using OrientDB's JDBC driver with ActiveRecord? I am trying to connect a Rails 3.2 application to OrientDB 1.4. I installed the gem activerecord-jdbc-adapter, and configured the database.yml as follows: development: …
8
votes
1 answer

How to decode subject fetched via Net::IMAP which in UTF8? (ruby)

I'm using Net::IMAP.fetch to fetch some messages from Gmail. However, when I fetch a message which has a UTF8 subject (i.e., in cyrillic) I get something like this: =?UTF-8?B?0KHRgNC/0YHQutC4INGE0L7RgNGD0Lwg0YLRgNCw?=…
Robert Grezan
  • 1,266
  • 3
  • 13
  • 27
8
votes
2 answers

Best approach to wrap an existing Java library in Ruby (JRuby)

I'm looking to putting a ruby (JRuby) wrapper over a medium sized Java Library and am looking for advice and articles on best practices for everything from packaging to strategy. I found a relatively dated (2009) discussion on this topic here:…
justingordon
  • 12,553
  • 12
  • 72
  • 116
8
votes
4 answers

Is there a way to make the Jruby runtime intern all strings?

We have a java/jruby webapp running under tomcat, and I have been analyzing the number of objects and memory use by the app during runtime. I have noticed after startup the class "org.jruby.RubyString" had 1,118,000 instances of the string "", the…
Chiwai Chan
  • 4,716
  • 4
  • 30
  • 33
7
votes
3 answers

What practical effect will different Ruby threading models (Ruby vs JRuby) have on your code as a developer?

I'm trying to understand the practical impact of different threading models between MRI Ruby 1.8 and JRuby. What does this difference mean to me as a developer? And also, are there any practical examples of code in MRI Ruby 1.8 that will have worse…
Charles Bain
  • 71
  • 1
  • 2
7
votes
2 answers

many errors installing mysql on jruby

I'm trying to get mysql gem installed for use on rails, using jruby, can't figure this out...any help is appreciated! $ sudo gem install mysql2 Building native extensions. This could take a while... ERROR: Error installing mysql2: ERROR:…
stewart715
  • 5,557
  • 11
  • 47
  • 80