B
Blake Miller
I'm using 'net/ssh' to ssh into a OS X server and run a ruby script,
like this:
Net::SSH.start( "xxx.xxx.xxx", :username => 'xxx', assword => 'xxx'
) do | session |
shell = session.shell.open
shell.exec "ruby /usr/local/pgsql/share/migrate.rb
#{params['host']}"
end
The migrate.rb looks like this:
require 'rubygems'
...some ruby code
For some reason, the script fails to execute anything after the require
'rubygems' line. If I remove that line, the script will run, but
obviously I cannot use any gems, which I need.
If I ssh via terminal to the server, I can run the script fine with:
ruby /usr/local/pgsql/share/migrate.rb 1
I can't figure out why, when ssh'ing via the net/ssh package, the remote
script cannot include rubygems.
Any ideas?
like this:
Net::SSH.start( "xxx.xxx.xxx", :username => 'xxx', assword => 'xxx'
) do | session |
shell = session.shell.open
shell.exec "ruby /usr/local/pgsql/share/migrate.rb
#{params['host']}"
end
The migrate.rb looks like this:
require 'rubygems'
...some ruby code
For some reason, the script fails to execute anything after the require
'rubygems' line. If I remove that line, the script will run, but
obviously I cannot use any gems, which I need.
If I ssh via terminal to the server, I can run the script fine with:
ruby /usr/local/pgsql/share/migrate.rb 1
I can't figure out why, when ssh'ing via the net/ssh package, the remote
script cannot include rubygems.
Any ideas?