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
1
vote
3 answers

How to do blocking subscribe using bunny RabbitMQ client?

In java RabbitMQ client I can do (code in ruby): consumer = QueueingConsumer.new(channel); channel.basicConsume(queue_name, true, consumer); consumer.nextDelivery.getBody And then third line blocks thread until message comes. But how to achieve…
Sławosz
  • 11,187
  • 15
  • 73
  • 106
1
vote
1 answer

Bundler::Git error on app startup (passenger 4, nginx flavor, and jruby 1.7.3 for the app under rvm)

There are many similar questions, but they are rather dated. The error is familiar, but updated now for passenger 4.0.0.2 and jruby 1.7.3. The web application cannot be started, and in the stack trace is The git source is not yet checked out.…
darethas
  • 7,377
  • 3
  • 23
  • 32
1
vote
1 answer

Porting a rails4 app from MRI to JRuby with puma, no luck

I'm developing a rails 4.0.0.beta1 app on MRI 2.0.0 and all looks working. I would like to try to run it on JRuby with puma. $ ruby -v jruby 1.7.3 (1.9.3p385) 2013-02-21 dac429b on Java HotSpot(TM) 64-Bit Server VM 1.6.0_45-b06-451-11M4406…
SDp
  • 329
  • 3
  • 13
1
vote
2 answers

passenger 4.0 standalone not starting when using jruby under rvm

Passenger 4 claims to have support for jruby. When I change into my jruby project directory, execute rvm use jruby and proceed to passenger start it state that the Ruby development headers cannot be found and wants me to install ruby. (passenger 4.0…
darethas
  • 7,377
  • 3
  • 23
  • 32
1
vote
2 answers

Coerce a ByteArrayInputStream to InputStream

I have some code that does: content = Java::byte[s].new f = tar.read(content, 0, s) content_stream = ByteArrayInputStream.new(content) So far, so good But when I try to use a method that only takes an InputStream, like so: metadata =…
clee
  • 10,943
  • 6
  • 36
  • 28
1
vote
1 answer

Cron automatically detect jruby path and execute ruby script

I've a cron job that is supposed to execute a ruby script but it is failing with: /bin/sh: 1: jruby: not found I know I can set manually jruby location but I want cron to pick automatically as this will be deployed in different machines which have…
zulqarnain
  • 1,695
  • 1
  • 16
  • 33
1
vote
0 answers

JRuby Calling Java Methods - TypeError/ConcreteJavaProxy

I am creating a jruby library that has JDI bindings, but when calling a java method, I am getting some weird object inconsistencies that aren't allowing me to call certain methods. new_value = @vm.mirrorOf(value) puts("New Value:…
wuntee
  • 12,170
  • 26
  • 77
  • 106
1
vote
1 answer

jRuby and Rubinius support parallel computing, but what about gems that don't support this?

What I'm trying to understand is, practically speaking, how much benefit do I get from the parallel computing support in jRuby / Rubinius? A lot of ruby libraries keep track of global internal state. Is there any way to deal with these libraries, or…
Vlad the Impala
  • 15,572
  • 16
  • 81
  • 124
1
vote
1 answer

String variable coerced into fixnum inside inject (aka reduce) for ruby

The following code has the collector variable "sql" starting off life as a string but then coerced into fixnum. There is no apparent reason for such a conversion. segs=['segment1', 'segment2'] sx=1 sqlout = segs.inject("select ") do | sql, seg| …
WestCoastProjects
  • 58,982
  • 91
  • 316
  • 560
1
vote
2 answers

Model paper clips validations errors are not displayed in simple_form

I am using paper_clip and simple_form gems. Unfortunately, it seems that paper clip validations errors are not displayed in my form. I have try several types and syntax of paper_clip content_type validations and even they work (the uploaded files…
gotqn
  • 42,737
  • 46
  • 157
  • 243
1
vote
1 answer

asset_path - fonts not applied

I am trying to load some additional fonts in my rails application using: Jruby 1.7.3 Rails 3.2.13 The css (its type is css.scss.erb) document is in app/assets/stylesheets/custom/ folder and looks like follows: @font-face { font-family:…
gotqn
  • 42,737
  • 46
  • 157
  • 243
1
vote
1 answer

undefined method `to_a' for "include Rubeus::Swing\n":String

I installed rubeus using the command below: jruby -S gem install rubeus bundle install Then when i execute: include Rubeus::Swing I get this error : undefined method `to_a' for "include Rubeus::Swing\n":String So I think gem installed the wrong…
aliep
  • 1,702
  • 2
  • 21
  • 33
1
vote
1 answer

Application Development in JRuby

I'm trying to create a windows desktop application in jruby but I have no idea what I'm doing. So far I've installed jruby 1.7.3 and JetBrains RubyMine. I created a new project and then a new file called window.rb but I have no sense of how to…
Richard
  • 5,840
  • 36
  • 123
  • 208
1
vote
1 answer

How to invoke a java static method from jruby

How do I do this? include Java Thread.currentThread.sleep 3 I saw a posting from several years ago but it did not directly answer the question. thx
WestCoastProjects
  • 58,982
  • 91
  • 316
  • 560
1
vote
3 answers

Is there anything wrong with having a (custom) getId method on a Java object used in JRuby?

I'm a big fan of concise method names, so when our codebase has something like: Account.getAccountId(); I like to add an alias so that I can just do: Account.getId(); However, I've heard ... murmurs from elsewhere in my company about how this…
machineghost
  • 33,529
  • 30
  • 159
  • 234
1 2 3
99
100