Skip to content

Instantly share code, notes, and snippets.

@MarkMenard
MarkMenard / gist:5710668
Last active December 18, 2015 02:28
This Servelet listener is to work around https://github.com/jruby/jruby/issues/788 Written by bbrowning.
// Add this as a listener in your web.xml file prior to loading jruby-rack.
//
//
// <listener>
// <listener-class>lib.JnrConstantHackListener</listener-class>
// </listener>
// <listener>
// <listener-class>org.jruby.rack.rails.RailsServletContextListener</listener-class>
// </listener>
2013-06-04 19:54:29.161:/quadran:INFO: An exception happened during JRuby-Rack startup
load error: fast_xs -- java.lang.RuntimeException: callback-style handles are no longer supported in JRuby
--- System
jruby 1.7.4 (1.9.3p392) 2013-05-16 2390d3b on Java HotSpot(TM) 64-Bit Server VM 1.7.0_07-b10 [darwin-x86_64]
Time: 2013-06-04 19:54:29 -0400
Server: jetty-6.1.1
jruby.home: file:/Users/mark/.m2/repository/org/jruby/jruby-complete/1.7.4/jruby-complete-1.7.4.jar!/META-INF/jruby.home
--- Context Init Parameters:
contextConfigLocation = classpath:applicationContext.xml,
LoadError: library `fcntl' could not be loaded: java.lang.NullPointerException
require at org/jruby/RubyKernel.java:1054
require at /Users/mark/projects/quadran/src/main/webapp/WEB-INF/quadran_rails/vendor/bundle/jruby/1.9/gems/activesupport-3.2.13/lib/active_support/dependencies.rb:251
load_dependency at /Users/mark/projects/quadran/src/main/webapp/WEB-INF/quadran_rails/vendor/bundle/jruby/1.9/gems/activesupport-3.2.13/lib/active_support/dependencies.rb:236
require at /Users/mark/projects/quadran/src/main/webapp/WEB-INF/quadran_rails/vendor/bundle/jruby/1.9/gems/activesupport-3.2.13/lib/active_support/dependencies.rb:251
(root) at /Users/mark/projects/quadran/src/main/webapp/WEB-INF/quadran_rails/vendor/bundle/jruby/1.9/gems/jruby-openssl-0.8.7/lib/1.9/openssl/ssl-internal.rb:18
require at org/jruby/RubyKernel.java:1054
require at /Users/mark/projects/quadran/src/main/webapp/WEB-INF/quadran_rails/vendor/bundle/jruby/1.9/gems/activesupport-3.2.13/
<?xml version="1.0" encoding="UTF-8"?>
<web-app xmlns="http://java.sun.com/xml/ns/j2ee"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://java.sun.com/xml/ns/j2ee http://java.sun.com/xml/ns/j2ee/web-app_2_4.xsd"
version="2.4">
<!-- ######################### -->
<!-- Filters -->
@MarkMenard
MarkMenard / gist:5710185
Created June 4, 2013 22:29
fcntl jruby error.
LoadError: library `fcntl' could not be loaded: java.lang.NullPointerException
require at org/jruby/RubyKernel.java:1027
require at /Users/mark/projects/quadran/src/main/webapp/WEB-INF/quadran_rails/vendor/bundle/jruby/1.9/gems/activesupport-3.2.13/lib/active_support/dependencies.rb:251
load_dependency at /Users/mark/projects/quadran/src/main/webapp/WEB-INF/quadran_rails/vendor/bundle/jruby/1.9/gems/activesupport-3.2.13/lib/active_support/dependencies.rb:236
require at /Users/mark/projects/quadran/src/main/webapp/WEB-INF/quadran_rails/vendor/bundle/jruby/1.9/gems/activesupport-3.2.13/lib/active_support/dependencies.rb:251
(root) at /Users/mark/projects/quadran/src/main/webapp/WEB-INF/quadran_rails/vendor/bundle/jruby/1.9/gems/jruby-openssl-0.8.7/lib/1.9/openssl/ssl-internal.rb:18
require at org/jruby/RubyKernel.java:1027
require at /Users/mark/projects/quadran/src/main/webapp/WEB-INF/quadran_rails/vendor/bundle/jruby/1.9/gems/activesupport-3.2.13/
@MarkMenard
MarkMenard / gist:5406155
Created April 17, 2013 17:25
Example groovy2ruby translation
class Foo {
String firstName
Foo (firstName) {
this.firstName = firstName
firstName.each { letter -> letter.upcase() }
}
def fooBar () {
source 'https://rubygems.org'
gem 'jquery-rails'
gem 'mechanize'
gem 'mysql2'
gem 'rails', '3.1.3'
gem 'jruby-poi'
group :assets do