when executing Powershell Script from Ruby "Can't convert true into String" error
Posted
by Ozie Harb
on Stack Overflow
See other posts from Stack Overflow
or by Ozie Harb
Published on 2010-05-14T16:40:24Z
Indexed on
2010/05/14
16:44 UTC
Read the original article
Hit count: 532
ruby-on-rails
|ruby
I am trying to execute a powershell script from Ruby, I have entered the below command:
scriptPath = system('powershell \"C:\\Scripts\\DB_Setup.ps1\"')
The ruby Script is handling exceptions when an error is raised to stop the script as below command:
rescue => ex
message = "\nscript on server '#{`hostname`.strip()}' terminated unexpectedly:\n\nMessage: '#{ex.message}"
raise ex
Output Error: script on server 'TestDB1' terminated unexpectedly: Message: 'can't convert true into String'
Thanks
© Stack Overflow or respective owner