2016-03-01 55 views
1

我最近在我的应用程序中添加了美洲狮,以获得更好的heroku性能。我的应用效果良好的生产(实时)环境中,但我在我的本地环境中获取和错误..本地服务器中的美洲狮错误

错误,当我尝试启动我的服务器:

Art [email protected] ~/desktop/drinkPGH (master) 
$ rails s 
=> Booting Puma 
=> Rails 4.1.8 application starting in development on http://0.0.0.0:3000 
=> Run `rails server -h` for more startup options 
=> Notice: server is listening on all interfaces (0.0.0.0). Consider using 127.0.0.1 (--binding option) 
=> Ctrl-C to shutdown server 
[11868] *** SIGUSR2 not implemented, signal based restart unavailable! 
[11868] *** SIGUSR1 not implemented, signal based restart unavailable! 
[11868] *** SIGHUP not implemented, signal based logs reopening unavailable! 
[11868] Puma starting in cluster mode... 
[11868] * Version 3.0.2 (ruby 2.1.5-p273), codename: Plethora of Penguin Pinatas 
[11868] * Min threads: 5, max threads: 5 
[11868] * Environment: development 
[11868] * Process workers: 2 
[11868] * Preloading application 
[11868] * Listening on tcp://0.0.0.0:3000 
Exiting 
c:/RailsInstaller/Ruby2.1.0/lib/ruby/gems/2.1.0/gems/puma-3.0.2/lib/puma/cluster.rb:320:in `trap': unsupported signal SIGCHLD (ArgumentError) 
     from c:/RailsInstaller/Ruby2.1.0/lib/ruby/gems/2.1.0/gems/puma-3.0.2/lib/puma/cluster.rb:320:in `setup_signals' 
     from c:/RailsInstaller/Ruby2.1.0/lib/ruby/gems/2.1.0/gems/puma-3.0.2/lib/puma/cluster.rb:389:in `run' 
     from c:/RailsInstaller/Ruby2.1.0/lib/ruby/gems/2.1.0/gems/puma-3.0.2/lib/puma/launcher.rb:173:in `run' 
     from c:/RailsInstaller/Ruby2.1.0/lib/ruby/gems/2.1.0/gems/puma-3.0.2/lib/rack/handler/puma.rb:51:in `run' 
     from c:/RailsInstaller/Ruby2.1.0/lib/ruby/gems/2.1.0/gems/rack-1.5.5/lib/rack/server.rb:264:in `start' 
     from c:/RailsInstaller/Ruby2.1.0/lib/ruby/gems/2.1.0/gems/railties-4.1.8/lib/rails/commands/server.rb:69:in `start' 
     from c:/RailsInstaller/Ruby2.1.0/lib/ruby/gems/2.1.0/gems/railties-4.1.8/lib/rails/commands/commands_tasks.rb:81:in `block in server' 
     from c:/RailsInstaller/Ruby2.1.0/lib/ruby/gems/2.1.0/gems/railties-4.1.8/lib/rails/commands/commands_tasks.rb:76:in `tap' 
     from c:/RailsInstaller/Ruby2.1.0/lib/ruby/gems/2.1.0/gems/railties-4.1.8/lib/rails/commands/commands_tasks.rb:76:in `server' 
     from c:/RailsInstaller/Ruby2.1.0/lib/ruby/gems/2.1.0/gems/railties-4.1.8/lib/rails/commands/commands_tasks.rb:40:in `run_command!' 
     from c:/RailsInstaller/Ruby2.1.0/lib/ruby/gems/2.1.0/gems/railties-4.1.8/lib/rails/commands.rb:17:in `<top (required)>' 
     from bin/rails:4:in `require' 
     from bin/rails:4:in `<main>' 

和我的Gemfile:

source 'https://rubygems.org' 


# Bundle edge Rails instead: gem 'rails', github: 'rails/rails' 
gem 'rails', '4.1.8' 
# Use sqlite3 as the database for Active Record 

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

# Use jquery as the JavaScript library 
gem 'jquery-rails' 
# Turbolinks makes following links in your web application faster. Read more: https://github.com/rails/turbolinks 
gem 'turbolinks' 
# 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 
gem 'bootstrap-sass' 


group :production do 
    gem 'pg' 
    gem 'rails_12factor' 
    gem 'puma' 
end 

group :development, :test do 
    gem 'sqlite3' 

end 

# 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 

# Use debugger 
# gem 'debugger', group: [:development, :test] 

# Windows does not include zoneinfo files, so bundle the tzinfo-data gem 
gem 'tzinfo-data', platforms: [:mingw, :mswin] 

我config.puma

workers Integer(ENV['WEB_CONCURRENCY'] || 2) 
threads_count = Integer(ENV['MAX_THREADS'] || 5) 
threads threads_count, threads_count 

preload_app! 

rackup  DefaultRackup 
port  ENV['PORT']  || 3000 
environment ENV['RACK_ENV'] || 'development' 

on_worker_boot do 
    # Worker specific setup for Rails 4.1+ 
    # See: https://devcenter.heroku.com/articles/deploying-rails-applications-with-the-puma-web-server#on-worker-boot 
    ActiveRecord::Base.establish_connection 
end 
+0

那么你的配置/ puma.rb文件是什么样子? – toddmetheny

+0

发布我的config/puma.rb文件! :) – westman2222

回答

1

不积极,这将解决您的问题。我通常使用工头在本地运行应用程序。轨道的美洲狮文档建议启动您的本地服务器是这样的:

rails s Puma 

它是值得的。

+0

没有工作 – westman2222

+0

张贴我的配置/ puma.rb文件 – westman2222

+0

你在使用什么操作系统?集群模式不适用于每个操作系统。从文档: “平台的限制 由于各种平台不能够实现某些事情的时候彪马在不同的平台上使用会出现以下区别: JRuby中,Windows系统:服务器插槽不在重启无缝的,他们必须关闭并重新打开这些平台无法将描述符传递到暴露于ruby的新进程中 JRuby,Windows:由于缺少fork,所以不支持集群模式(2) Windows:不支持守护进程模式缺乏叉(2)“ – toddmetheny

4
workers Integer(ENV['WEB_CONCURRENCY'] || 2) 

通过评论config/puma.rb的第1行,我能够在开发中运行puma。

workers Integer(ENV['WEB_CONCURRENCY'] || 0) also works 
相关问题