Statically linked Ruby 1.9.3 won't load any Ruby files

edited August 2012 in KLayout Support
I just compiled klayout against a static libruby (version 1.9.3-p0) and I keep getting the following error:

Ruby error: 'cannot load such file -- hello_world.rb' (LoadError)

Is 1.9.3 not supported? A brief look over the code indicates that it should be supported. Any ideas why this might be happening? Is there any more information I can provide to help debug?

Comments

  • edited November -1
    I ran into the same thing, Matthias gave me the tip to add the following to the .rb script to print the search path

    puts $:

    Statically linked 1.9.3 doesn't have "." in the ruby search path.

    klayout -r ./hello_world.rb

    worked for me.
  • edited November -1
    Ah, awesome. That got it working for me too. Thanks very much!
  • edited November -1

    Hi Stefan,

    thanks for the hint regarding statically linked ruby. I did not know that it behaves differently compared to the dynamically linked one.

    Best regards,

    Matthias

  • edited November -1
    Actually, I'm not so sure it's specific to statically linked Ruby. If I'm not mistaken, the entire 1.9 series doesn't have "." in the ruby search path. I tried the dynamically linked ruby after posting the original post and it also did not work.
  • edited November -1

    Apparently it does not have to do with the linking mode, but they dropped the "." in Ruby 1.9.2. Here is a discussion thread about that: http://stackoverflow.com/questions/4965556/why-isnt-current-directory-on-my-ruby-path.

    The solution appears to set the RUBYLIB environment variable to "." (which adds ".") or specify the script path explicitly. However, lacking a 1.9.2 ruby installation right now I did not test that myself.

    Best regards,

    Matthias

Sign In or Register to comment.