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
205
votes
6 answers

How do you round a float to 2 decimal places in JRuby?

How do you round a float to 2 decimal places in JRuby(1.6.x)? number = 1.1164 number.round(2) # The above shows the following error # wrong number of arguments (1 for 0)
Sam
  • 8,387
  • 19
  • 62
  • 97
138
votes
5 answers

JRuby on Rails vs. Ruby on Rails, what's difference?

I'm looking to try out JRuby and JRuby on Rails. I'm having trouble finding information on what's difference between JRuby on Rails and Ruby on Rails. What's the differences I need to look out for?
epochwolf
  • 12,340
  • 15
  • 59
  • 70
79
votes
6 answers

How to make JRuby 1.6 default to Ruby 1.9?

what is the best way to make JRuby to run in 1.9 mode by default? i.e, I want to run rake test instead of jruby --1.9 -S rake test Thank you
arkadiy kraportov
  • 3,679
  • 4
  • 33
  • 42
77
votes
12 answers

SASS implementation for Java?

I'm looking for SASS implementation in Java (could be used with JSP/JSF). For Python I've found CleverCSS, but there is nothing for Java. Anyone heard something about this sort of tool for generating CSS?
user213225
  • 879
  • 1
  • 7
  • 3
54
votes
6 answers

Visit method not found in my rspec

My java web application is running on tomcat at http://localhost:8080/ Writing my first spec, home_spec: require 'spec_helper' describe "home" do it "should render the home page" do visit "/" page.should have_content("hello…
Blankman
  • 259,732
  • 324
  • 769
  • 1,199
53
votes
8 answers

What's the difference between Ruby and JRuby?

Can anyone please provide me in layman's terms the difference between developing a JRuby and a Ruby, Rails application? I use NetBeans as my Ruby on Rails IDE and every-time I create a project is asks me that question - and I don't really get the…
Ash
  • 24,276
  • 34
  • 107
  • 152
46
votes
4 answers

How can I tell if I'm running from JRuby vs. Ruby?

I have a script with a factory method that I would like to return a different implementation of some class depending on whether or not the script is running from JRuby or Ruby. Anyone have any ideas on how I could tell the difference from inside my…
pastorius
  • 633
  • 5
  • 8
43
votes
7 answers

Does Scala scale better than other JVM languages?

Here is the only way I know to ask it at the moment. As Understand it Scala uses the Java Virtual Machine. I thought Jruby did also. Twitter switched its middleware to Scala. Could they have done the same thing and used Jruby? Could they have…
johnny
  • 19,272
  • 52
  • 157
  • 259
36
votes
7 answers

Can we use Ruby on Rails to develop a mobile app?

Since Rails uses MVC architecture. I was wondering that if we can use Rails to develop a mobile app or any web app. Out of MVC the 'M' and 'C' won't change to develop the mobile app right? I mean the models and controllers will remain the same. Only…
Hemanth
  • 5,035
  • 9
  • 41
  • 59
34
votes
5 answers

Groovy advantages over Jython or Jruby?

Why would I choose to use Groovy when I could use Jython or Jruby? Does the language provide any inherent advantages to make up for the fact that Jython and Jruby skills are applicable to their parent languages outside of the JVM? Keep in mind that…
James McMahon
  • 48,506
  • 64
  • 207
  • 283
31
votes
5 answers

convert array of hashes to csv file

How do you convert an array of hashes to a .csv file? I have tried CSV.open("data.csv", "wb") do |csv| @data.to_csv end but it is blank
user1571609
28
votes
1 answer

How to run Ruby 2.0 with JRuby 1.7?

What is the best way to get JRuby to run in 2.0 mode?
Sébastien Le Callonnec
  • 26,254
  • 8
  • 67
  • 80
26
votes
6 answers

Which is faster: MRI Ruby or JRuby?

If I am using Ruby on Rails, should I install MRI/YARV Ruby or JRuby? Which is faster?
ses
  • 13,174
  • 31
  • 123
  • 226
26
votes
4 answers

Can I program for android using any JVM language?

Can I use other JVM languages besides Java (e.g. jruby, jython, clojure) to program for android, or is it java only? There was a similar question asked over a year ago but I wasn't sure if there'd been any change since then.
rampion
  • 87,131
  • 49
  • 199
  • 315
26
votes
2 answers

JRuby: import vs include vs java_import vs include_class

why so many different ways to include Java classes into JRuby? What are the differences? Which one should I use?
arkadiy kraportov
  • 3,679
  • 4
  • 33
  • 42
1
2 3
99 100