Re: [capistrano-mailing-list] Fail on rvm:check

2016-03-31 Thread Lee Hambley
You might want to ask the rbenv community for help. I unfortunately don't
personally, not recommend to run rvm or other ruby version switchers in
production.

Lee Hambley
http://lee.hambley.name/
+49 (0) 170 298 5667

On 31 March 2016 at 10:11, pan yuan  wrote:

> Yeah, I have just read it. Perhaps it's too advance to me, I could see any
> clue from that article. It just seems that my deployment stuck at
> rvm:check. I don't know what rvm:check is asking. I see the remote server
> has the rvm and ruby installed correctly.
>
> 在 2016年3月29日星期二 UTC-7下午11:07:33,Lee Hambley写道:
>>
>> Have you read this?
>> http://capistranorb.com/documentation/faq/why-does-something-work-in-my-ssh-session-but-not-in-capistrano/
>>
>> (sent from my phone, please excuse typos)
>> On 30 Mar 2016 7:58 a.m., "pan yuan"  wrote:
>>
>>> Versions:
>>>
>>>- Ruby: 2.3.0
>>>- Capistrano: 3.4.0
>>>- Rails: 4.2.5
>>>
>>> Platform:
>>>
>>>- Working on OSX 10.11.13
>>>- Deploying to AWS Ubantu system
>>>
>>> Logs:
>>>
>>>-
>>>- cap production deploy --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 rvm:hook (first_time)
>>>- ** Execute rvm:hook
>>>- ** Invoke rvm:check (first_time)
>>>- ** Execute rvm:check
>>>- DEBUG [ec95a69c] Running ~/.rvm/bin/rvm version as
>>>dep...@52.36.99.18
>>>- DEBUG [ec95a69c] Command: ~/.rvm/bin/rvm version
>>>- cap aborted!
>>>- Net::SSH::AuthenticationFailed: Authentication failed for user
>>>dep...@52.36.99.18
>>>- 
>>> /Users/paul/.rvm/gems/ruby-2.3.0/gems/net-ssh-3.1.1/lib/net/ssh.rb:246:in
>>>`start'
>>>- 
>>> /Users/paul/.rvm/gems/ruby-2.3.0/gems/sshkit-1.9.0/lib/sshkit/backends/connection_pool.rb:59:in
>>>`call'
>>>- 
>>> /Users/paul/.rvm/gems/ruby-2.3.0/gems/sshkit-1.9.0/lib/sshkit/backends/connection_pool.rb:59:in
>>>`with'
>>>- 
>>> /Users/paul/.rvm/gems/ruby-2.3.0/gems/sshkit-1.9.0/lib/sshkit/backends/netssh.rb:134:in
>>>`with_ssh'
>>>- 
>>> /Users/paul/.rvm/gems/ruby-2.3.0/gems/sshkit-1.9.0/lib/sshkit/backends/netssh.rb:87:in
>>>`execute_command'
>>>- 
>>> /Users/paul/.rvm/gems/ruby-2.3.0/gems/sshkit-1.9.0/lib/sshkit/backends/abstract.rb:137:in
>>>`block in create_command_and_execute'
>>>- 
>>> /Users/paul/.rvm/gems/ruby-2.3.0/gems/sshkit-1.9.0/lib/sshkit/backends/abstract.rb:137:in
>>>`tap'
>>>- 
>>> /Users/paul/.rvm/gems/ruby-2.3.0/gems/sshkit-1.9.0/lib/sshkit/backends/abstract.rb:137:in
>>>`create_command_and_execute'
>>>- 
>>> /Users/paul/.rvm/gems/ruby-2.3.0/gems/sshkit-1.9.0/lib/sshkit/backends/abstract.rb:55:in
>>>`capture'
>>>- 
>>> /Users/paul/.rvm/gems/ruby-2.3.0/gems/capistrano-rvm-0.1.2/lib/capistrano/tasks/rvm.rake:9:in
>>>`block (3 levels) in '
>>>- 
>>> /Users/paul/.rvm/gems/ruby-2.3.0/gems/sshkit-1.9.0/lib/sshkit/backends/abstract.rb:29:in
>>>`instance_exec'
>>>- 
>>> /Users/paul/.rvm/gems/ruby-2.3.0/gems/sshkit-1.9.0/lib/sshkit/backends/abstract.rb:29:in
>>>`run'
>>>- 
>>> /Users/paul/.rvm/gems/ruby-2.3.0/gems/sshkit-1.9.0/lib/sshkit/runners/parallel.rb:12:in
>>>`block (2 levels) in execute'
>>>- Tasks: TOP => rvm:check
>>>
>>> Files:
>>>
>>>- Capfile
>>>
>>> # Load DSL and set up stages
>>> require 'capistrano/setup'
>>>
>>> # Include default deployment tasks
>>> require 'capistrano/deploy'
>>> require 'capistrano/bundler'
>>> require 'capistrano/rvm'
>>> require 'capistrano/rails/assets' # for asset handling add
>>> require 'capistrano/rails/migrations' # for running migrations
>>> require 'capistrano/puma'
>>>
>>> # Load custom tasks from `lib/capistrano/tasks` if you have any defined
>>> Dir.glob('lib/capistrano/tasks/*.rake').each { |r| import r }
>>>
>>>
>>>- deploy.rb
>>>
>>> # config valid only for current version of Capistrano
>>> lock '3.4.0'
>>>
>>> set :application, 'Inventory Api'
>>> set :repo_url, 'g...@github.com:ypan887/inventory_api.git' # Edit this
>>> to match your repository
>>> set :branch, :master
>>> set :deploy_to, '/home/deploy/inventory_api'
>>> set :pty, true
>>> set :linked_files, %w{config/database.yml config/application.yml}
>>> set :linked_dirs, %w{bin log tmp/pids tmp/cache tmp/sockets
>>> vendor/bundle public/system public/uploads}
>>> set :keep_releases, 5
>>> set :rvm_type, :user
>>> set :rvm_ruby_version, 'ruby-2.3.0' # Edit this if you are using MRI Ruby
>>>
>>> set :puma_rackup, -> { File.join(current_path, 'config.ru') }
>>> set :puma_state, "#{shared_path}/tmp/pids/puma.state"
>>> set :puma_pid, "#{shared_path}/tmp/pids/puma.pid"
>>> set :puma_bind, "unix://#{shared_path}/tmp/sockets/puma.sock"#accept
>>> array for multi-bind
>>> set :puma_conf, "#{shared_path}/puma.rb"
>>> set :puma_access_log, 

Re: [capistrano-mailing-list] Fail on rvm:check

2016-03-31 Thread pan yuan
Yeah, I have just read it. Perhaps it's too advance to me, I could see any 
clue from that article. It just seems that my deployment stuck at 
rvm:check. I don't know what rvm:check is asking. I see the remote server 
has the rvm and ruby installed correctly.

在 2016年3月29日星期二 UTC-7下午11:07:33,Lee Hambley写道:
>
> Have you read this? 
> http://capistranorb.com/documentation/faq/why-does-something-work-in-my-ssh-session-but-not-in-capistrano/
>
> (sent from my phone, please excuse typos)
> On 30 Mar 2016 7:58 a.m., "pan yuan"  
> wrote:
>
>> Versions:
>>
>>- Ruby: 2.3.0
>>- Capistrano: 3.4.0
>>- Rails: 4.2.5
>>
>> Platform:
>>
>>- Working on OSX 10.11.13
>>- Deploying to AWS Ubantu system
>>
>> Logs:
>>
>>- 
>>- cap production deploy --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 rvm:hook (first_time)
>>- ** Execute rvm:hook
>>- ** Invoke rvm:check (first_time)
>>- ** Execute rvm:check
>>- DEBUG [ec95a69c] Running ~/.rvm/bin/rvm version as 
>>dep...@52.36.99.18 
>>- DEBUG [ec95a69c] Command: ~/.rvm/bin/rvm version
>>- cap aborted!
>>- Net::SSH::AuthenticationFailed: Authentication failed for user 
>>dep...@52.36.99.18 
>>- 
>> /Users/paul/.rvm/gems/ruby-2.3.0/gems/net-ssh-3.1.1/lib/net/ssh.rb:246:in 
>>`start'
>>- 
>> /Users/paul/.rvm/gems/ruby-2.3.0/gems/sshkit-1.9.0/lib/sshkit/backends/connection_pool.rb:59:in
>>  
>>`call'
>>- 
>> /Users/paul/.rvm/gems/ruby-2.3.0/gems/sshkit-1.9.0/lib/sshkit/backends/connection_pool.rb:59:in
>>  
>>`with'
>>- 
>> /Users/paul/.rvm/gems/ruby-2.3.0/gems/sshkit-1.9.0/lib/sshkit/backends/netssh.rb:134:in
>>  
>>`with_ssh'
>>- 
>> /Users/paul/.rvm/gems/ruby-2.3.0/gems/sshkit-1.9.0/lib/sshkit/backends/netssh.rb:87:in
>>  
>>`execute_command'
>>- 
>> /Users/paul/.rvm/gems/ruby-2.3.0/gems/sshkit-1.9.0/lib/sshkit/backends/abstract.rb:137:in
>>  
>>`block in create_command_and_execute'
>>- 
>> /Users/paul/.rvm/gems/ruby-2.3.0/gems/sshkit-1.9.0/lib/sshkit/backends/abstract.rb:137:in
>>  
>>`tap'
>>- 
>> /Users/paul/.rvm/gems/ruby-2.3.0/gems/sshkit-1.9.0/lib/sshkit/backends/abstract.rb:137:in
>>  
>>`create_command_and_execute'
>>- 
>> /Users/paul/.rvm/gems/ruby-2.3.0/gems/sshkit-1.9.0/lib/sshkit/backends/abstract.rb:55:in
>>  
>>`capture'
>>- 
>> /Users/paul/.rvm/gems/ruby-2.3.0/gems/capistrano-rvm-0.1.2/lib/capistrano/tasks/rvm.rake:9:in
>>  
>>`block (3 levels) in '
>>- 
>> /Users/paul/.rvm/gems/ruby-2.3.0/gems/sshkit-1.9.0/lib/sshkit/backends/abstract.rb:29:in
>>  
>>`instance_exec'
>>- 
>> /Users/paul/.rvm/gems/ruby-2.3.0/gems/sshkit-1.9.0/lib/sshkit/backends/abstract.rb:29:in
>>  
>>`run'
>>- 
>> /Users/paul/.rvm/gems/ruby-2.3.0/gems/sshkit-1.9.0/lib/sshkit/runners/parallel.rb:12:in
>>  
>>`block (2 levels) in execute'
>>- Tasks: TOP => rvm:check
>>
>> Files:
>>
>>- Capfile
>>
>> # Load DSL and set up stages
>> require 'capistrano/setup'
>>
>> # Include default deployment tasks
>> require 'capistrano/deploy'
>> require 'capistrano/bundler'
>> require 'capistrano/rvm'
>> require 'capistrano/rails/assets' # for asset handling add
>> require 'capistrano/rails/migrations' # for running migrations
>> require 'capistrano/puma'
>>
>> # Load custom tasks from `lib/capistrano/tasks` if you have any defined
>> Dir.glob('lib/capistrano/tasks/*.rake').each { |r| import r }
>>
>>
>>- deploy.rb
>>
>> # config valid only for current version of Capistrano
>> lock '3.4.0'
>>
>> set :application, 'Inventory Api'
>> set :repo_url, 'g...@github.com:ypan887/inventory_api.git' # Edit this to 
>> match your repository
>> set :branch, :master
>> set :deploy_to, '/home/deploy/inventory_api'
>> set :pty, true
>> set :linked_files, %w{config/database.yml config/application.yml}
>> set :linked_dirs, %w{bin log tmp/pids tmp/cache tmp/sockets vendor/bundle 
>> public/system public/uploads}
>> set :keep_releases, 5
>> set :rvm_type, :user
>> set :rvm_ruby_version, 'ruby-2.3.0' # Edit this if you are using MRI Ruby
>>
>> set :puma_rackup, -> { File.join(current_path, 'config.ru') }
>> set :puma_state, "#{shared_path}/tmp/pids/puma.state"
>> set :puma_pid, "#{shared_path}/tmp/pids/puma.pid"
>> set :puma_bind, "unix://#{shared_path}/tmp/sockets/puma.sock"#accept 
>> array for multi-bind
>> set :puma_conf, "#{shared_path}/puma.rb"
>> set :puma_access_log, "#{shared_path}/log/puma_error.log"
>> set :puma_error_log, "#{shared_path}/log/puma_access.log"
>> set :puma_role, :app
>> set :puma_env, fetch(:rack_env, fetch(:rails_env, 'production'))
>> set :puma_threads, [0, 8]
>> set :puma_workers, 0
>> set :puma_worker_timeout, nil
>> set :puma_init_active_record, true
>> set :puma_preload_app, false
>>
>> 

Re: [capistrano-mailing-list] Fail on rvm:check

2016-03-30 Thread Lee Hambley
Have you read this?
http://capistranorb.com/documentation/faq/why-does-something-work-in-my-ssh-session-but-not-in-capistrano/

(sent from my phone, please excuse typos)
On 30 Mar 2016 7:58 a.m., "pan yuan"  wrote:

> Versions:
>
>- Ruby: 2.3.0
>- Capistrano: 3.4.0
>- Rails: 4.2.5
>
> Platform:
>
>- Working on OSX 10.11.13
>- Deploying to AWS Ubantu system
>
> Logs:
>
>-
>- cap production deploy --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 rvm:hook (first_time)
>- ** Execute rvm:hook
>- ** Invoke rvm:check (first_time)
>- ** Execute rvm:check
>- DEBUG [ec95a69c] Running ~/.rvm/bin/rvm version as deploy@52.36.99.18
>- DEBUG [ec95a69c] Command: ~/.rvm/bin/rvm version
>- cap aborted!
>- Net::SSH::AuthenticationFailed: Authentication failed for user
>deploy@52.36.99.18
>- /Users/paul/.rvm/gems/ruby-2.3.0/gems/net-ssh-3.1.1/lib/net/ssh.rb:246:in
>`start'
>- 
> /Users/paul/.rvm/gems/ruby-2.3.0/gems/sshkit-1.9.0/lib/sshkit/backends/connection_pool.rb:59:in
>`call'
>- 
> /Users/paul/.rvm/gems/ruby-2.3.0/gems/sshkit-1.9.0/lib/sshkit/backends/connection_pool.rb:59:in
>`with'
>- 
> /Users/paul/.rvm/gems/ruby-2.3.0/gems/sshkit-1.9.0/lib/sshkit/backends/netssh.rb:134:in
>`with_ssh'
>- 
> /Users/paul/.rvm/gems/ruby-2.3.0/gems/sshkit-1.9.0/lib/sshkit/backends/netssh.rb:87:in
>`execute_command'
>- 
> /Users/paul/.rvm/gems/ruby-2.3.0/gems/sshkit-1.9.0/lib/sshkit/backends/abstract.rb:137:in
>`block in create_command_and_execute'
>- 
> /Users/paul/.rvm/gems/ruby-2.3.0/gems/sshkit-1.9.0/lib/sshkit/backends/abstract.rb:137:in
>`tap'
>- 
> /Users/paul/.rvm/gems/ruby-2.3.0/gems/sshkit-1.9.0/lib/sshkit/backends/abstract.rb:137:in
>`create_command_and_execute'
>- 
> /Users/paul/.rvm/gems/ruby-2.3.0/gems/sshkit-1.9.0/lib/sshkit/backends/abstract.rb:55:in
>`capture'
>- 
> /Users/paul/.rvm/gems/ruby-2.3.0/gems/capistrano-rvm-0.1.2/lib/capistrano/tasks/rvm.rake:9:in
>`block (3 levels) in '
>- 
> /Users/paul/.rvm/gems/ruby-2.3.0/gems/sshkit-1.9.0/lib/sshkit/backends/abstract.rb:29:in
>`instance_exec'
>- 
> /Users/paul/.rvm/gems/ruby-2.3.0/gems/sshkit-1.9.0/lib/sshkit/backends/abstract.rb:29:in
>`run'
>- 
> /Users/paul/.rvm/gems/ruby-2.3.0/gems/sshkit-1.9.0/lib/sshkit/runners/parallel.rb:12:in
>`block (2 levels) in execute'
>- Tasks: TOP => rvm:check
>
> Files:
>
>- Capfile
>
> # Load DSL and set up stages
> require 'capistrano/setup'
>
> # Include default deployment tasks
> require 'capistrano/deploy'
> require 'capistrano/bundler'
> require 'capistrano/rvm'
> require 'capistrano/rails/assets' # for asset handling add
> require 'capistrano/rails/migrations' # for running migrations
> require 'capistrano/puma'
>
> # Load custom tasks from `lib/capistrano/tasks` if you have any defined
> Dir.glob('lib/capistrano/tasks/*.rake').each { |r| import r }
>
>
>- deploy.rb
>
> # config valid only for current version of Capistrano
> lock '3.4.0'
>
> set :application, 'Inventory Api'
> set :repo_url, 'g...@github.com:ypan887/inventory_api.git' # Edit this to
> match your repository
> set :branch, :master
> set :deploy_to, '/home/deploy/inventory_api'
> set :pty, true
> set :linked_files, %w{config/database.yml config/application.yml}
> set :linked_dirs, %w{bin log tmp/pids tmp/cache tmp/sockets vendor/bundle
> public/system public/uploads}
> set :keep_releases, 5
> set :rvm_type, :user
> set :rvm_ruby_version, 'ruby-2.3.0' # Edit this if you are using MRI Ruby
>
> set :puma_rackup, -> { File.join(current_path, 'config.ru') }
> set :puma_state, "#{shared_path}/tmp/pids/puma.state"
> set :puma_pid, "#{shared_path}/tmp/pids/puma.pid"
> set :puma_bind, "unix://#{shared_path}/tmp/sockets/puma.sock"#accept
> array for multi-bind
> set :puma_conf, "#{shared_path}/puma.rb"
> set :puma_access_log, "#{shared_path}/log/puma_error.log"
> set :puma_error_log, "#{shared_path}/log/puma_access.log"
> set :puma_role, :app
> set :puma_env, fetch(:rack_env, fetch(:rails_env, 'production'))
> set :puma_threads, [0, 8]
> set :puma_workers, 0
> set :puma_worker_timeout, nil
> set :puma_init_active_record, true
> set :puma_preload_app, false
>
> namespace :deploy do
>
>   after :restart, :clear_cache do
> on roles(:web), in: :groups, limit: 3, wait: 10 do
>   # Here we can do anything such as:
>   # within release_path do
>   #   execute :rake, 'cache:clear'
>   # end
> end
>   end
>
> end
>
>
>- Stage files (production.rb, staging.rb)
>
> server '52.36.99.18', user: 'deploy', roles: %w{web app db}
>
>
>
> My deployment stops at Execute rvm:check everytime. While checking the
> rvm on server I can see that rvm and ruby was installed on