My code probably need to require the sketchup.rb file.
require "sketchup.rb"
require_all("/plugins")
This is from sketchup.rb
#-----------------------------------------------------------------------------
# By default, SketchUp automatically loads (using require) all files with
# the .rb extension in the plugins directory. This function can be used
# to automatically load all .rb files from a different directory also. to
# use this add a call like the following to a file in the plugins directory
# require_all "MyRubyScripts"
def require_all(dirname)
begin
rbfiles = Dir[File.join(dirname, "*.rb")]
$;.push dirname
rbfiles.each {|f| require f}
rescue
puts "could not load files from #{dirname}"
end
end