jruby

Unable to install rails with jRuby

蹲街弑〆低调 提交于 2019-12-18 04:15:28
问题 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

What exactly “config.assets.debug” setting does?

孤者浪人 提交于 2019-12-17 18:49:05
问题 I have started development of simple rails application. After several hours work I have notices that somehow the deleted css is still applied to the web pages. In order to fix the issue I executed the following actions several times: stop/start server use rails server use torquebox server delete browser cache but nothing changes. It was very strange - the new css definitions were applied, but those that I have deleted were still there. So, I gave up and decided to create new project. I have

Visit method not found in my rspec

旧时模样 提交于 2019-12-17 07:19:26
问题 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 world") end end And running: rspec I get: F Failures: 1) home should render the home page Failure/Error: visit "/" NoMethodError: undefined method `visit' for #<RSpec::Core::ExampleGroup::Nested_1:0x242870b7> # ./spec/home/home_spec.rb:7:in `(root)' Finished in 0.012

consuming gems from jruby-complete

牧云@^-^@ 提交于 2019-12-14 00:58:27
问题 I can make my jruby-complete consume gems from a jar passed to it. But I'd like to use a central gem repo. This is what I can do now: $ java -jar jruby-complete-1.6.5.jar -S gem list *** LOCAL GEMS *** rake (0.8.7) sources (0.0.1) $ java -jar jruby-complete-1.6.5.jar -rjar_of_gems.jar -S gem list *** LOCAL GEMS *** erubis (2.7.0) mizuno (0.4.1) rack (1.4.0) rack-protection (1.2.0) rake (0.8.7) rna (0.0.101) sinatra (1.3.2) sources (0.0.1) tilt (1.3.3) Having to change the jar file everytime I

truncate line before and after cariage return (\r) or new line (\n) with ellipses

﹥>﹥吖頭↗ 提交于 2019-12-13 21:24:53
问题 I have this paragraph (may be I have more than one paragraph) => "On the server side,\n\nmy EJB3 application uses Spring for configuring all sorts of things. So,\n\nmy EJBs all look up various ApplicationContexts and use them as a sort of\r\nwell, I was going to say poor man's JNDI, but the reality is that JNDI in the J2EE environment is really a poor man's Spring. :-)\n\nOn the GUI side,\n\nI use it instead of resource injection to get access to my EJBs.\n\nThat lets me test the GUI

Unable to access jar dependencies from JRuby gem

拈花ヽ惹草 提交于 2019-12-13 18:43:18
问题 I have created a gem on my local system for text mining which relies on external Java libraries for classification tasks. I'm trying to harness the power of Java through JRuby here. Directory structure is as follows: - classifier/ * classifier.gemspec * Gemfile * Gemfile.lock * lib/ * classifier/ * version.rb * sample_classifier.rb * classifier.rb * java/ * sample_lib.jar * another_sample_lib.jar * yet_another_sample_lib.jar * Rakefile I'm loading these jars in lib/classifier.rb as Dir["java/

Faye in jruby on rails

让人想犯罪 __ 提交于 2019-12-13 16:55:33
问题 I have searched A LOT and couldn't find any resource that says I can use Faye with jruby. I have found this one that says that it doen't play well with jruby but it's really really old. Also I have found this that looks like they have implemented a Java native extension in order to support jruby?? Does anyone know if I can use it in a Jruby on rails project? Thanks! 回答1: From the creator of Faye: Yes, the server runs on JRuby. The client uses either WebSocket, EventSource, XMLHttpRequest,

Parse XML with JRuby (Hpricot?) with tags like <foo.bar>

我怕爱的太早我们不能终老 提交于 2019-12-13 15:11:29
问题 I'm trying to consume some legacy XML with elements like this in JRuby: <x-doc attr="value"> <nested> <with.dot>content</with.dot > </nested> </x-doc> I've been working with Hpricot, but Hpricot's HTML-oriented shortcuts are working against me: doc.search("//with.dot") seems to be looking for <with class="dot" /> (I ran into this problem with JQuery too, a few years ago.) Can I do this with Hpricot, or do I need to use a different library? 回答1: Check out nokogiri. It's said to be "A Faster,

Creating rails model with Object.const_set

烈酒焚心 提交于 2019-12-13 13:15:29
问题 I am playing around in the rails console with Neo4j and tried to create a model class like this: Object.const_set("TestNode", Class.new(super_class=Neo4j::Rails::Model)) node = TestNode.new if i then try to save the instance with node.save I get a bunch of errors: node.save NoMethodError: undefined method `each' for nil:NilClass from /Users/oskbor/.rvm/gems/jruby-1.6.7.2/gems/neo4j-2.0.0-java/lib/neo4j/rails/attributes.rb:57:in `init_on_create' from /Users/oskbor/.rvm/gems/jruby-1.6.7.2/gems

Failed to deploy Rails app to WebLogic

与世无争的帅哥 提交于 2019-12-13 06:24:32
问题 I'm trying to deploy very simple Rails application to Oracle WebLogic server. It's just a default application created by a command like " jruby -S rails new myapp ". It works fine if I run a development server (" jruby -S rails server "). But when I deploy it to WebLogic, I receive an exception: org.jruby.rack.RackInitializationException: no method 'getInstance' for arguments (org.joda.time.tz.CachedDateTimeZone) on Java::OrgJodaTimeChrono::GJChronology My environment: OS: Windows 8.1 Java: