mina-scp icon indicating copy to clipboard operation
mina-scp copied to clipboard

Undefined method 'domain!'

Open alxx opened this issue 8 years ago • 8 comments

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.

alxx avatar Dec 06 '16 13:12 alxx

Just run into exactly the same problem here.

KjellMorgenstern avatar Dec 06 '16 16:12 KjellMorgenstern

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 .

alxx avatar Dec 06 '16 16:12 alxx

Did you try replacing "domain" and the other settings with "fetch(:domain)"? Apparently this is how mina variables should now be accessed.

KjellMorgenstern avatar Dec 06 '16 16:12 KjellMorgenstern

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 .

alxx avatar Dec 06 '16 16:12 alxx

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.

KjellMorgenstern avatar Dec 06 '16 16:12 KjellMorgenstern

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.

alxx avatar Dec 06 '16 17:12 alxx

Created a pull request

KjellMorgenstern avatar Dec 06 '16 18:12 KjellMorgenstern

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 in lib folder
  • in Mina's config file config/deploy.rb add require_relative '../lib/mina_scp'

And then scp_download and scp_upload will be available.

nemilya avatar Mar 21 '19 09:03 nemilya