Install script options- help needed
-
in SU ruby online help, it says ruby scripts can be installed a number of ways
http://download.sketchup.com/OnlineDoc/gsu6_ruby/Docs/examples.htmlI am trying to setup mine as per the
"Automatically Loading a Ruby Script Using the "require_all" Function"I am on mac OS 10.5.5
I've made a myRubyScripts.rb file with
home = File.expand_path "~"
myrubyscripts = File.join home, "MyRubyScripts"
require_all( myrubyscriptsdirectory )which I then placed in the SU plugins folder
and a folder myrubyscriptsdirectory, which I then placed in in my user account and added a test plugin ; ContourMaker.rb
when I start up SU I get this error message
Error Loading File myrubyscripts.rb
/Library/Application Support/Google SketchUp 6/SketchUp/Plugins/myrubyscripts.rb:1: parse error, unexpected $undefined., expecting '}'
{\rtf1\ansi\ansicpg1252\cocoartf949\cocoasubrtf420
^what have I done wrong.
thanks -
Save your "myRubyScripts.rb" file as plain (ascii) text, not as Rich Text.
-
-
garydorn,
Welcome to the forum, by the way...
{\rtf1\ansi\ansicpg1252\cocoartf949\cocoasubrtf420
Not being a Mac user, it's hard for me to say. It does appear to be a plain text file, but the code above (from your post) is the header information for a Rich Text Format file.
-
thanks,
I understand what you say, so I deleted that file, duplicated the utilities.rb file and replaced its text with the text suggested, then changed the file name to myrubyscripts and then opened SU
I get this nowError Loading File MyRubyScripts.rb
undefined local variable or method `myrubyscriptsdirectory' for main:Objectthanks
Gary -
Because myrubyscriptsdirectory is an undefined local variable or method.
You set the variable named myrubyscripts in the previous line...
-
I understand what you say about the text not matching so I played round with changing them so they matched, and after non-working numerous iterations,
it finally worked!its now
home = File.expand_path "~"
myrubyscripts = File.join home, "MyRubyScripts"
require_all(myrubyscripts)I think it worked because I eventually removed the spaces around (myrubyscripts)?
thanks for your help Jim
may this be of assistance to other Mac users.
Advertisement