As an exercise to learn Ruby, I wrote a script that requires appscript. I created a plist in /Library/LaunchAgents to execute the script when my Mac starts.
The problem is, if I run the script from the terminal it works flawlessly, but when it is executed from the plist I get this error:
/Library/Ruby/Site/2.0.0/rubygems/core_ext/kernel_require.rb:55:in `require': cannot load such file -- appscript (LoadError)
from /Library/Ruby/Site/2.0.0/rubygems/core_ext/kernel_require.rb:55:in `require'
from /Users/LeoMB/Ruby/Apps/DesktopChanger/DesktopChanger.rb:7:in `<main>'
I've already tried: gem update --system
but that didn't work for me.
Thanks in advance for any help.
I've restarted the system and reinstalled rb-appscript and this solved the problem. I don't know what was going on, but the question can be closed.