Ruby on rails - cannot load such file -- net/ssh -


i've been struggling on few days now..

when try call method in helper view ssh, throws error.

"this error occurred while loading following files: net/ssh"

but when copy code test.rb file , execute prompt ruby test.rb connects flawlessly.

what problem ? tried on computer , same result.

thank last step before can complete project!

regards,

application_helper.rb:

module applicationhelper   def title(value)     unless value.nil?       @title = "#{value} | eucc"           end   end   def execute     require 'rubygems'     require 'net/ssh'     @hostname = "smtlmon02"     @username = "gcaille"     @password = "qaz1234"     @cmd = "ls -al"     @cmd2 = "sudo su - -c 'ls;date'"      ssh = net::ssh.start(@hostname, @username, :password => @password)     res = ssh.exec!(@cmd)     res2 = ssh.exec!(@cmd2)      ssh.close     file.open("output.txt", 'w') {|file| file.write(res2)}   end end 

you need add gemfile this:

gem 'net-ssh' 

and run bundle install after that.


Comments

Popular posts from this blog

basic authentication with http post params android -

vb.net - Virtual Keyboard commands -

How to get multiresult with multicondition in Sql Server -