Ruby 2.0, Rails 4. I made a site which serves static files. I used
Dir.glob
to list static files Now I have to save the files outside the app because the slugsize in Heroku will be too big otherwise
For this reason, i would like a directory listing of a public web folder. (Served by apache server)
I tried: Gemfile:
gem 'net-ssh'
Controller:
def index
require 'net/ssh'
ssh = Net::SSH.start( 'http://www.domain.ch/path/to/directory', 'gast')
@files =ssh.exec!( 'ls . ').split("\n")
ssh.close
end
This raised the error:
Errno::ENOENT - No such file or directory - getaddrinfo:
net-ssh (2.7.0) lib/net/ssh/transport/session.rb:67:in `block in initialize'
/home/benutzer/.rvm/rubies/ruby-2.0.0-p247/lib/ruby/2.0.0/timeout.rb:52:in `timeout'
/home/benutzer/.rvm/rubies/ruby-2.0.0-p247/lib/ruby/2.0.0/timeout.rb:97:in `timeout'
net-ssh (2.7.0) lib/net/ssh/transport/session.rb:67:in `initialize'
net-ssh (2.7.0) lib/net/ssh.rb:200:in `start'
...
I never heard of a file called getaddrinfo
The answer on this thread `initialize': No such file or directory - getaddrinfo (Errno::ENOENT) when Rails new app (updating rvm) didnt solve the problem.
Additional info:
$gem -v bundler
2.0.5
$rvm - v
rvm 1.21.12 (stable)
$rvm - v
rvm 1.23.9 (master)