Puts not working - Anyone else?

but print does. SU2018 on a Mac.

Maybe the info in the above link can help you figure out what is providing the puts that is being invoked

when I run this…

EDIT: chalk and cheese

why are they missing???

john

That post is way over my head unfortunately! :grimacing:

ignore the last one as I was comparing chalk to cheese…

but, you do have these, that I don’t seem to have…

 :runNudgeStackUndo,
 :Digest,

do you have any Gems installed?

john

Sketchup::Console.ancestors.map{|a| a if a.private_method_defined?(:puts)}
# => [Sketchup::Console, Object, nil, Kernel, nil]

you could see what the two above return as well…

something is hijacking puts on your mac…

Have you accidentally defined a method named puts in the global namespace?

not that I know of…

> Sketchup::Console.ancestors.map{|a| a if a.private_method_defined?(:puts)}
[Sketchup::Console, Object, nil, Kernel, nil]

sorry, been having dinner,

did the other two yield anything?

Sketchup::Console.ancestors.map{|a| a if a.private_method_defined?(:runNudgeStackUndo)}
Sketchup::Console.ancestors.map{|a| a if a.private_method_defined?(:Digest)}

john

@hank have you installed the Mojave update for SketchUp 2018 ?
(P.S. - Your forum profile does not indicate your specific SketchUp version.)


You can also check the owner of the puts() method …

method(:puts).owner
#=> Kernel

Also @hank, have you installed any custom Ruby Console extension ?


Note that there have been issues in past release and are some current issues with the Ruby Console …

@hank can you follow up on this, even if your happy with your workaround…

if an extension is re-defining :puts then we can notify the author and/or the dev team…

if Dan’s :owner doesn’t bear fruit, then check $" may show an extension hiding in HD/Lib path…

john

@john_drivenupthewall is right that modifying normally global methods (and variables) is bad coding that needs to be tracked down and corrected. Please don’t drop this before the culprit is identified!

Sorry All… been on a whirlwind of other business in preparation for the holiday break!

Here is what that yielded:

> Sketchup::Console.ancestors.map{|a| a if a.private_method_defined?(:runNudgeStackUndo)}
Sketchup::Console.ancestors.map{|a| a if a.private_method_defined?(:Digest)}
[Sketchup::Console, Object, nil, nil, nil]

I don’t think I have.

I just updated to include

yields…

> method(:puts).owner
Object

nope!

Here is the return for John’s test…

> $".grep(/digest/i)
["digest.so", "/Applications/SketchUp 2018/SketchUp.app/Contents/Frameworks/Ruby.framework/Versions/2.2/lib/ruby/2.2.0/digest.rb", "digest/md5.so"]

I renamed my Plugins folder to Plugins!! per John’s suggestion to unload all plugins, restarted and puts still not working.

p works though

did you rename ‘both’ of your ‘Plugins’ folders?

some may be in the /Library/Application Support/SketchUp 2018/SketchUp/Plugins folder…

john

That is the one I re-named.

It actually only has the stock plugins in it plus one custom plugin loader script that tells SU to also look in my local folder. This is a work around to the idea that you can’t tell SU where you want your plugin folder located and I want to share the same scripts at home/work which are synced via dropbox.

Long story short, I should only have to re-name that one I believe… unless you know otherwise?