• Login
sketchucation logo sketchucation
  • Login
ℹ️ GoFundMe | Our friend Gus Robatto needs some help in a challenging time Learn More

File.dirname(__FILE__) returns nil?

Scheduled Pinned Locked Moved Developers' Forum
5 Posts 3 Posters 877 Views
Loading More Posts
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • W Offline
    Whaat
    last edited by 26 Apr 2012, 14:48

    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.

    SketchUp Plugins for Professionals

    1 Reply Last reply Reply Quote 0
    • T Offline
      TIG Moderator
      last edited by 26 Apr 2012, 14:51

      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

      1 Reply Last reply Reply Quote 0
      • W Offline
        Whaat
        last edited by 26 Apr 2012, 16:05

        @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 String

        I have since found out that the user is using SU8.1 and OSX 10 (not too helpful info)

        SketchUp Plugins for Professionals

        1 Reply Last reply Reply Quote 0
        • D Offline
          Dan Rathbun
          last edited by 26 Apr 2012, 16:55

          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.

          I'm not here much anymore.

          1 Reply Last reply Reply Quote 0
          • W Offline
            Whaat
            last edited by 26 Apr 2012, 17:47

            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!

            SketchUp Plugins for Professionals

            1 Reply Last reply Reply Quote 0
            • 1 / 1
            1 / 1
            • First post
              1/5
              Last post
            Buy SketchPlus
            Buy SUbD
            Buy WrapR
            Buy eBook
            Buy Modelur
            Buy Vertex Tools
            Buy SketchCuisine
            Buy FormFonts

            Advertisement