I have a rails app that is communicating with some java services over JMS. I'm caching a few of these objects in memcached on the rails side like so:
@my_objects = MEMCACHE["some_key"] || @service.retrieve_objects
MEMCACHE.set("some_key",@my_objects) if MEMCACHE["some_key"].nil?
where MEMCACHE is
MEMCACHE = MemCache.new(['localhost'...
I have a jruby rails app with a ruby module in lib that is name-spacing my java objects so I don't have conflicts.
I'm wondering what the difference is between including the specific classes in that module and including the package. I've included the sample code below.
In the console, for example 1 when I say MyMod:: and hit tab, it h...
Having been landed with a Ruby project, I have been sceptical about the decision to use Ruby due to performance.
I was excited to discover JRuby with its Java integration. This has made the project massively easier for me. And now I have just been totally tickled even more to discover that JRuby can be compiled down to Java bytecode .
...
I'm trying to write a jruby script that connects to an oracle database using jdbc.
Thusfar I've got:
require 'rubygems'
require 'jdbc_adapter'
require 'active_record'
require 'active_record/version'
ActiveRecord::Base.establish_connection(
:adapter => 'jdbc',
:driver => 'oracle.jdbc.driver.OracleDriver',
:url => 'jdbc:oracle...
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 -alias pongus -keystore keystore -file certfile.cer
To create the certificate whic...
I am trying to deploy a Jruby app on Heroku. Unfortunately, when I try to install gem for Heroku using jruby, I get following error:
/proj/jruby-1.3.1/lib/ruby/1.8/mkmf.rb:7: JRuby does not support native extensions. Check wiki.jruby.org for alternatives. (NotImplementedError)
from /proj/jruby-1.3.1/lib/ruby/1.8/mkmf.rb:1:in `requir...
Hi.
I have Jruby gem Mysql installed on my machine. However due to some reason, I had to move to ruby instead of ruby and everything seems to be working fine except that mysql gem for ruby isn't installed and now when I try to install Mysql gem i get following error:
Building native extensions. This could take a while...
ERROR: Error...
We have a medium size Java application that needs some refactoring.
We are considering migrating towards JRuby on Rails. Mainly because of the productivity that Ruby on Rails offers and for the many existing plugins that will reimplement the web logic.
However a large part of the application should stay in Java, we do not want to rewri...
I'm thinking of refactoring a somewhat large Java based application. There are some parts of it that should be able to run at a pretty decent speed, so I thought about keeping those in pure Java ... and the rest in JRuby.
Do you think it would be worth doing this "refactoring"?
...
Hi there,
I'm planning to perhaps purchase an android phone, and would love to be able to script some simple apps in Ruby on it. I found this article from back in August where the author was able to get the scripts working, but since I'm not a Java head, I had a hard time understanding all the steps.
http://amazing-development.com/arch...
I've attached an image of what JRuby.jar contains:
http://www.freeimagehosting.net/uploads/fbfd966375.png
The problem is that even for simple scripts, the resulting jars have about 8mb. Can you tell me which folders I could remove from there, and still have it running ... or what's the purpose of some of that folders?
...
I'm having trouble making assert_raise recognize java exceptions.
I can do
assert_raise(NativeException) { @iter.next }
which works fine, but if I try to get more specific
java_import 'java.util.NoSuchElementException'
#...
assert_raise(NoSuchElementException) { @iter.next }
I get the error
Should expect a class of exception, Ja...
So given the following java class:
class Outer
{
private int x;
public Outer(int x) { this.x = x; }
public class Inner
{
private int y;
public Inner(int y) { this.y = y; }
public int sum() { return x + y; }
}
}
I can create an instance of the inner class from Java in the following manner:
Outer o = new Outer(1);...
I have to wait quite long time (comparing to my friends machines) for executing scripts on jRuby, especially when I'm running rake tasks or tests. I've tried jRuby version 1.3.1 and 1.4.1 with and without ruby-debug gem and the same problem occurred in each configuration.
The question is simple:
Is there any way to improve jRuby load p...
We have a j2ee/spring/hibernate/tomcat web application already running on production. We are planning to integrate with a 3rd party service(recurly) which provides a ruby client lib. They don't have a java client lib yet. Their service is RESTful and their client is a thin custom wrapper over ActiveResource. I can think of a few ways to ...
I use Swing from JRuby and I am trying to set up a JTable with a TableModel as input.
table_headers looks something like this: ["bla", "narf", "poit"]
table_data looks something like this: [["one", "two"], ["test, test"], ["hello", "world"]]
my_model = javax.swing.table.DefaultTableModel.new(table_data,table_headers)
results in
...
Running the command jruby -S spec gives the following error
No such file, directory, or command -- spec
The location of spec is /usr/bin, which is in the path. Rspec is installed. MRI Ruby can find the script. JRuby can find the rspec gem. So what goes wrong?
...
Similar to this question, except in JRuby (it works in MRI Ruby). Alt-left prints a "b" in my console. Very annoying!
To clarify, I've setup my terminal as described in this article, mapping option-left to escape-b.
...
I am using JRuby along with Cucumber and is looking for a way of running
jruby -S gem update --system
jruby -S gem install cucumber
from within the Java ScriptEngine. No amount of Googling have let me to a solution to this problem. Basically I want to be able to do something like this
ScriptEngineManager manager = new ScriptEngin...
I'm developing a project and I have a problem about this subject.
I'm constructing ruby on rails project which will provide listing students with name.
First of all , I will list my students information in a table and one part is missing.
When the user clicks on Student Name , another table will appear and show the other information o...