On Wednesday, April 2, 2014 2:05:46 PM UTC-4, John wrote:
>
> I assume that's because of the
>
>    :git => "https://github.com/net-ssh/net-ssh";
>
> OK. I compiled manually since I needed this outside of my bundler folder. 
Steps below for anyone else that needs them.


   1. git clone https://github.com/net-ssh/net-ssh
   2. cd net-ssh
   3. gem install jeweler  #this was a dependency needed
   4. gem build net-ssh.gemspec
   5. gem install net-ssh-2.8.1.gem
   
Thanks John for the workaround.
 

> I noticed this gem was saved in a folder "bundler", not with the other 
> gems. Should be a detail, as long as it works...
>
>
> On Wednesday, April 2, 2014 7:59:00 PM UTC+2, Vell wrote:
>>
>>
>>
>> On Wednesday, April 2, 2014 1:47:13 PM UTC-4, John wrote:
>>>
>>> After spending most of the day on this, it turns out the (my?) 
>>> conclusion is:
>>>
>>> Basically, v2.8.0 of the gem "net-ssh" was borked, so you'll need 2.8.1 
>>> (which is NOT yet on rubygems.org). So:
>>>
>>> 1. Uninstall all available net-ssh gems:
>>>    
>>>    gem uninstall net-ssh
>>>    (then confirm "all"...)
>>>    
>>> 2. Put this in your Gemfile:
>>>    
>>>    gem 'net-ssh', '~> 2.8.1', :git => "
>>> https://github.com/net-ssh/net-ssh";
>>>
>>> 3. Run:
>>>    
>>>    bundle install
>>>    bundle update net-ssh
>>>
>>
>> I got to this point and see that bundle shows my app using net-ssh 2.8.1 
>> but when I do a gem list net-ssh or try to require 'net/ssh', i get that 
>> the gem doesn't exist:
>>
>> Lovells-MacBook-Pro:online_community lovell$ gem list net-ssh
>>
>>
>> *** LOCAL GEMS ***
>>
>>
>> Lovells-MacBook-Pro:online_community lovell$ irb
>>
>> 2.0.0-p451 :001 > require 'net/ssh'
>>
>> LoadError: cannot load such file -- net/ssh
>>
>>
>> weird.
>>
>>>
>>> And, as a bonus, always make sure none of your permissions re SSH 
>>> haven't been borked somehow in the meantime, run so on your server (if you 
>>> have a user "deploy" on a host "myhost"):
>>>
>>>   root@myhost ~ # chmod go-w /home/deploy
>>>   root@myhost ~ # chmod 700 /home/deploy/.ssh
>>>   root@myhost ~ # chmod 600 /home/deploy/.ssh/authorized_keys
>>>
>>>
>>>
>>>
>>> On Wednesday, April 2, 2014 2:15:53 PM UTC+2, John wrote:
>>>>
>>>> Versions:
>>>>
>>>>    - Ruby: ruby 2.0.0p195
>>>>    - Capistrano: 3.1.0
>>>>    - Capistrano-rails: 1.1.1
>>>>    - Rake: 10.2.2
>>>>    - Rails: 4.1.0.rc2
>>>>    
>>>> Platform:
>>>>
>>>>    - Working on: Ubuntu Linux
>>>>    - Deploying to: Ubuntu Linux
>>>>
>>>> Files:
>>>>
>>>>    - Capfile
>>>>
>>>> require 'capistrano/setup'
>>>> require 'capistrano/deploy'
>>>> require 'capistrano/bundler'
>>>> require 'capistrano/rails'
>>>> require 'capistrano/rails/assets'
>>>> require 'capistrano/rails/migrations'
>>>> Dir.glob('lib/capistrano/tasks/*.cap').each { |r| import r }
>>>>
>>>>    - deploy.rb
>>>>
>>>> lock '3.1.0'
>>>>
>>>> set :application, 'my application'
>>>>
>>>> # set :ssh_options, {
>>>> #
>>>> #}
>>>>
>>>> set :repo_url, '/home/deployer/my_app.git'
>>>> set :branch, 'master'
>>>> set :deploy_to, '/home/deployer'
>>>> set :scm, :git
>>>> set :rvm_type, :system
>>>> set :pty, true
>>>> set :linked_files, %w{config/database.yml config/secrets.yml}
>>>> set :linked_dirs, %w{bin log tmp/pids tmp/cache tmp/sockets vendor/bundle 
>>>> public/system}
>>>> set :keep_releases, 5
>>>>
>>>> # The test task
>>>> task :whoami do
>>>>   on roles(:all) do
>>>>     execute :whoami
>>>>   end
>>>> end
>>>>
>>>>
>>>>    - Stage files (production.rb)
>>>>
>>>> server 'mydomain.com', user: 'deployer', roles: %w{web app db}
>>>>
>>>>
>>>> ===============================================================
>>>>
>>>> The problem:
>>>>
>>>> I can ssh into my remote production server without any problems (using 
>>>> keys, not passsword), but apparently Capistrano 3 can't authenticate: When 
>>>> I execute the following simple test task
>>>>
>>>> task :whoami do
>>>>   on roles(:all) do
>>>>     execute :whoami
>>>>   end
>>>> end
>>>>  
>>>>
>>>> ...I get...
>>>>
>>>> $ cap production whoami --trace
>>>> ** Invoke production (first_time)
>>>> ** Execute production
>>>> ** Invoke load:defaults (first_time)
>>>> ** Execute load:defaults
>>>> ** Invoke bundler:map_bins (first_time)
>>>> ** Execute bundler:map_bins
>>>> ** Invoke whoami (first_time)
>>>> ** Execute whoami
>>>>  INFO [fa727bad] Running /usr/bin/env whoami on mydomain.com
>>>> DEBUG [fa727bad] Command: /usr/bin/env whoami
>>>> cap aborted!
>>>> Net::SSH::AuthenticationFailed: Authentication failed for user 
>>>> [email protected]
>>>> /home/my_user/.rvm/gems/ruby-2.0.0-p195@rails3213/gems/net-ssh-2.8.0/lib/net/ssh.rb:217:in
>>>>  `start'
>>>> /home/my_user/.rvm/gems/ruby-2.0.0-p195@rails3213/gems/sshkit-1.3.0/lib/sshkit/backends/connection_pool.rb:25:in
>>>>  `create_or_reuse_connection'
>>>> /home/my_user/.rvm/gems/ruby-2.0.0-p195@rails3213/gems/sshkit-1.3.0/lib/sshkit/backends/netssh.rb:173:in
>>>>  `ssh'
>>>> [...]
>>>>
>>>> What is wrong here?
>>>>
>>>>

-- 
You received this message because you are subscribed to the Google Groups 
"Capistrano" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To view this discussion on the web, visit 
https://groups.google.com/d/msgid/capistrano/76326d02-2910-4f3a-8ccb-1052e94e0116%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to