use*_*143 8 deployment capistrano ruby-on-rails github
我已经使用github和capistrano将我的Rails 4应用程序部署到Rackspace几周了.一切正常,直到我最终使我的存储库私有化.现在,我在运行'cap deploy'后收到以下错误:
"致命:无法读取' https://username@github.com '的密码:没有这样的设备或地址"
以下是我的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
Run Code Online (Sandbox Code Playgroud)
我已尝试使用和不使用github存储库名称前面的用户名.如果它在那里,我从上面收到密码错误,但如果它不存在,我收到以下错误:
"致命:无法读取' https://github.com '的用户名:没有这样的设备或地址"
知道问题是什么吗?我假设它与我改变私有存储库有关.我已经阅读了一些关于使用ssh的内容,但也读过没有.
任何建议或帮助将不胜感激!
use*_*143 19
所以,我明白了.为了在Github上使用私有仓库使用https进行部署,您需要使用Github的OAuth API.在您的github帐户的编辑配置文件下,单击应用程序,然后生成OAuth令牌.然后,将您的令牌添加到您的repo url,如下所示:
set :repository, "https://<OAuthToken>@github.com/username/application.git"
Run Code Online (Sandbox Code Playgroud)
在那之后,我能跑了
cap deploy
Run Code Online (Sandbox Code Playgroud)
并将我的应用程序部署到我的远程服务器
mik*_*ana 15
错误消息是一般的git错误,尽管问题本身是特定于Ruby的.
所以对于落在这里的其他人来说,这是一个非铁路的答案:缺少的设备实际上是一个控制台.
修复#1,因为您可能不希望在部署期间以交互方式进行身份验证.就我而言,这是一个github oauth问题.
| 归档时间: |
|
| 查看次数: |
15965 次 |
| 最近记录: |