jrubyonrails

Why does heap space constantly increase when monitoring Tomcat with Java VisualVM?

断了今生、忘了曾经 提交于 2019-12-12 13:24:14
问题 I have a JRubyOnRails application running in Tomcat. After browsing to my application (localhost), logging in and then doing nothing, the Heap space seems to be growing continuously... Is that normal? If I press on Perform GC, it does go down again. I'm wondering what will happen if I just leave it until it reaches the maximum of my Computer RAM? And why is it increasing all the time while nothing happens? Is it due to the fact that I'm monitoring my application? 来源: https://stackoverflow.com

Ruby 'gem tzinfo'

不羁岁月 提交于 2019-12-12 02:29:33
问题 From my previous question about timezones, I decided to use the Ruby gem tzinfo to get access to time zone data. This means storing scheduled times as a timezone name (e.g. "America/Toronto"), and then using the Ruby tzinfo gem and tzinfo database to look up the correct UTC time from a desired local time. My understanding is that the database of time zones changes from time to time because different jurisdictions call for different policies on the (non)application of Daylight Savings Time.

How do Rails and Jruby relate?

故事扮演 提交于 2019-12-12 02:24:17
问题 Background: I have a java library that is accessed by many developers - usually via java. However, a few devs hope to access this via a Ruby API. I am gravitating in the direction of Jruby in order to implement a Java-Ruby API. Questions: My main concern is that these developers will not be able to utilize the API in their current, Ruby on Rails development framework; but instead will have to operate within Jruby's rails environment. Is this going to be the case? Perhaps I'm missing a

Error while loading java Class in Jruby application

…衆ロ難τιáo~ 提交于 2019-12-12 01:37:53
问题 I have deployed my Ruby on Rails Application on Torquebox. After starting server I am getting this error 10:18:06,311 ERROR [org.torquebox.core.runtime] (Thread-95) Error during execution: ENV['RAILS_ROOT']=RACK_ROOT ENV['RAILS_ENV']=RACK_ENV require %q(org/torquebox/web/rails/boot) : org.jruby.exceptions.RaiseException: (NameError) cannot load Java class sun.security.tools.KeyTool at org.jruby.javasupport.JavaClass.for_name(org/jruby/javasupport/JavaClass.java:1205) [jruby.jar:] at org.jruby

JRuby on Rails app on and JBoss 4.2.0/Tomcat 5.5

醉酒当歌 提交于 2019-12-11 22:05:49
问题 My JRuby on rails app works fine on Tomcat 6.0, But when I deploy it on my company's webfarm which is JBoss 4.2.0/Tomcat 5.5 (Servlet API 2.4) It fails with the following stack trace: java.lang.ArrayIndexOutOfBoundsException: 0 at com.kenai.jaffl.provider.jffi.AsmLibraryLoader.generateBufferInvocation(AsmLibraryLoader.java:548) at com.kenai.jaffl.provider.jffi.AsmLibraryLoader.generateMethod(AsmLibraryLoader.java:511) at com.kenai.jaffl.provider.jffi.AsmLibraryLoader.generateInterfaceImpl

Gotchas for deploying jRuby on Rails 3.2 on Tomcat7 packaged with Warbler

社会主义新天地 提交于 2019-12-11 21:08:49
问题 I'm experiencing some weird behaviours trying to deploying a jRuby on Rails (3.2) app on Tomcat7 using Warbler ( warble executable war ). And wanted to find out if they are normal or am I just doing some newbie mistake. The app deploys fine when the WAR file is exploded, but there are loading issues when trying to deploy from just the WAR file. What type of "typical" newbie mistakes generally causes this? Running java -jar app.war -S rake -T is incredibly slow on Windows (~1min30sec-2min30sec

jRuby/Ruby on rails database relations and data retrieve

时光毁灭记忆、已成空白 提交于 2019-12-11 13:55:58
问题 This question links to my earliest Question here. I have a model "User" and scaffold "ContactDetail" which relate to each other as below. Each User has_many ContactDetail ContactDetail belongs_to User My Question How can I load all the contact details to my html upon successful login? If user is a new user and has no contact details so far, I want to show contact_details' new.html.erb inside my html. Can I do that? This is what I tried so far In my login sessioncontroller.rb I create

Compile all .rb files of a Ruby on Rails app to .class using JRuby, pack it into a .war and deploy into a Java appserver

最后都变了- 提交于 2019-12-11 07:43:12
问题 Is it possible to compile all .rb source files files (including the configuration source file files) of Ruby on Rails to .class files using JRuby, pack it into a .war file and deploy to JBoss or another Java appserver? 回答1: Check out warbler for this purpose. From the main page: Warbler is a gem that makes a .war file out of a Rails, Merb, or Rack-based application. The intent is to provide a minimal, flexible, ruby-like way to bundle all your application files for deployment to a Java

Rails 3 route problem

放肆的年华 提交于 2019-12-11 07:08:18
问题 After solving the other problem with routes , now I have another one. I have this route in my routes.rb: match "user/create_new_password/:reset_password_key" =>"users#create_new_password", :via=>[:post, :get], :as=>:create_new_password I can test it in my functional tests like this: test "should create new password " do post :create_new_password, {:user=>{:password=>"123456", :password_confirmation=>"123456"}, :reset_password_key=>user.reset_password_key} end In my view, I have the following

Using threadsafe initialization in a JRuby gem

|▌冷眼眸甩不掉的悲伤 提交于 2019-12-11 06:55:38
问题 Wanting to be sure we're using the correct synchronization (and no more than necessary) when writing threadsafe code in JRuby; specifically, in a Puma instantiated Rails app. UPDATE: Extensively re-edited this question, to be very clear and use latest code we are implementing. This code uses the atomic gem written by @headius (Charles Nutter) for JRuby, but not sure it is totally necessary, or in which ways it's necessary, for what we're trying to do here. Here's what we've got, is this