Skip to content

Instantly share code, notes, and snippets.

@klauern
klauern / console
Created December 9, 2011 01:06
nifty WinXP errors on test/test_load.rb
PS C:\klauer-jruby> .\bin\jruby.bat .\test\test_load.rb
Run options:
# Running tests:
LoadError: no such file to load -- jruby
require at org/jruby/RubyKernel.java:961
(root) at C:/jruby-1.6.5//lib/ruby/site_ruby/shared/builtin/java/java.io.rb:1
require at org/jruby/RubyKernel.java:961
(root) at C:/jruby-1.6.5//lib/ruby/site_ruby/shared/builtin/java/java.io.rb:43
@klauern
klauern / console
Created December 8, 2011 20:54
ant test failure on test_file_url
run-junit-interpreted-short:
[echo] compile=OFF, jit.threshold=20, jit.maxsize=1000000000, jit.max=-1, objectspace=false threadpool=false reflection=false version=ruby1_8
[junit] Testsuite: org.jruby.test.ScriptTestSuite
[junit] Tests run: 32, Failures: 0, Errors: 0, Time elapsed: 13.844 sec
[junit]
[junit] Testsuite: org.jruby.test.JRubyTestSuite
[junit] Tests run: 35, Failures: 1, Errors: 0, Time elapsed: 28.656 sec
[junit]
[junit] Testcase: test_file(org.jruby.test.TestUnitTestSuite$ScriptTest): FAILED
[junit] Faults encountered running test\test_file, complete output follows:
@klauern
klauern / ant clean test after patch
Created December 1, 2011 22:18
Error on 'ant clean test' on Win XP
PS C:\klauer-jruby> ant clean test
Buildfile: C:\klauer-jruby\build.xml
init:
prepare-bin-jruby:
clean:
[delete] Deleting directory C:\klauer-jruby\build
[delete] Deleting directory C:\klauer-jruby\docs\api
PS C:\mydocs\Work\RubyPCIProjects\jruby> bin/jruby.bat spec/mspec/bin/mspec -T --1.9 spec/ruby/command_line/dash_a_spec.rb
Errno::ENOENT: No such file or directory - cannot execute
_exec_internal at org/jruby/RubyKernel.java:1584
exec at file:/C:/mydocs/Work/RubyPCIProjects/jruby/lib/jruby.jar!/jruby/kernel19/kernel.rb:25
run at C:/mydocs/Work/RubyPCIProjects/jruby/spec/mspec/lib/mspec/commands/mspec.rb:168
main at C:/mydocs/Work/RubyPCIProjects/jruby/spec/mspec/lib/mspec/utils/script.rb:218
(root) at spec/mspec/bin/mspec:7
Various incantations all result in the same error:
@klauern
klauern / .project
Created November 15, 2011 02:52
project config for gh project
<?xml version="1.0" encoding="UTF-8"?>
<projectDescription>
<name>github</name>
<comment>FIXME: write description</comment>
<projects>
</projects>
<buildSpec>
<buildCommand>
<name>org.eclipse.jdt.core.javabuilder</name>
<arguments>
source "http://rubygems.org"
# Specify your gem's dependencies in mantisrb.gemspec
gemspec
@klauern
klauern / Exception.txt
Created August 9, 2011 18:39
Error in CXF web service call.
Running com.me.RequestTest
Aug 10, 2011 4:16:24 PM org.apache.cxf.service.factory.ReflectionServiceFactoryBean buildServiceFromWSDL
INFO: Creating Service {http://service.something.net/xml}QueryService from WSDL: file://C:/mydocs/Work/project/my-service.wsdl
Aug 10, 2011 4:16:50 PM org.apache.cxf.phase.PhaseInterceptorChain doDefaultLogging
WARNING: Interceptor for {http://service.something.net/xml}QueryService#{http://service.something.net/xml}QueryRequest has thrown exception, unwinding now
org.apache.cxf.binding.soap.SoapFault: "http://service.something.net/xml", the namespace on the "QueryResponse" element, is not a valid SOAP version.
at org.apache.cxf.binding.soap.interceptor.ReadHeadersInterceptor.readVersion(ReadHeadersInterceptor.java:115)
at org.apache.cxf.binding.soap.interceptor.ReadHeadersInterceptor.handleMessage(ReadHeadersInterceptor.java:141)
at org.apache.cxf.binding.soap.interceptor.ReadHeadersInterceptor.handleMessage(ReadHeadersInterceptor.java:60)
at org.a
require 'sinatra-caching'
run SinatraCache
@klauern
klauern / gist:154687
Created July 25, 2009 04:06 — forked from charlesroper/gist:65931
Method to detect whether we are running from an elevated command-prompt under Vista/Win7 or Administrator in WinXP
#
# Method to detect whether we are running from an elevated command-prompt
# under Vista/Win7 or as part of the local Administrators group in WinXP.
#
def elevated?
whoami = `whoami /groups` rescue nil
if whoami =~ /S-1-16-12288/
true
else
admin = `net localgroup administrators | find "%USERNAME%"` rescue ""
@klauern
klauern / example_gist_create.rb
Created March 20, 2009 14:48 — forked from schacon/example_gist_create.rb
Ruby Gist creator fork
require 'net/http'
require 'uri'
# /api/v1/:format/new
# /api/v1/:format/gists/:user
# /api/v1/:format/:gist_id
res = Net::HTTP.post_form(URI.parse('http://gist.github.com/api/v1/xml/new'),
{ 'files[file1.ab]' => 'CONTNETS',
'files[file2.ab]' => 'contents' })