jruby

JRuby/Windows and (native) extensions how do I distinguish them?

I've tried to use EventMachine etc., with JRuby. I get errors about native extensions. I believe this is due to Java limitations. I think the fact that I am on Windows further complicates the issue. Some clarification would be appreciated. What extensions can/can't be used with JRuby? How can I tell? Thanks. ...

Security with Java Scripting (JRuby, Jython, Groovy, BeanShell, etc)

I'm looking to run some un-verified scripts (written in a yet-to-be-determined language, but needs to be Java-based, so JRuby, Groovy, Jython, BeanShell, etc are all candidates). I want these scripts to be able to do some things and restricted from doing other things. Normally, I'd just go use Java's SecurityManager and be done with it....

Glassfish in real world

Are there any companies/web-sites that use Glassfish in production? I am new to J2EE and deploy JRuby on Rails alongside a JAX-WS Metro application in Glassfish v3 Prelude. Sometimes the quirks make me go WTF and rip my hair out. I haven't had experience with Apache Tomcat and was wondering if it makes sense to switch to Tomcat, as Glas...

Why does JRuby not recognize BigNums while Ruby does?

If I type this big integer: puts 9997836544.class.to_s and compile with ruby 1.86, it reports expectedly: BigNum while JRuby (1.1.4 in Netbeans) reports surprisingly: Fixnum I thought Java had a BigInteger class to correspond to the BigNum class in Ruby. If so, I would have expected JRuby and ruby to produce the same output. ...

Casting Java Objects From JRuby

I'm working with a Java library in JRuby. I'm reading an object from a file, and I need to pass it as a different object type to a second constructor: @hmm_model = ObjectInputStream.new(FileInputStream.new(LINGPIPE_MODEL_PATH)) @tagger = HmmDecoder.new(@hmm_model) @hmm_model is of type ObjectInputStream, and needs to be cast to (Hidd...

Netbeans occasional non-compliation using Ruby MRI - solution?

Quite frequently when I save changes to a Ruby file in Netbeans and try to run the file, the interpreter simply doesn't do anything. The only way around it is to temporarily switch to the JRuby interpreter and then switch back to the default Ruby interpreter (1.86). Besides this hack, is anyone aware of a fix for this problem? It has pre...

Using Warbler, how do I exclude Active Record from the bundled gems?

When using Warbler, what line(s) do I need to add to config/warble.rb to keep it from including Active Record in the bundled gems. I already have excluded Active Record in config/environment.rb as shown below. config.frameworks -= [ :active_record ] I tried the same thing only using config.gems in config/warble.rb, but to no avail. ...

Using Tidy in JRuby

After spending some hours with the Ruby Debugger I finally learned that I need to clean up some malformed HTML pages before I can feed those to Hpricot. The best solution I found so far is the Tidy Ruby interface. Tidy works great from the command line and also the Ruby interface works. However, it requires dl/import, which fails to loa...

Is JRuby ready for production?

I just found out about JRuby, and I like the idea of running Ruby on Rails and being able to call Java libraries. I would like to know about some experiences with running enterprise production applications in JRuby. Are stability and performance acceptable? Thanks. ...

JRuby Online Books

Hi, Are there any good online JRuby e-books? Thanks ...

RSpec Gem does not seem to install dependencies...

$> jruby -v jruby 1.1.4 (ruby 1.8.6 patchlevel 114) (2008-08-28 rev 7570) [x86-java] $> gem install rspec JRuby limited openss loaded. gem install jruby-openssl for full support. http://wiki.jruby.org/wiki/JRuby_Builtin_OpenSSL Succesfully installed rspec-1.1.12 1 gem installed Installing ri documentation for rspec-1.1.12... Installin...

What is the significance for Ruby programmers of SAP's new implementation of Ruby?

SAP announced Blue Ruby, a version of Ruby that runs inside the ABAP Virtual Machine. This seems to lend additional credibility to the Ruby language but, except for SAP developers, does this have any applicability to the rest of the Ruby community? I'm just wondering what other significance this may have. Additional job opportunities,...

Installing hpricot for JRuby

I'm trying to look at cucumber for Jruby on Rails. One of the pre-requesites is webrat which has as pre-requisite hpricot. I've installed the gem with hpricot using: gem install hpricot --source http://code.whytheluckystiff.net --version 0.6.1 --platform java This installs the java version of hpricot. I add the hpricot_scan.jar to the...

What's an example of Java functionality that I could add to a JRuby/Rails project?

This is actually two questions rolled into one. Is there a particular type of Java functionality that people are using JRuby for or is it mainly because of the performance advantage that JRuby gives versus the MRI? The reason I ask is, I'd like to add some Java functionality to a Rails project (just to show that it's possible). Idea...

Using embedded Derby with JRuby on Rails.

Attempting to use JRuby 1.2.0 and Rails 2.3.2 with an embedded Derby database. I've copied derbytools.jar and derby.jar to $RUBY_HOME/lib, yet rake db:migrate still gives: The driver encountered an error: cannot load Java class org.apache.derby.jdbc.ClientDriver Aaaand... I played a hunch and figured it out. So, I'll post this...

How to connect to Oracle using JRuby & JDBC

First approach: bare metal require 'java' require 'rubygems' require "c:/ruby/jruby-1.2.0/lib/ojdbc14.jar" # should be redundant, but tried it anyway odriver = Java::JavaClass.for_name("oracle.jdbc.driver.OracleDriver") puts odriver.java_class url = "jdbc:oracle:thin:@myhost:1521:mydb" puts "About to connect..." con = java.sql.DriverMa...

ActiveRecord does not work on App Engine - What's the alternative?

Early reports of JRuby on Google App Engine indicate that ActiveRecord does not work. It was my understanding that this was the only way to talk to the database in Rails. Is this not the case? And, if not, what is the alternative? Is there a more direct way in Rails of interfacing with Google's BigTable datastore? ...

Why do so many insist on dragging the JVM into new applications?

For example, I'm running into developers and architects who are scared to death of Rails apps, but love the idea of writing new Grails apps. From what I've seen, there is a LOT of resource overhead that goes into using the JVM to support languages such as Groovy, JRuby and Jython instead of straight Ruby or Python. Ruby and Python ca...

Connecting to MS SQL Server with JRuby

I'm working on a project that involves some scripting and data storage. The database that I have available to me is MS Sql Server and it is on a windows platform. Despite this I'm looking to leverage Ruby to write the script, specifically JRuby. There are a couple of reasons for this I would like to leverage Prawn to create pdfs ...

This is how I installed JRuby on Windows -> Why did it not work?

* Download JRuby 1.20. (zip file) * Extract the zip into C:\JRuby120 * Edit sytem "environment variables": * Add JRUBY_HOME -> point it to C:\JRuby120 * Modify the PATH environment variable to point to C:\JRuby120\bin; After all this, I open up cmd.exe and type jruby ->"The system cannot find the path specified" What did I do wrong? ...