jruby

How do I use JRUBY_OPTS with RVM?

戏子无情 提交于 2019-11-30 02:20:53
It seems that the idiomatic way to provide flags to JRuby in an RVM-based Rails project is to set the environmental variable JRUBY_OPTS or PROJECT_JRUBY_OPTS, the latter perhaps being done automatically, since I see I can uncomment this line from my project directory's .rvmrc : PROJECT_JRUBY_OPTS=( --1.9 ) However, that line seems to do nothing, and if I set the environmental variables, RVM actually unsets them. So, how am I supposed to do this? (Note that I have this at the bottom of my .bashrc file, which is how I believe I'm supposed to use rvm:) [[ -s "$HOME/.rvm/scripts/rvm" ]] && . "

What's the best way to deploy a JRuby on Rails application to Tomcat?

血红的双手。 提交于 2019-11-29 23:21:32
I'm looking at ways to deploy a Ruby on Rails app (running on JRuby) to a Tomcat instance for testing. The tomcat instance is running on a Solaris server that I can SSH to. I've looked at using Capistrano, but there doesn't seem to be a lot out there about using it to deploy to Tomcat, or even about running it under JRuby, and I keep hitting bugs in Capistrano due to the Windows/JRuby environment my PC is running (yeah, it's corporate - not my choice, but I've got to live with it). I'm using warble to build the .war file, and the app deploys and runs fine once I manually copy it up and deploy

NoMethodError: relative_url_root when deploying rails app on tomcat

試著忘記壹切 提交于 2019-11-29 23:00:37
问题 I tried to follow this tutorial to deploy my jruby app on tomcat, but yet it always ends with: --- Backtrace NoMethodError: undefined method `relative_url_root=' for ActionController::Base:Class send at org/jruby/RubyKernel.java:2097 Tried either with tomcat 6 and 7. My jruby version is 1.6.5 and I use Rails 3.1 (too fresh perhaps ?) Thanks for any help 回答1: We had the same problem, and it was tracked down to the new version jruby-rack (1.1.1 IIRC). We downgraded to 1.0.10 and the problem

How to call Java API from Ruby 1.8 or 1.9

不羁的心 提交于 2019-11-29 15:31:48
I've this JRuby working code (stolen from Keith's Blog ), which wraps the SAXON xslt processor API. Now, I wonder whether I can and how can I wrap the same API in Ruby framework? Please tell me if this question is non-sense or if it can be improved in some way. This is the java doc reference for the wanted API . And this is the JRuby code I'm using: require 'java' module JXslt include_class "javax.xml.transform.TransformerFactory" include_class "javax.xml.transform.Transformer" include_class "javax.xml.transform.stream.StreamSource" include_class "javax.xml.transform.stream.StreamResult"

How to run Ruby 2.0 with JRuby 1.7?

不羁岁月 提交于 2019-11-29 05:11:01
问题 What is the best way to get JRuby to run in 2.0 mode? 回答1: For a specific script, you can use the --2.0 option: jruby --2.0 -S rails s For setting 2.0 as the default value, set JRUBY_OPTS : export JRUBY_OPTS=--2.0 You can also set the value in ~/.jrubyrc : compat.version=2.0 来源: https://stackoverflow.com/questions/15281036/how-to-run-ruby-2-0-with-jruby-1-7

Unable to install rails with jRuby

你离开我真会死。 提交于 2019-11-29 04:29:41
I am trying to install the rails with jRuby with the following command jruby -S gem install rails -v 3.0.6 But stuck with the error : JRuby limited openssl loaded. http://jruby.org/openssl gem install jruby-openssl for full support. System.java:-2:in `arraycopy': java.lang.ArrayIndexOutOfBoundsException from DefaultResolver.java:111:in `makeTime' from DefaultResolver.java:277:in `create' from DefaultResolver.java:317:in `handleScalar' from DefaultResolver.java:435:in `orgHandler' from DefaultResolver.java:455:in `node_import' from org/yecht/ruby/DefaultResolver$s_method_1_0$RUBYINVOKER$node

How to profile JRuby code?

ぃ、小莉子 提交于 2019-11-29 02:57:18
问题 I'd like to profile my JRuby app. For MRI I always use ruby-prof, but I don't think this works on JRuby. I don't want to use a Java-profiler, because it won't give me the ruby line numbers. Is there a jruby-prof? 回答1: JRuby 1.5.5 includes a decent --profile command line flag. Use it like this: jruby --profile -S <script> <args> 回答2: Check out Daniel Lucraft's new jruby-prof 回答3: http://www.ruby-forum.com/topic/166247#734017 回答4: We have never received a request for line numbers because that

Compile jruby “Hello world” problem

人盡茶涼 提交于 2019-11-29 01:11:21
问题 I have been programming for a while with Ruby and I really enjoy it. Lately I started having the need of compiling some ruby code. For several reasons using Ruby2exe is not an option for me. So I decided to give Jruby a try (generating a jar would be good enough). I am using windows and I installed java JDK 6u17 (at C:\Program Files\Java\jdk1.6.0_17). I installed jruby 1.4 at C:\jruby I created a hello world in java, compile and executed it just fine (so java works fine). I created a file

Can I program for android using any JVM language?

送分小仙女□ 提交于 2019-11-29 01:06:12
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. Check out these links: Scala 2.8 on Android Android examples in Scala Clojure on Android Ruboto - An IRB application for JRuby on Android Android Scripting (Python, Perl, JRuby, Lua, BeanShell, JavaScript, Tcl) However, I am unaware of any prominent applications that have been coded in any of these languages. The examples I've seen fall more into the "proof of concept"

How do I use JRUBY_OPTS with RVM?

最后都变了- 提交于 2019-11-28 23:12:19
问题 It seems that the idiomatic way to provide flags to JRuby in an RVM-based Rails project is to set the environmental variable JRUBY_OPTS or PROJECT_JRUBY_OPTS, the latter perhaps being done automatically, since I see I can uncomment this line from my project directory's .rvmrc : PROJECT_JRUBY_OPTS=( --1.9 ) However, that line seems to do nothing, and if I set the environmental variables, RVM actually unsets them. So, how am I supposed to do this? (Note that I have this at the bottom of my