jrubyonrails

Very large retained heap size for org.jruby.RubyRegexp$RegexpCache in JRuby Rails App

不羁岁月 提交于 2020-01-25 18:55:54
问题 We have analysed a heap dump file for our application (running on Tomcat with jruby 1.7.8). It shows us that the retained heap size is very large (439,459,128) for the class org.jruby.RubyRegexp$RegexpCache. This is 48% of our memory usage Looking at the source code for that file it is 3 final static object created at startup (patternCache / quotedPatternCache / preprocessedPatternCache) This seems to be a pretty core part of JRuby. My question is, is it normal to have such a large percentage

Very large retained heap size for org.jruby.RubyRegexp$RegexpCache in JRuby Rails App

那年仲夏 提交于 2020-01-25 18:55:07
问题 We have analysed a heap dump file for our application (running on Tomcat with jruby 1.7.8). It shows us that the retained heap size is very large (439,459,128) for the class org.jruby.RubyRegexp$RegexpCache. This is 48% of our memory usage Looking at the source code for that file it is 3 final static object created at startup (patternCache / quotedPatternCache / preprocessedPatternCache) This seems to be a pretty core part of JRuby. My question is, is it normal to have such a large percentage

Question testing rails post

末鹿安然 提交于 2020-01-24 00:51:09
问题 Using Rails 3.0.3. I have the following route in routes.rb: match "user/create_new_password/:reset_password_key" =>"users#create_new_password", :via=>[:get, :post], :as=>:create_new_password When using this route in the view, with a form, it works ok, however I'm not able to test it. I'm doing this in my functional test: test "fail create password with invalid key" do post :create_new_password, {:create_new_password=>{:password=>"1", :password_confirmation=>"1"}, :reset_password_key=>"user

JRuby 1.6.3 and Rails 3.1rc5 and activerecord-3.1.0.rc5 and destroy_all

。_饼干妹妹 提交于 2020-01-06 03:03:22
问题 I am able to create able to run my migrations from JRuby 1.6.3 and Rails 3.1rc5 and in a console session create a simple Role object like this: jruby-1.6.3 :001 > role = Role.new(:name => "Admin") (1.0ms) SELECT name FROM sqlite_master WHERE type = 'table' AND NOT name = 'sqlite_sequence' => #<Role id: nil, name: "Admin", created_at: nil, updated_at: nil> All is good but when I run Role.destroy_all I get the following stack trace: jruby-1.6.3 :003 > Role.destroy_all ArgumentError: wrong

How do I run rake rake tasks in a rails app which is served by tomcat with jruby war deployment?

泄露秘密 提交于 2020-01-03 02:51:14
问题 I have a rails application deployed to tomcat, the code has been compiled to java classes and packed to a war file. And I'm wondering, is there a way for me to run rake tasks as I always did ? 回答1: I'd like a convenient way of doing this too, although I'm not sure it's possible. From the exploded (unzipped) WAR, you can get somewhere with this kind of thing: java -cp WEB-INF/lib/jruby-core-1.6.4.jar -S rake 回答2: java -jar WEB-INF/lib/jruby-core-1.6.4.jar -S rake This worked for me. Possibly

Failed to build gem native extension with JRuby

ⅰ亾dé卋堺 提交于 2019-12-30 07:39:08
问题 I change the ruby version from ruby 1.9.3-p125 to JRuby 1.7.0-preview1 with ruby-build. When I execute jruby -S bundle install on my project, there are some errors as below, ... Using bson (1.6.2) Installing bson_ext (1.6.2) with native extensions Gem::Installer::ExtensionBuildError: ERROR: Failed to build gem native extension. /Users/joshchang/.rbenv/versions/jruby-1.7.0-preview1/bin/jruby extconf.rb NotImplementedError: C extension support is not enabled. Pass -Xcext.enabled=true to JRuby

Access Models from OUTSIDE rails app

微笑、不失礼 提交于 2019-12-24 19:15:35
问题 I am writing a JRuby rails app that uses mysql-backed models. Now, I need to update the models from OUTSIDE the app (via EventMachine / similar), so that the Controllers etc IN the rails app can get access to the fresh data. So, is the Rails ORM available inside EventMachine? Will there be catastrophic consequences if I update the mysql tables from inside EventMachine (if the ORM is not available to me)? 回答1: You could always require 'config/environment.rb' , that'll give you access to all

bash aliases not recognized by a bash function: sunspot_rails, jruby, rspec

守給你的承諾、 提交于 2019-12-24 10:39:44
问题 Aliases below for running sunspot in the background work Aliases below for finding and killing those instances work ENV variables for the sunspot ports are accessible But, Functions for running sunspot, processing command, and killing sunspot only work after I source .bashrc outside of the function. $user_id is set before this sunspot_ports() gets called and prints properly when first logging in rebash is an alias for source ~.bashrc I have aliases for development and production as well -

Creating new rails project with jruby in 1.9 compatibility mode hangs when running bundle install

会有一股神秘感。 提交于 2019-12-23 20:11:15
问题 Anyone encountered this problem? I am able to create the project fine in 1.8 compatibility mode. Here is what I am using Mac OSX Lion JRuby 1.6.4 Java 1.6.0_31 rvm 1.8.1 I am running the following command JRUBY_OPTS=--1.9 rails new myapp This goes ahead and creates all the files required for the app and then hangs at the statement. run bundle install When I look at Activity Monitor the java process is using up most of the cpu. 回答1: Summarizing the answer from the comments in order to remove

rails nested form changes id to decimal

家住魔仙堡 提交于 2019-12-13 06:06:37
问题 Quick problem description The value of the id in a nested form is rendered as 10006.0 instead of 10006 (decimal/float instead of an integer) resulting in an ActiveRecord::RecordNotFound exception. What is causing this behaviour?? The code setup So I followed the rails-guides tutorial on how to build nested forms. My 2 models are: class Broker < ActiveRecord::Base has_many :execution_groups, dependent: :destroy accepts_nested_attributes_for :execution_groups, allow_destroy: true, reject_if: