【问题标题】:Rails capistrano nginx error with deployRails capistrano nginx 部署错误
【发布时间】:2016-10-08 17:55:25
【问题描述】:

我也遇到了同样的问题...

这是我的错误:

/home/deploy/.rvm/gems/ruby-2.3.1/gems/capistrano-3.1.0/lib/capistrano/i18n.rb:4:警告:key :starting 在第 6 行被复制和覆盖 未设置阶段,请致电cap production deploy,其中生产是您定义的阶段。

这是我使用的教程:https://gorails.com/deploy/ubuntu/14.04#ruby

这是我的 capfile,

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

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

1# 如果您有任何定义,则从 `lib/capistrano/tasks' 加载自定义任务。 Dir.glob('lib/capistrano/tasks/*.cap').each { |r|导入 }

这是我的 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;
 }

我不知道我必须提供更多... 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

宝石文件

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

【问题讨论】:

    标签: ruby-on-rails ruby nginx


    【解决方案1】:

    我会尝试删除 Gemfile 中的 Capistrano 插件版本限制:

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

    然后运行bundle update

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2016-01-02
      • 1970-01-01
      • 1970-01-01
      • 2013-01-24
      • 1970-01-01
      相关资源
      最近更新 更多