Reputation: 1527
In my ruby script there's a line to create a new file:
File.open("/var/test.json", "w")
If I call this script from console the file is created. But when I execute shell code in Rails app %x( ruby script.rb )
the file isn't created. Is there any reason for it? Should I require or include something additional?
Upvotes: 1
Views: 36
Reputation: 4098
Maybe you are not sending the right path to the script, asume you have script.rb
inside lib:
%x( ruby #{Rails.root.join('lib', 'script.rb')} )
I think you need to send the full path, but I need more information to know the exact error.
Upvotes: 2