File.dirname(__FILE__) returns nil?
-
Thread title says the problem. I received a support email and it seems as though this code is returning nil on his system. Has anyone experienced this and figured out why?
Thanks.
-
Is it inside a compiled rbs file or a rb file.
If it's used inside a rbs it might refer to the wrong 'variable', as its not then specific to that loading file.
What is the exact context ? -
@tig said:
Is it inside a compiled rbs file or a rb file.
If it's used inside a rbs it might refer to the wrong 'variable', as its not then specific to that loading file.
What is the exact context ?It's in an RB file (I believe you have it ) that is located in the plugins/sketchuv folder:
The code inside the file is:
Sketchup.load(File.join(File.dirname(__FILE__),"sketchuv.rbs"))
and the user is getting this error when SketchUp loads:
Error Loading File sketchuv_load.rb
(eval):3076:in `join': can't convert nil into StringI have since found out that the user is using SU8.1 and OSX 10 (not too helpful info)
-
I don't think that is the line with the error.
Check in "sketchuv.rbs", around line 3075 (give or take a few lines,) for a
join
statement.You need to note the line number, in the file that loads "sketchuv_load.rb" add 1 (for the 1 line in "sketchuv_load.rb",) then subtract that number of lines from the 3076 reported in the
Sketchup.load
error. That will give you a better idea of the number of lines into the rbs file, where the error should be. -
Weird, now the user says the problem is not occurring anymore without any explanation. Lovely!
Sorry for wasting your time Dan,TiG. Thanks for the help!
Advertisement