Skip to content

Instantly share code, notes, and snippets.

@GertThiel
GertThiel / daemon.rb
Created June 13, 2014 15:36
MissingSourceFile: no such file to load -- rspec/core
# istead of originally
require 'rspec/core'
# this supports RSpec 1
begin
# RSpec v2
require 'rspec/core'
rescue Exception
# RSpec v1
require 'spec'
end
@GertThiel
GertThiel / torquebox-extensions.rb
Created June 13, 2014 15:33
NoMethodError: undefined method `stop' for nil:NilClass
TorqueSpec.local {
TorqueSpec::Configurator.configure do |config|
config.after(:suite) do
Thread.current[:app_server].stop unless Thread.current[:app_server].nil?
end
end
}
@GertThiel
GertThiel / environment.rb
Created June 13, 2014 15:28
The initializer of Rails 2.3's ActiveSupport::Cache::Store does not accept options
Rails::Initializer.run do |config|
ActiveSupport::Cache::Store.class_eval do
def initialize(options = {});end
end
#
require 'torquebox-cache'
ActiveSupport::Cache::TorqueBoxStore.class_eval do
def initialize(options = {})
@options = options
@GertThiel
GertThiel / lifecycle_sample.rb
Created November 19, 2012 12:04
Hobo::Model::Lifecycles::Transition is probably buggy
# Consider a program managing tasks, each reservable by an author and a reviewer.
# The author and the reviewer of one task must not be the same
#
transition :reserve, { :available => :reserved }, :available_to => :users,
:user_becomes => :author,
:if => Proc.new { |task| task.acting_user != task.reviewer }
mbp:torquebox-1.0.0.CR1-SNAPSHOT gertthiel$ ./jboss/bin/run.sh
=========================================================================
JBoss Bootstrap Environment
JBOSS_HOME: /Users/gertthiel/Documents/Workspaces/textprovider/torquebox-1.0.0.CR1-SNAPSHOT/jboss
JAVA: /Library/Java/Home/bin/java
JAVA_OPTS: -Xms256m -Xmx1024m -XX:MaxPermSize=512m -Dorg.jboss.resolver.warning=true -Dsun.rmi.dgc.client.gcInterval=3600000 -Dsun.rmi.dgc.server.gcInterval=3600000 -Dprogram.name=run.sh -Djava.library.path=/Users/gertthiel/Documents/Workspaces/textprovider/torquebox-1.0.0.CR1-SNAPSHOT/jboss/bin/native/lib64
Errno::ENOENT in Front#index
Showing /Users/gertthiel/Documents/Workspaces/textprovider/Stanza-Torquebox/app/views/front/index.dryml where line # raised:
No such file or directory - vfs:/Users/gertthiel/Documents/Workspaces/textprovider/Stanza-Torquebox/vendor/plugins/hobo/hobo/rails/../lib/hobo/static_tags
Extracted source (around line #):
RAILS_ROOT: vfs:/Users/gertthiel/Documents/Workspaces/textprovider/Stanza-Torquebox
Application Trace | Framework Trace | Full Trace
mbp:Stanza-Torquebox gertthiel$ ./debug.sh
pwd: /Users/gertthiel/Documents/Workspaces/textprovider/Stanza-Torquebox
>>> environment <<<
$TORQUEBOX_HOME: /Users/gertthiel/Documents/Workspaces/textprovider/torquebox-1.0.0.Beta23
$JRUBY_HOME: /Users/gertthiel/Documents/Workspaces/textprovider/torquebox-1.0.0.Beta23/jruby
$GEM_HOME:
>>> bundler <<<
mbp:Stanza-Torquebox gertthiel$ ./debug.sh
$TORQUEBOX_HOME:
/Users/gertthiel/Documents/Workspaces/textprovider/torquebox-1.0.0.Beta23
$JRUBY_HOME:
/Users/gertthiel/Documents/Workspaces/textprovider/torquebox-1.0.0.Beta23/jruby
$GEM_HOME:
which jruby:
/Users/gertthiel/Documents/Workspaces/textprovider/torquebox-1.0.0.Beta23/jruby/bin/jruby
jruby -S gem list:
gem 'rsolr-direct', '~> 0.1.0', :require => nil
#############################################################################
# #
# This Gemfile depends on Bundler 0.9.10 and RubyGems 1.3.6 #
# #
#############################################################################
source "http://rubygems.org"
source "http://gems.github.com"
source "http://gemcutter.org"