Search Results

Search found 12 results on 1 pages for 'jrubyonrails'.

Page 1/1 | 1 

  • AppEngine JRuby - OutOfMemoryError: Java heap space - can it be solved?

    - by elado
    I use AppEngine JRuby on Rails (SDK version 1.3.3.1) - a problem I encounter often is that after a few requests the server is getting really SLOW, until it dies and throws OutOfMemoryError on the terminal (OSX). The requests themselves are very lightweight, not more than looking for an entity or saving it, using DataMapper. On appspot, this problem is not happening. Is there any way to enlarge the heap space for JRuby? The exception log: Exception in thread "Timer-2" java.lang.OutOfMemoryError: Java heap space Apr 29, 2010 8:08:22 AM com.google.apphosting.utils.jetty.JettyLogger warn WARNING: Error for /users/close_users java.lang.OutOfMemoryError: Java heap space at org.jruby.RubyHash.internalPut(RubyHash.java:480) at org.jruby.RubyHash.internalPut(RubyHash.java:461) at org.jruby.RubyHash.fastASet(RubyHash.java:837) at org.jruby.RubyArray.makeHash(RubyArray.java:2998) at org.jruby.RubyArray.makeHash(RubyArray.java:2992) at org.jruby.RubyArray.op_diff(RubyArray.java:3103) at org.jruby.RubyArray$i_method_1_0$RUBYINVOKER$op_diff.call(org/jruby/RubyArray$i_method_1_0$RUBYINVOKER$op_diff.gen) at org.jruby.runtime.callsite.CachingCallSite.call(CachingCallSite.java:146) at org.jruby.ast.CallOneArgNode.interpret(CallOneArgNode.java:57) at org.jruby.ast.LocalAsgnNode.interpret(LocalAsgnNode.java:123) at org.jruby.ast.NewlineNode.interpret(NewlineNode.java:104) at org.jruby.ast.BlockNode.interpret(BlockNode.java:71) at org.jruby.runtime.InterpretedBlock.evalBlockBody(InterpretedBlock.java:373) at org.jruby.runtime.InterpretedBlock.yield(InterpretedBlock.java:346) at org.jruby.runtime.InterpretedBlock.yield(InterpretedBlock.java:303) at org.jruby.runtime.Block.yield(Block.java:194) at org.jruby.RubyArray.collect(RubyArray.java:2354) at org.jruby.RubyArray$i_method_0_0$RUBYFRAMEDINVOKER$collect.call(org/jruby/RubyArray$i_method_0_0$RUBYFRAMEDINVOKER$collect.gen) at org.jruby.runtime.callsite.CachingCallSite.callBlock(CachingCallSite.java:115) at org.jruby.runtime.callsite.CachingCallSite.call(CachingCallSite.java:122) at org.jruby.ast.CallNoArgBlockNode.interpret(CallNoArgBlockNode.java:64) at org.jruby.ast.CallNoArgNode.interpret(CallNoArgNode.java:61) at org.jruby.ast.LocalAsgnNode.interpret(LocalAsgnNode.java:123) at org.jruby.ast.NewlineNode.interpret(NewlineNode.java:104) at org.jruby.ast.BlockNode.interpret(BlockNode.java:71) at org.jruby.ast.EnsureNode.interpret(EnsureNode.java:98) at org.jruby.ast.BeginNode.interpret(BeginNode.java:83) at org.jruby.ast.NewlineNode.interpret(NewlineNode.java:104) at org.jruby.ast.BlockNode.interpret(BlockNode.java:71) at org.jruby.ast.EnsureNode.interpret(EnsureNode.java:96) at org.jruby.internal.runtime.methods.InterpretedMethod.call(InterpretedMethod.java:201) at org.jruby.internal.runtime.methods.DefaultMethod.call(DefaultMethod.java:183)

    Read the article

  • Rails deployment strategies with Bundler and JRuby

    - by brad
    I have a jruby rails app and I've just started using bundler for gem dependency management. I'm interested in hearing peoples' opinions on deployment strategies. The docs say that bundle package will package your gems locally so you don't have to fetch them on the server (and I believe warbler does this by default), but I personally think (for us) this is not the way to go as our deployed code (in our case a WAR file) becomes much larger. My preference would be to mimic our MVN setup which fetches all dependencies directly on the server AFTER the code has been copied there. Here's what I'm thinking, all comments are appreciated: Step1: Build war file, copy to server Step2: Unpack war on server, fetch java dependencies with mvn Step3: use Bundler to fetch Gem deps (Where should these be placed??) * Step 3 is the step I'm a bit unclear on. Do I run bundle install with a particular target in mind?? Step4: Restart Tomcat Again my reasoning here is that I'd like to keep the dependencies separate from the code at deploy time. I'd also like to place all gem dependencies in the app itself so they are contained, rather than installing them in the app user's home directory (as, again, I believe is the default for Bundler)

    Read the article

  • Why does jruby complain about valid java_opts

    - by brad
    I have set my java min/max heap size to be the same as outlined in the Sun Docs for precise heap sizing using the following: -Xms768m -Xmx768m This works fine when I start tomcat, but if I run jruby from the command line it complains saying: Error occurred during initialization of VM Incompatible minimum and maximum heap sizes specified I read in the jruby docs about some -J-X params but it seems silly that I would need to explicitly override my normal jvm settings. The problem arises when I do a deploy. I try running jruby -S rake db:migrate on my server and it complains. Is it true that I need to explicitly override my JVM settings when running jruby? It seems as though ANY Xms/Xmx values cause jruby to complain. Update So it seems that some settings do in fact work. For instance all of these work: Xmx256m Xms256m Xmx512m Xms256m Xmx512m Xms500m But these don't: Xmx512m Xms512m Xmx512m Xms501m Xmx768m Xms512m

    Read the article

  • Lazy loading of ESB in a jruby rails app

    - by brad
    I have a jruby/rails app using: jruby 1.4.0 Rails 2.3.5 ActiveMQ 5.3.0 Mule ESB 2.2.1 Currently in our environment.rb file we start up Mule in the initializer. This becomes a big pain when we go to do normal rake tasks that don't require JMS/Mule such as db:migrate as it takes a long time to startup/shutdown Mule everytime. The code is similar to this: APP_CONTEXT = Java::our.company.package.service_clients.Initializer.getAppContext(MULE_CONFIG_PATH) And we use APP_CONTEXT to fetch the bean to connect to the appropriate service. I'm trying to figure out some mechanism by which APP_CONTEXT could be lazily instantiated (not in initialize) to avoid all of the pains of having to startup Mule on initialize. Currently we have a few ruby client classes that are instantiated as a before_filter in application_controller such as @data_service = DataService.new(APP_CONTEXT) that initialize the proper java client for each request for use in our controllers. I'm open to all suggestions. I'm having a hard time trying to find the right place to put this lazy instantiation.

    Read the article

  • Logging with log4j on tomcat jruby-rack for a Rails 3 application

    - by John
    I just spent the better part of 3 hours trying to get my Rails application logging with Log4j. I've finally got it working, but I'm not sure if what I did is correct. I tried various methods to no avail until my various last attempt. So I'm really looking for some validation here, perhaps some pointers and tips as well -- anything would be appreciated to be honest. I've summarized all my feeble methods into three attempts below. I'm hoping for some enlightenment on where I went wrong with each attempt -- even if it means I get ripped up. Thanks for the help in advance! System Specs Rails 3.0 Windows Server 2008 Log4j 1.2 Tomact 6.0.29 Java 6 Attempt 1 - Configured Tomcat to Use Log4J I basically followed the guide on the Apache Tomcat website here. The steps are: Create a log4j.properties file in $CATALINA_HOME/lib Download and copy the log4j-x.y.z.jar into $CATALINA_HOME/lib Replace $CATALINA_HOME/bin/tomcat-juli.jar with the tomcat-juli.jar from the Apache Tomcat Extras folder Copy tomcat-juli-adapters.jar from the Apache Tomcat Extras folder into $CATALINA_HOME/lib Delete $CATALINA_BASE/conf/logging.properties Start Tomcat (as a service) Expected Results According to the Guide I should have seen a tomcat.log file in my $CATALINA_BASE/logs folder. Actual Results No tomcat.log Saw three of the standard logs instead jakarta_service_20101231.log stderr_20101231.log stdout_20101231.log Question Shouldn't I have at least seen a tomcat.log file? Attempt 2 - Use default Tomcat logging (commons-logging) Reverted all the changes from the previous setup Modified $CATALINA_BASE/conf/logging.properties by doing the following: Adding a setting for my application in the handlers line: 5rails3.org.apache.juli.FileHandler Adding Handler specific properties 5rails3.org.apache.juli.FileHandler.level = FINE 5rails3.org.apache.juli.FileHandler.directory = ${catalina.base}/logs 5rails3.org.apache.juli.FileHandler.prefix = rails3. Adding Facility specific properties org.apache.catalina.core.ContainerBase.[Catalina].[localhost].[/rails3].level = INFO org.apache.catalina.core.ContainerBase.[Catalina].[localhost].[/rails3].handlers = 4host-manager.org.apache.juli.FileHandler Modified my web.xml by adding the following context parameter as per the Logging section of the jruby-rack readme (I also modified my warbler.rb accordingly, but I did opted to change the web.xml directly to test things faster). <context-param> <param-name>jruby.rack.logging</param-name> <param-value>commons_logging</param-value> </context-param> Restarted Tomcat Results A log file was created (rails3.log), however there was no log information in the file. Attempt 2A - Use Log4j with existing set up I decided to go Log4j another whirl with this new web.xml setting. Copied the log4j.jar into my WEB-INF/lib folder Created a log4j.properties file and put it into WEB-INF/classes log4j.rootLogger=INFO, R log4j.logger.javax.servlet=DEBUG log4j.appender.R=org.apache.log4j.RollingFileAppender log4j.appender.R.File=${catalina.base}/logs/rails3.log log4j.appender.R.MaxFileSize=5036KB log4j.appender.R.MaxBackupIndex=4 log4j.appender.R.layout=org.apache.log4j.PatternLayout log4j.appender.R.layout.ConversionPattern=%d{dd MMM yyyy HH:mm:ss} [%t] %-5p %c %x - %m%n Restarted Tomcat Results Same as Attempt 2 NOTE: I used log4j.logger.javax.servlet=DEBUG because I read in the jruby-rack README that all logging output is automatically redirected to the javax.servlet.ServletContext#log method. So I though this would capture it. I was obviously wrong. Question Why didn't this work? Isn't Log4J using the commons_logging API? Attempt 3 - Tried out slf4j (WORKED) A bit uncertain as to why Attempt 2A didn't work, I thought to myself, maybe I can't use commons_logging for the jruby.rack.logging parameter because it's probably not using commons_logging API... (but I was still not sure). I saw slf4j as an option. I have never heard of it and by stroke of luck, I decided to look up what it is. After reading briefly about what it does, I thought it was good of a shot as any and decided to try it out following the instructions here. Continuing from the setup of Attempt 2A: Copied slf4j-api-1.6.1.jar and slf4j-simple-1.6.1.jar into my WEB-INF/lib folder I also copied slf4j-log4j12-1.6.1.jar into my WEB-INF/lib folder Restarted Tomcat And VIOLA! I now have logging information going into my rails3.log file. So the big question is: WTF? Even though logging seems to be working now, I'm really not sure if I did this right. So like I said earlier, I'm really looking for some validation more or less. I'd also appreciate any pointers/tips/advice if you have any. Thanks!

    Read the article

  • pickle on jruby

    - by brad
    Does anyone know if pickle is compatible with jruby? I just installed cucumber and cucumber-rails. I then tried gem install pickle and it installs, but a script/generate pickle yields Couldn't find 'pickle' generator I did everything according to the readme no dice. Anyone have any experience with this: specs jruby-1.4.0 rails-2.3.5 cucumber 0.7.2 pickle 0.2.10

    Read the article

  • Cucumber-rails on jruby installs gem into my apps root directory with bundler

    - by brad
    Just installed cucumber 0.7.2 and cucumber-rails 0.3.1 with jruby-1.4.0 on OSX. When I run a bundle install, it places a cucumber-rails directory in my main app with all of the gem code/dependencies. First off, this is definitely not what I want and I'm not sure why this happens for cucumber-rails only. Second, if I delete this folder and just manually install cucumber-rails, when I run script/generate feature blah I get /Users/bradrobertson/.rvm/rubies/jruby-1.4.0/lib/ruby/site_ruby/1.8/rubygems/source_index.rb:344:in `refresh!': source index not created from disk (RuntimeError) from /Users/bradrobertson/.rvm/gems/jruby-1.4.0/gems/rails-2.3.5/lib/rails/vendor_gem_source_index.rb:34:in `refresh!' from /Users/bradrobertson/.rvm/gems/jruby-1.4.0/gems/rails-2.3.5/lib/rails/vendor_gem_source_index.rb:29:in `initialize' from /Users/bradrobertson/.rvm/gems/jruby-1.4.0/gems/rails-2.3.5/lib/rails/gem_dependency.rb:21:in `new' from /Users/bradrobertson/.rvm/gems/jruby-1.4.0/gems/rails-2.3.5/lib/rails/gem_dependency.rb:21:in `add_frozen_gem_path' from /Users/bradrobertson/.rvm/gems/jruby-1.4.0/gems/rails-2.3.5/lib/initializer.rb:298:in `add_gem_load_paths' from /Users/bradrobertson/.rvm/gems/jruby-1.4.0/gems/rails-2.3.5/lib/initializer.rb:132:in `process' from /Users/bradrobertson/.rvm/gems/jruby-1.4.0/gems/rails-2.3.5/lib/initializer.rb:113:in `run' from /Users/bradrobertson/Repos/app/source/trunk/config/environment.rb:13 from /Users/bradrobertson/Repos/app/source/trunk/config/environment.rb:1:in `require' from /Users/bradrobertson/.rvm/gems/jruby-1.4.0/gems/rails-2.3.5/lib/commands/generate.rb:1 from /Users/bradrobertson/.rvm/gems/jruby-1.4.0/gems/rails-2.3.5/lib/commands/generate.rb:3:in `require' from script/generate:3 Similarly running rake cucumber I get rake aborted! source index not created from disk So something obviously doesn't work. If I add that cucumber-rails directory back in, then my rake cucumber actually runs. Can someone tell me why it would need to install the gem right in my rails app? I've never seen this before. setup jruby-1.4.0 cucumber-0.7.2 cucumber-rails 0.3.1 bundler 0.9.23 webrat 0.7.1

    Read the article

  • JRuby 1.7.0 will not install bundler given plenty of memory

    - by user678615
    I installed jruby with rvm install jruby-1.7.0 and it ran out of memory when it tried to create the gemsets so I started by trying to install bundler with the new version and this is what I get ~>gem install bundler Error: Your application used more stack memory than the safety cap of 2048K. Specify -J-Xss####k to increase it (#### = cap size in KB). Specify -w for full StackOverflowError stack trace So I moved up the memory and I still got nothing with a huge chunk of memory ~>JRUBY_OPTS=-J-Xss1024m gem install bundler Error: Your application used more stack memory than the safety cap of 1024M. Specify -J-Xss####k to increase it (#### = cap size in KB). Specify -w for full StackOverflowError stack trace How the hell can that not be enough I run applications on less than that

    Read the article

  • How do you unpack gems using jruby on rails 2.3?

    - by James Moore
    I'm trying to unpack all the system gems to end up with a standalone Rails directory including all the rails gems and all the system gems. I'm starting with a bare rails setup; just did a jruby -S rails and a 'generate jdbc'. I then add a config.gem 'jdbc-mysql' to environment.rb and do the jruby -S rake gems:unpack:dependencies. After unpacking, if I do a rake I get: no such file to load -- jdbc-mysql Is there something else you need to do to get the jdbc gem unpacked? I'm using jruby 1.4.0 (and moving to 1.5 is on my todo list) and rails 2.3.8.

    Read the article

  • How do I enable automatic reloading of view files in development mode in JRuby on Rails?

    - by thekingoftruth
    I am developing an app in JRuby on Rails. For some reason, when I edit the view files, the development JRuby Mongrel server doesn't reload them. The perplexing thing is that after editing the controller files, the server reloads them just fine on the next request. This would be annoying even when using MRI Ruby, however starting up JRuby Mongrel after every view edit is much slower, and much more annoying. (Note that once it starts up it's quite fast, the only issue is startup--the JVM has to load up every time I start JRuby Mongrel.) I'm running JRuby 1.5.0, Rails 2.3.5, and Java 6.

    Read the article

  • jruby/activerecord-jdbc/tomcat/DB2 ready for enterprise?

    - by arkadiy
    I am trying to introduce RoR to my company and I have two ways of doing so in my mind: (1) rails/ibm_db2/passenger/DB2 - which is my preferable way but it is not really supported by company's infrastructure. (2) jruby/activerecord-jdbc/tomcat/DB2 - probably easier way to migrate relying on current infrastructure and java libs IF I have a proof this is an enterprise ready technology. Does anyone know if there is any prof that jruby/aciverecord-jdbc-adapter/DB2/tomcat is mature enough for production? Are there any problems I should know about during Development/Deployment/Runtime? My webapp is for a company intranet, around 200~400 active users.

    Read the article

1