简体   繁体   English

Ruby使用Capistrano问题部署到localhost

[英]Ruby deploy to localhost using Capistrano issue

I am a beginner with Ruby and Rails, and I'm having an issue deploying my Rails app to my localhost. 我是Ruby和Rails的初学者,在将Rails应用程序部署到本地主机时遇到问题。 The issue seems that there is some default config value somewhere, referencing example.com. 问题似乎是在某些地方(参考example.com)有一些默认配置值。

deploy@localhost:/home/user/code/project$ cap production deploy
DEBUG[8b34c0bb] Running /usr/bin/env [ -d ~/.rvm ] on 127.0.0.1
DEBUG[8b34c0bb] Command: [ -d ~/.rvm ]
DEBUG[b62cfdef] Running /usr/bin/env [ -d ~/.rvm ] on example.com
DEBUG[b62cfdef] Command: [ -d ~/.rvm ]
cap aborted!

It fails trying to deploy to example.com (obviously) 尝试部署到example.com失败(很明显)

Where is this config value (file?) so I can get rid of it? 这个配置值(文件?)在哪里,所以我可以摆脱它? I just deploy using Capistrano to localhost! 我只是使用Capistrano部署到本地主机!

EDIT config/deploy.rb 编辑config / deploy.rb

set :application, 'project'
set :repo_url, 'git@github.com:excid3/myapp.git'

set :deploy_to, '/home/deploy/ninja'

set :linked_files, %w{config/database.yml}
set :linked_dirs, %w{bin log tmp/pids tmp/cache tmp/sockets vendor/bundle public/system}

namespace :deploy do

  desc 'Restart application'
  task :restart do
    on roles(:app), in: :sequence, wait: 5 do
      execute :touch, release_path.join('tmp/restart.txt')
    end
  end

  after :finishing, 'deploy:cleanup'
end

The :repo_url might be bogus.. not sure if that is affecting it. :repo_url可能是假的..不确定是否会影响它。

The file is config/deploy.rb inside rails root folder. 该文件位于rails根文件夹内的config / deploy.rb。 That is where the default configuration should be. 这就是默认配置应在的位置。 It is usually something like 通常是这样的

server "www.example.com", :app, :web, :db, :primary => true

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM