Skip to content

Instantly share code, notes, and snippets.

View donv's full-sized avatar

Uwe Kubosch donv

View GitHub Profile
@donv
donv / gist:e5991b09c7aa387823c3
Created July 17, 2014 17:11
bin/jruby -S rake test:mri
macbeth:jruby uwe$ bin/jruby -S rake test:mri
/Users/uwe/workspace/jruby/jruby/bin/jruby -I"lib" -X-C -J-ea -I lib/ruby/shared -I lib/ruby/2.1 -I . -I test/mri -I test/mri/ruby -r ./test/mri_test_env.rb -r minitest/excludes -I"/Users/uwe/workspace/jruby/jruby/lib/ruby/gems/shared/gems/rake-10.1.1/lib" "/Users/uwe/workspace/jruby/jruby/lib/ruby/gems/shared/gems/rake-10.1.1/lib/rake/rake_test_loader.rb" "test/mri/ruby/test_alias.rb" "test/mri/ruby/test_array.rb" "test/mri/ruby/test_assignment.rb" "test/mri/ruby/test_autoload.rb" "test/mri/ruby/test_basicinstructions.rb" "test/mri/ruby/test_beginendblock.rb" "test/mri/ruby/test_bignum.rb" "test/mri/ruby/test_call.rb" "test/mri/ruby/test_case.rb" "test/mri/ruby/test_class.rb" "test/mri/ruby/test_clone.rb" "test/mri/ruby/test_comparable.rb" "test/mri/ruby/test_complex.rb" "test/mri/ruby/test_complex2.rb" "test/mri/ruby/test_complexrational.rb" "test/mri/ruby/test_condition.rb" "test/mri/ruby/test_const.rb" "test/mri/ruby/test_continuation.rb" "test/mri/ruby/test_d
@donv
donv / Prawn rotated table cell
Last active August 29, 2015 14:01
Prawn rotated table cell
require 'rubygems'
require 'prawn'
module Prawn
class Table
class Cell
class Text < Cell
# Returns the width of this text with no wrapping. This will be far off
# from the final width if the text is long.
def natural_content_width
@donv
donv / gist:8283063
Created January 6, 2014 13:45
Stack trace running a Rails 3.2.16 app with /usr/java/default/bin/java -Xmx2G -Xss2048k -Djffi.boot.library.path=/usr/local/jruby-1.7.9/lib/jni -Djava.awt.headless=true -Dawt.toolkit=sun.awt.HToolkit -Xbootclasspath/a:/usr/local/jruby-1.7.9/lib/jruby.jar -classpath : -Djruby.home=/usr/local/jruby-1.7.9 -Djruby.lib=/usr/local/jruby-1.7.9/lib -Djr…
[INFO ] org.projectodd.wunderboss.web.WebComponent - Undertow listening on localhost:3010
[INFO ] org.projectodd.wunderboss.web.WebComponent - Started web context /
[ERROR] io.undertow.request - Blocking request failed HttpServerExchange{ GET /}
java.lang.UnsupportedOperationException: BUG: invoking UndefinedMethod.call; report at http://bugs.jruby.org
at org.jruby.internal.runtime.methods.UndefinedMethod.call(UndefinedMethod.java:59)
at org.jruby.internal.runtime.methods.DynamicMethod.call(DynamicMethod.java:210)
at org.jruby.internal.runtime.methods.DynamicMethod.call(DynamicMethod.java:206)
at org.projectodd.wunderboss.ruby.rack.RackHandler.handleRequest(RackHandler.java:46)
at io.undertow.server.Connectors.executeRootHandler(Connectors.java:139)
at io.undertow.server.HttpServerExchange$1.run(HttpServerExchange.java:638)
@donv
donv / gist:8234480
Created January 3, 2014 07:59
Problem installing JRuby using RVM 1.25.13
Last login: Fri Jan 3 08:30:54 on ttys000
You have mail.
macbeth:~ uwe$ rvm --version
rvm 1.25.13 (master) by Wayne E. Seguin <[email protected]>, Michal Papis <[email protected]> [https://rvm.io/]
macbeth:~ uwe$ rvm install jruby-1.7.8
Searching for binary rubies, this might take some time.
Found remote file http://jruby.org.s3.amazonaws.com/downloads/1.7.8/jruby-bin-1.7.8.tar.gz
Checking requirements for osx.
@donv
donv / gist:6842581
Created October 5, 2013 15:54
Stack trace when running https://github.com/ruboto/ruboto/wiki/Tutorial:-fragments Possibly missing a reference to the fragment class.
I/System.out(13941): RubotoActivity onCreate(): org.ruboto.example.fragments.FragmentsActivity, finishing: false
I/System.out(13941): Exception creating activity: Binary XML file line #3: Error inflating class fragment
I/System.out(13941): android.view.LayoutInflater.createViewFromTag(LayoutInflater.java:697)
I/System.out(13941): android.view.LayoutInflater.rInflate(LayoutInflater.java:739)
I/System.out(13941): android.view.LayoutInflater.inflate(LayoutInflater.java:489)
I/System.out(13941): android.view.LayoutInflater.inflate(LayoutInflater.java:396)
I/System.out(13941): android.view.LayoutInflater.inflate(LayoutInflater.java:352)
I/System.out(13941): com.android.internal.policy.impl.PhoneWindow.setContentView(PhoneWindow.java:251)
I/System.out(13941): android.app.Activity.setContentView(Activity.java:1835)
I/System.out(13941): java.lang.reflect.Method.invokeNative(Native Method)
@donv
donv / gist:5557091
Created May 10, 2013 20:17
JRuby on windows weirdness
Microsoft Windows [Versjon 6.1.7601]
Copyright (c) 2009 Microsoft Corporation. Med enerett.
C:\Windows\system32>where java
C:\Windows\System32\java.exe
C:\Windows\system32>java -version
java version "1.7.0"
Java(TM) SE Runtime Environment (build 1.7.0-b147)
Java HotSpot(TM) 64-Bit Server VM (build 21.0-b17, mixed mode)
@donv
donv / Java stack trace
Last active December 15, 2015 05:59
Java stack trace of blocked Ruby thread.
java.lang.Object.wait(Native Method)
java.lang.Thread.parkFor(Thread.java:1231)
sun.misc.Unsafe.park(Unsafe.java:323)
java.util.concurrent.locks.LockSupport.park(LockSupport.java:157)
java.util.concurrent.locks.AbstractQueuedSynchronizer.parkAndCheckInterrupt(AbstractQueuedSynchronizer.java:813)
java.util.concurrent.locks.AbstractQueuedSynchronizer.doAcquireInterruptibly(AbstractQueuedSynchronizer.java:873)
java.util.concurrent.locks.AbstractQueuedSynchronizer.acquireInterruptibly(AbstractQueuedSynchronizer.java:1200)
java.util.concurrent.locks.ReentrantLock.lockInterruptibly(ReentrantLock.java:311)
org.jruby.RubyThread.lockInterruptibly(RubyThread.java:1277)
org.jruby.ext.thread.Mutex.lock(Mutex.java:91)
@donv
donv / gist:4770295
Created February 12, 2013 14:41
Ruboto Android POST example
java_import 'android.net.http.AndroidHttpClient'
java_import 'android.util.Log'
java_import 'org.apache.http.client.entity.UrlEncodedFormEntity'
java_import 'org.apache.http.client.methods.HttpPost'
java_import 'org.apache.http.message.BasicNameValuePair'
java_import 'org.apache.http.util.EntityUtils'
t = Thread.start do
begin
client = AndroidHttpClient.newInstance('MyClient')
@donv
donv / gist:4237753
Created December 8, 2012 00:18
Build ruboto-irb
macbeth:ruboto-irb uwe$ rake install
(in /Users/uwe/workspace/jruby/ruboto-irb)
ant debug
Buildfile: /Users/uwe/workspace/jruby/ruboto-irb/build.xml
-set-mode-check:
-set-debug-files:
-check-env:
@donv
donv / adb logcat output
Created November 12, 2012 00:19
DexOpt failure with new dx.jar and new JRuby 1.7.1.dev
D/installd( 37): DexInv: --- BEGIN '/data/app/org.ruboto.core-1.apk' ---
E/dalvikvm( 513): Out-of-order method_idx: 0xffff then 0x0
E/dalvikvm( 513): Trouble with item 3591 @ offset 0xa62e40
E/dalvikvm( 513): Swap of section type 2006 failed
E/dalvikvm( 513): ERROR: Byte swap + verify failed
E/dalvikvm( 513): Optimization failed
W/installd( 37): DexInv: --- END '/data/app/org.ruboto.core-1.apk' --- status=0xff00, process failed