Wednesday, November 30, 2011

script console for jruby rails

inside your rails root directory

<system java path>/java -client  -Xbootclasspath/a:<path to jruby jar>/jruby-complete-1.6.2.jar   -Djruby.shell=/bin/sh org.jruby.Main script/console

useful for investigating stuff on production boxes if jruby is not installed on commandline.

Jruby on Rails + Quartz + log4j

If you want your custom quartz.properties file to be picked up, please make sure you configure this in your web.xml or web.xml.erb
<servlet>
     <servlet-name>QuartzInitializer</servlet-name>
     <display-name> Quartz Initializer Servlet</display-name>
     <servlet-class>org.quartz.ee.servlet.QuartzInitializerServlet</servlet-class>
     <load-on-startup>1</load-on-startup>
     <init-param>
         <param-name>config-file</param-name>
         <param-value>WEB-INF/lib/quartz.properties</param-value>
     </init-param>
     <init-param>
         <param-name>shutdown-on-unload</param-name>
         <param-value>true</param-value>
     </init-param>
     <init-param>
         <param-name>start-scheduler-on-load</param-name>
         <param-value>true</param-value>
     </init-param>
 </servlet>


and you want  your log4j properties to be picked up
<context-param>
    <param-name>log4jConfigLocation</param-name>
    <param-value>WEB-INF/lib/frlog4j.properties</param-value>
  </context-param>
<listener>
        <listener-class>org.springframework.web.util.Log4jConfigListener</listener-class>
  </listener>