mina-scp
mina-scp copied to clipboard
Undefined method 'domain!'
Hi,
After upgrading to mina 1.0.3 (and using mina-scp 0.1.2) I started seeing this when I do an scp_upload:
mina aborted!
NoMethodError: undefined method domain!' for main:Object /Users/alxx/.rvm/gems/ruby-2.2.3@latestrails/gems/mina-scp-0.1.2/lib/mina/scp.rb:2:in
scp_transfer'
/Users/alxx/.rvm/gems/ruby-2.2.3@latestrails/gems/mina-scp-0.1.2/lib/mina/scp.rb:23:in `scp_upload'
Any ideas?
Thanks.
Just run into exactly the same problem here.
I had no option but give up this gem and run scp
instead.
On 6 Dec 2016 17:39, "Kjell" [email protected] wrote:
Just run into exactly the same problem here.
— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/adie/mina-scp/issues/6#issuecomment-265200320, or mute the thread https://github.com/notifications/unsubscribe-auth/AAAH04PvcieBAMNgMzC6rViPStaEL-fBks5rFY_DgaJpZM4LFbPq .
Did you try replacing "domain" and the other settings with "fetch(:domain)"? Apparently this is how mina variables should now be accessed.
Sure, but the mention of "domain!" in question is inside the mina-scp gem, not in my code (as you can see above). I'm not about to overwrite gem methods, when simply using scp instead works just fine.
On 6 Dec 2016 17:46, "Kjell" [email protected] wrote:
Did you try replacing "domain" and the other settings with "fetch(:domain)"? Apparently this is how mina variables should now be accessed.
— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/adie/mina-scp/issues/6#issuecomment-265202486, or mute the thread https://github.com/notifications/unsubscribe-auth/AAAH01p5Cjotzoa3HuwaGDRLkEYM29pjks5rFZF1gaJpZM4LFbPq .
I tried now, did not help, since I am not making use of ":user"... somehow I was also hoping mina-scp would make use of the already established scp connection, but it just calls scp. So, indeed, its better to call that directly.
Here's a working example:
scp -i #{fetch(:identity_file)} #{file} #{fetch(:user)}@#{fetch(:domain)}:/tmp/
(Wrap that in reverse apostrophes, "`" -- I can't seem to do it in here)
Maybe you don't need that -i, or you need some other params instead; you can customise it as you need.
Created a pull request
Same problem..
Simple solution - not install mina-scp
gem, but create mina_scp.rb
file based on pull request's file:
https://github.com/adie/mina-scp/blob/2c47cdce9e457496e32e8d58586aa778814bc6d0/lib/mina/scp.rb
For Rails structure:
- place
mina_scp.rb
inlib
folder - in Mina's config file
config/deploy.rb
addrequire_relative '../lib/mina_scp'
And then scp_download
and scp_upload
will be available.