capistrano 部署时出现 fatal: could not read Username for 'https://github.com': No such device or address

2015-04-21 09:24:02 +08:00
 chlotte
主要是从192.168.1.10机器远程获取github.com chlotte库(chlotte库为付费私人仓库),然后通过capistrano部署到192.168.1.50机器的/home/work/local目录;

遇到2个问题,请有经验的同学指导,谢谢!
1,capistrano deploy.rb 配置中已写明github账号与密码,执行cap deploy:update 时还需要输入github账号与密码;
2,执行cap deploy:update 时报错:fatal: could not read Username for 'https://github.com': No such device or address;

capistrano deploy.rb 配置:
root@192.168.1.10:/root/config$ cat deploy.rb
set :application, "chlotte"
set :repository,  "https://github.com/chlotte/chlotte.git"
set :scm_username, "chlotte"
set :scm_password, "Chlotte0927"


set :scm, :git
set :deploy_to, "/home/work/local"
set :normalize_asset_timestamps, false
# Or: `accurev`, `bzr`, `cvs`, `darcs`, `git`, `mercurial`, `perforce`, `subversion` or `none`

role :web, "192.168.1.50"                          # Your HTTP server, Apache/etc
role :app, "192.168.1.50"                          # This may be the same as your `Web` server
role :db,  "192.168.1.50", :primary => true # This is where Rails migrations will run
role :db,  "192.168.1.50"

# if you're still using the script/reaper helper you will need
# these http://github.com/rails/irs_process_scripts

# If you are using Passenger mod_rails uncomment this:
# namespace :deploy do
#   task :start do ; end
#   task :stop do ; end
#   task :restart, :roles => :app, :except => { :no_release => true } do
#     run "#{try_sudo} touch #{File.join(current_path,'tmp','restart.txt')}"
#   end
# end
root@192.168.1.10:/root/config$ 


root@192.168.1.10:/root/config$ cap deploy:setup
root@192.168.1.10:/root/config$ cap deploy:check
root@192.168.1.10:/root/config$ cap deploy:update
  * executing `deploy:update'
 ** transaction: start
  * executing `deploy:update_code'
    executing locally: "git ls-remote https://github.com/chlotte/chlotte.git HEAD"
Username for 'https://github.com': chlotte
Password for 'https://chlotte@github.com': 
    command finished in 10703ms
  * executing "git clone -q  https://github.com/chlotte/chlotte.git /home/work/local/releases/20150420033712 && cd /home/work/local/releases/20150420033712 && git checkout -q -b deploy f9e174f555bc75d9b767ed4a8202622cc5cf9fe8 && (echo f9e174f555bc75d9b767ed4a8202622cc5cf9fe8 > /home/work/local/releases/20150420033712/REVISION)"
    servers: ["192.168.1.50"]
    [192.168.1.50] executing command
 ** [192.168.1.50 :: err] fatal: could not read Username for 'https://github.com': No such device or address
    command finished in 2107ms
*** [deploy:update_code] rolling back
  * executing "rm -rf /home/work/local/releases/20150420033712; true"
    servers: ["192.168.1.50"]
    [192.168.1.50] executing command
    command finished in 12ms
failed: "sh -c 'git clone -q  https://github.com/chlotte/chlotte.git /home/work/local/releases/20150420033712 && cd /home/work/local/releases/20150420033712 && git checkout -q -b deploy f9e174f555bc75d9b767ed4a8202622cc5cf9fe8 && (echo f9e174f555bc75d9b767ed4a8202622cc5cf9fe8 > /home/work/local/releases/20150420033712/REVISION)'" on 192.168.1.50
root@192.168.1.10:/root/config$
2644 次点击
所在节点    问与答
0 条回复

这是一个专为移动设备优化的页面(即为了让你能够在 Google 搜索结果里秒开这个页面),如果你希望参与 V2EX 社区的讨论,你可以继续到 V2EX 上打开本讨论主题的完整版本。

https://www.v2ex.com/t/185130

V2EX 是创意工作者们的社区,是一个分享自己正在做的有趣事物、交流想法,可以遇见新朋友甚至新机会的地方。

V2EX is a community of developers, designers and creative people.

© 2021 V2EX