我已经使用github和capistrano将我的Rails 4应用程序部署到了Rackspace上几个星期了。一切都很正常,直到我最终将我的代码库设为私有。现在,在运行“cap deploy”后,我收到以下错误:
"fatal: could not read Password for 'https://username@github.com': No such device or address"
以下是我的deploy.rb文件中的代码:
set :application, "appname"
set :repository, "https://git_username@github.com/git_username/appname.git"
set :scm, :git
set :scm_username, "git_username"
set :scm_passphrase, "git_password"
set :scm_command, "git"
set :keep_releases, 5
set :branch, "master"
set :rails_env, "production"
set :deploy_to, "/var/www/doLocal"
set :user, "deployer"
set :password, "deployer_password"
set :use_sudo, false
ssh_options[:forward_agent] = true
server "/path/to/server", :app, :web, :db, :primary => true
after "deploy:restart", "deploy:cleanup"
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
我已尝试在 github 仓库名称前加上用户名和不加用户名两种方式,如果加了用户名,则会收到上述密码错误的错误信息,而如果不加用户名,则会收到以下错误信息:
"fatal: could not read Username for 'https://github.com': No such device or address"
您有什么想法?我猜这可能与我更改为私有存储库有关。我已经阅读了一些有关使用 ssh 的内容,但也看到了不要使用 ssh。
任何建议或帮助将不胜感激!
https://user@github.com/username/repo.git
? - VonC