简体   繁体   English

Rails Capistrano Nginx部署错误

[英]Rails capistrano nginx error with deploy

I have same trouble with this... 我也有这个麻烦

this is my error : 这是我的错误:

/home/deploy/.rvm/gems/ruby-2.3.1/gems/capistrano-3.1.0/lib/capistrano/i18n.rb:4: warning: key :starting is duplicated and overwritten on line 6 Stage not set, please call something such as cap production deploy , where production is a stage you have defined. /home/deploy/.rvm/gems/ruby-2.3.1/gems/capistrano-3.1.0/lib/capistrano/i18n.rb:4:警告:密钥:开始重复并且在第6行被覆盖,未设置阶段,请调用诸如cap production deploy ,其中生产是您定义的阶段。

This is tutorial what i used : https://gorails.com/deploy/ubuntu/14.04#ruby 这是我使用的教程: https : //gorails.com/deploy/ubuntu/14.04#ruby

This is my capfile, 这是我的花絮

require 'capistrano/setup'
require 'capistrano/deploy'

require 'capistrano/rails'
require 'capistrano/bundler'
require 'capistrano/rvm'
require 'capistrano/puma'

1# Loads custom tasks from `lib/capistrano/tasks' if you have any defined. 1#从`lib / capistrano / tasks'加载自定义任务(如果已定义)。 Dir.glob('lib/capistrano/tasks/*.cap').each { |r| Dir.glob('lib / capistrano / tasks / *。cap')。each {| r | import r } 导入r}

this is my nginx.conf : 这是我的nginx.conf:

upstream puma {
server unix:///home/deploy/ipass/shared/tmp/sockets/appname-puma.sock;
  }

server {
listen 80 default_server deferred;
1# server_name example.com;

 root /home/deploy/ipass/current/public;
 access_log /home/deploy/ipass/current/log/nginx.access.log;
 error_log /home/deploy/ipass/current/log/nginx.error.log info;

 location ^~ /assets/ {
   gzip_static on;
  expires max;
  add_header Cache-Control public;
   }

 try_files $uri/index.html $uri @puma;
location @puma {
  proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
  proxy_set_header Host $http_host;
  proxy_redirect off;

  proxy_pass http://puma;
}

error_page 500 502 503 504 /500.html;
client_max_body_size 10M;
keepalive_timeout 10;
 }

I dont know what i must give more... mb my database.yml 我不知道我该给些什么... mb my database.yml

database.yml 数据库

    default: &default
    adapter: mysql2
    encoding: utf8
    pool: 5
    username: root
    password: htmlkoi8r
    socket: /var/run/mysqld/mysqld.sock

  development:
    <<: *default
    database: ipass_dev
  test:
    <<: *default
    database: ipass_test


  production:
    <<: *default
    database: ipass_production

gemfile 宝石文件

source 'https://rubygems.org'


            # Bundle edge Rails instead: gem 'rails', github: 'rails/rails'
            gem 'rails', '4.2.6'

            # Servers
            gem 'puma'
            gem 'unicorn'

            # AUTH
            gem 'devise'
            gem 'cancancan', '~> 1.10'


            # Translation gems
            gem 'russian', '~> 0.6.0'

            # ORM
            gem 'mysql2', '0.4.4'
            # gem 'pg'
            gem 'seed_dump'
            # gem 'ar-octopus'
            # gem 'redis-rails'
            # gem 'redis'

            # Admin Panel
            gem 'rails_admin'
            gem 'rails_admin_flatly_theme', github: 'konjoot/rails_admin_flatly_theme'

            # Forms
            gem 'simple_form'
            #gem 'tinymce-rails'
            #gem 'tinymce-rails-langs'


            # Mail and contacts
            gem 'mail_form'

            # Other gems
            gem 'slim'  #htmlslim



            # Use SCSS for stylesheets
            gem 'sass-rails', '~> 5.0'
            # Use Uglifier as compressor for JavaScript assets
            gem 'uglifier', '>= 1.3.0'
            # Use CoffeeScript for .coffee assets and views
            gem 'coffee-rails', '~> 4.1.0'
            # See https://github.com/rails/execjs#readme for more supported runtimes
            # gem 'therubyracer', platforms: :ruby

            # Use jquery as the JavaScript library
            gem 'jquery-rails'
            # Build JSON APIs with ease. Read more: https://github.com/rails/jbuilder
            gem 'jbuilder', '~> 2.0'
            # bundle exec rake doc:rails generates the API under doc/api.
            gem 'sdoc', '~> 0.4.0', group: :doc

            # Use ActiveModel has_secure_password
            # gem 'bcrypt', '~> 3.1.7'

            # Use Unicorn as the app server
            # gem 'unicorn'

            # Use Capistrano for deployment
            # gem 'capistrano-rails', group: :development

            gem 'capistrano', '~> 3.1.0'
            gem 'capistrano-bundler', '~> 1.1.2'
            gem 'capistrano-rails', '~> 1.1.1'
            gem 'capistrano-rvm', github: "capistrano/rvm"
            # Add this if you're using rbenv
            # gem 'capistrano-rbenv', github: "capistrano/rbenv"



            group :development, :test do
              # Call 'byebug' anywhere in the code to stop execution and get a debugger console
              gem 'byebug'
            end

            group :development do
              # Access an IRB console on exception pages or by using <%= console %> in views
              gem 'web-console', '~> 2.0'

              # Spring speeds up development by keeping your application running in the background. Read more: https://github.com/rails/spring
              gem 'spring'
            end

I would try removing Capistrano plugins versions constraints in the Gemfile: 我会尝试删除Gemfile中的Capistrano插件版本约束:

gem 'capistrano'
gem 'capistrano-bundler'
gem 'capistrano-rails'
gem 'capistrano-rvm'

And then run bundle update 然后运行bundle update

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

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