0

AIDE! Je suis super nouveau à l'AWS et Ruby. J'ai fini d'écrire une application ferroviaire récemment et je veux me déployer sur aws. J'ai été déployé avec succès dans les Aws, mais une fois que j'ouvre le site, il a montré ce 502 bad gatewayDéploiement de Ruby on Rails eb deploy a échoué et 502 badgateway

Le fichier journal se présente comme suit

------------------------------------- 
/var/log/nginx/error.log 
------------------------------------- 
2017/10/09 05:32:35 [warn] 2982#0: conflicting server name "localhost" on 0.0.0.0:80, ignored 
2017/10/09 05:34:52 [crit] 2986#0: *11 connect() to unix:///var/run/puma/my_app.sock failed (2: No such file or directory) while connecting to upstream, client: 172.31.31.26, server: _, request: "GET/HTTP/1.1", upstream: "http://unix:///var/run/puma/my_app.sock:/", host: "production.mmwu8membg.ap-southeast-1.elasticbeanstalk.com" 
2017/10/09 05:34:52 [crit] 2986#0: *11 connect() to unix:///var/run/puma/my_app.sock failed (2: No such file or directory) while connecting to upstream, client: 172.31.31.26, server: _, request: "GET /favicon.ico HTTP/1.1", upstream: "http://unix:///var/run/puma/my_app.sock:/favicon.ico", host: "production.mmwu8membg.ap-southeast-1.elasticbeanstalk.com", referrer: "http://production.mmwu8membg.ap-southeast-1.elasticbeanstalk.com/" 
2017/10/09 05:36:48 [crit] 2986#0: *40 connect() to unix:///var/run/puma/my_app.sock failed (2: No such file or directory) while connecting to upstream, client: 172.31.31.26, server: _, request: "GET/HTTP/1.1", upstream: "http://unix:///var/run/puma/my_app.sock:/", host: "production.mmwu8membg.ap-southeast-1.elasticbeanstalk.com" 
2017/10/09 05:36:48 [crit] 2986#0: *40 connect() to unix:///var/run/puma/my_app.sock failed (2: No such file or directory) while connecting to upstream, client: 172.31.31.26, server: _, request: "GET /favicon.ico HTTP/1.1", upstream: "http://unix:///var/run/puma/my_app.sock:/favicon.ico", host: "production.mmwu8membg.ap-southeast-1.elasticbeanstalk.com", referrer: "http://production.mmwu8membg.ap-southeast-1.elasticbeanstalk.com/" 
2017/10/09 05:37:08 [crit] 2986#0: *40 connect() to unix:///var/run/puma/my_app.sock failed (2: No such file or directory) while connecting to upstream, client: 172.31.31.26, server: _, request: "GET/HTTP/1.1", upstream: "http://unix:///var/run/puma/my_app.sock:/", host: "production.mmwu8membg.ap-southeast-1.elasticbeanstalk.com" 
2017/10/09 05:37:08 [crit] 2986#0: *40 connect() to unix:///var/run/puma/my_app.sock failed (2: No such file or directory) while connecting to upstream, client: 172.31.31.26, server: _, request: "GET /favicon.ico HTTP/1.1", upstream: "http://unix:///var/run/puma/my_app.sock:/favicon.ico", host: "production.mmwu8membg.ap-southeast-1.elasticbeanstalk.com", referrer: "http://production.mmwu8membg.ap-southeast-1.elasticbeanstalk.com/" 
2017/10/09 05:39:56 [crit] 2986#0: *109 connect() to unix:///var/run/puma/my_app.sock failed (2: No such file or directory) while connecting to upstream, client: 172.31.12.115, server: _, request: "GET/HTTP/1.1", upstream: "http://unix:///var/run/puma/my_app.sock:/", host: "production.mmwu8membg.ap-southeast-1.elasticbeanstalk.com" 
2017/10/09 05:39:56 [crit] 2986#0: *109 connect() to unix:///var/run/puma/my_app.sock failed (2: No such file or directory) while connecting to upstream, client: 172.31.12.115, server: _, request: "GET /favicon.ico HTTP/1.1", upstream: "http://unix:///var/run/puma/my_app.sock:/favicon.ico", host: "production.mmwu8membg.ap-southeast-1.elasticbeanstalk.com", referrer: "http://production.mmwu8membg.ap-southeast-1.elasticbeanstalk.com/" 
2017/10/09 05:45:29 [crit] 2986#0: *190 connect() to unix:///var/run/puma/my_app.sock failed (2: No such file or directory) while connecting to upstream, client: 172.31.31.26, server: _, request: "GET/HTTP/1.1", upstream: "http://unix:///var/run/puma/my_app.sock:/", host: "production.mmwu8membg.ap-southeast-1.elasticbeanstalk.com" 
2017/10/09 05:45:29 [crit] 2986#0: *190 connect() to unix:///var/run/puma/my_app.sock failed (2: No such file or directory) while connecting to upstream, client: 172.31.31.26, server: _, request: "GET /favicon.ico HTTP/1.1", upstream: "http://unix:///var/run/puma/my_app.sock:/favicon.ico", host: "production.mmwu8membg.ap-southeast-1.elasticbeanstalk.com", referrer: "http://production.mmwu8membg.ap-southeast-1.elasticbeanstalk.com/" 
2017/10/09 05:47:03 [crit] 2986#0: *215 connect() to unix:///var/run/puma/my_app.sock failed (2: No such file or directory) while connecting to upstream, client: 172.31.31.26, server: _, request: "GET/HTTP/1.1", upstream: "http://unix:///var/run/puma/my_app.sock:/", host: "production.mmwu8membg.ap-southeast-1.elasticbeanstalk.com" 
2017/10/09 05:47:03 [crit] 2986#0: *215 connect() to unix:///var/run/puma/my_app.sock failed (2: No such file or directory) while connecting to upstream, client: 172.31.31.26, server: _, request: "GET /favicon.ico HTTP/1.1", upstream: "http://unix:///var/run/puma/my_app.sock:/favicon.ico", host: "production.mmwu8membg.ap-southeast-1.elasticbeanstalk.com", referrer: "http://production.mmwu8membg.ap-southeast-1.elasticbeanstalk.com/" 
2017/10/09 05:49:33 [crit] 2986#0: *257 connect() to unix:///var/run/puma/my_app.sock failed (2: No such file or directory) while connecting to upstream, client: 172.31.31.26, server: _, request: "GET/HTTP/1.1", upstream: "http://unix:///var/run/puma/my_app.sock:/", host: "production.mmwu8membg.ap-southeast-1.elasticbeanstalk.com" 
2017/10/09 05:49:33 [crit] 2986#0: *257 connect() to unix:///var/run/puma/my_app.sock failed (2: No such file or directory) while connecting to upstream, client: 172.31.31.26, server: _, request: "GET /favicon.ico HTTP/1.1", upstream: "http://unix:///var/run/puma/my_app.sock:/favicon.ico", host: "production.mmwu8membg.ap-southeast-1.elasticbeanstalk.com", referrer: "http://production.mmwu8membg.ap-southeast-1.elasticbeanstalk.com/" 
2017/10/09 05:57:44 [crit] 2986#0: *382 connect() to unix:///var/run/puma/my_app.sock failed (2: No such file or directory) while connecting to upstream, client: 172.31.31.26, server: _, request: "GET/HTTP/1.1", upstream: "http://unix:///var/run/puma/my_app.sock:/", host: "production.mmwu8membg.ap-southeast-1.elasticbeanstalk.com" 
2017/10/09 05:57:44 [crit] 2986#0: *382 connect() to unix:///var/run/puma/my_app.sock failed (2: No such file or directory) while connecting to upstream, client: 172.31.31.26, server: _, request: "GET /favicon.ico HTTP/1.1", upstream: "http://unix:///var/run/puma/my_app.sock:/favicon.ico", host: "production.mmwu8membg.ap-southeast-1.elasticbeanstalk.com", referrer: "http://production.mmwu8membg.ap-southeast-1.elasticbeanstalk.com/" 
2017/10/09 06:01:04 [crit] 2986#0: *433 connect() to unix:///var/run/puma/my_app.sock failed (2: No such file or directory) while connecting to upstream, client: 172.31.31.26, server: _, request: "GET/HTTP/1.1", upstream: "http://unix:///var/run/puma/my_app.sock:/", host: "production.mmwu8membg.ap-southeast-1.elasticbeanstalk.com" 
2017/10/09 06:01:05 [crit] 2986#0: *433 connect() to unix:///var/run/puma/my_app.sock failed (2: No such file or directory) while connecting to upstream, client: 172.31.31.26, server: _, request: "GET /favicon.ico HTTP/1.1", upstream: "http://unix:///var/run/puma/my_app.sock:/favicon.ico", host: "production.mmwu8membg.ap-southeast-1.elasticbeanstalk.com", referrer: "http://production.mmwu8membg.ap-southeast-1.elasticbeanstalk.com/" 
2017/10/09 06:41:06 [crit] 2986#0: *1004 connect() to unix:///var/run/puma/my_app.sock failed (2: No such file or directory) while connecting to upstream, client: 172.31.12.115, server: _, request: "GET/HTTP/1.1", upstream: "http://unix:///var/run/puma/my_app.sock:/", host: "production.mmwu8membg.ap-southeast-1.elasticbeanstalk.com" 
2017/10/09 06:55:29 [crit] 2986#0: *1204 connect() to unix:///var/run/puma/my_app.sock failed (2: No such file or directory) while connecting to upstream, client: 172.31.31.26, server: _, request: "GET/HTTP/1.1", upstream: "http://unix:///var/run/puma/my_app.sock:/", host: "production.mmwu8membg.ap-southeast-1.elasticbeanstalk.com" 
2017/10/09 06:55:29 [crit] 2986#0: *1204 connect() to unix:///var/run/puma/my_app.sock failed (2: No such file or directory) while connecting to upstream, client: 172.31.31.26, server: _, request: "GET /favicon.ico HTTP/1.1", upstream: "http://unix:///var/run/puma/my_app.sock:/favicon.ico", host: "production.mmwu8membg.ap-southeast-1.elasticbeanstalk.com", referrer: "http://production.mmwu8membg.ap-southeast-1.elasticbeanstalk.com/" 
2017/10/09 06:56:53 [crit] 2986#0: *1232 connect() to unix:///var/run/puma/my_app.sock failed (2: No such file or directory) while connecting to upstream, client: 172.31.31.26, server: _, request: "GET/HTTP/1.1", upstream: "http://unix:///var/run/puma/my_app.sock:/", host: "production.mmwu8membg.ap-southeast-1.elasticbeanstalk.com" 

Je ne sais pas ce qui ne va pas ...

J'ai quelques modifications à faire alors j'ai suivi le tutoriel. Il a dit que je pouvais taper la commande « eb déployer » pour appliquer tous les changements, mais cela est le résultat

damonchan:~/workspace (to_testing_site) $ eb deploy 
WARNING: You have uncommitted changes. 
Creating application version archive "app-489a-171009_065119". 
Uploading: [##################################################] 100% Done... 
INFO: Environment update is starting.        
INFO: Deploying new version to instance(s).       
ERROR: [Instance: i-0ed9a5088003a693c] Command failed on instance. Return code: 11 Output: (TRUNCATED)...: command `git clone 
'git://github.com/activerecord-hackery/ransack.git' 
"/opt/rubies/ruby-2.3.4/lib/ruby/gems/2.3.0/cache/bundler/git/ransack-ed28102a2b46bd0d8ac98ce8cee4fd3d73f75680" 
--bare --no-hardlinks --quiet` in directory /var/app/ondeck has failed. 
Hook /opt/elasticbeanstalk/hooks/appdeploy/pre/10_bundle_install.sh failed. For more detail, check /var/log/eb-activity.log using console or EB CLI. 
INFO: Command execution completed on all instances. Summary: [Successful: 0, Failed: 1]. 
ERROR: Unsuccessful command execution on instance id(s) 'i-0ed9a5088003a693c'. Aborting the operation. 
ERROR: Failed to deploy application.         

ERROR: Failed to deploy application. 

Voici mon petit bijou

source 'https://rubygems.org' 

gem 'rails',  '5.0.1' 
gem 'faker',   '1.6.6' 
gem 'will_paginate', '3.1.0' 
gem 'bootstrap-will_paginate', '0.0.10' 
gem 'bcrypt',   '3.1.11' 
gem 'bootstrap-sass', '3.3.6' 
gem 'puma',   '3.4.0' 
gem 'sass-rails', '5.0.6' 
gem 'uglifier',  '3.0.0' 
gem 'coffee-rails', '4.2.1' 
gem 'jquery-rails', '4.1.1' 
gem 'turbolinks', '5.0.1' 
gem 'jbuilder',  '2.4.1' 
gem 'simple_form' 
gem 'validates_timeliness', '~> 4.0' # validate time 
gem 'ransack' # for search function 
gem 'enum_help' # for enum in form 
gem 'thinreports' #for thinreport 
gem 'thinreports-rails' 
gem "paperclip", "~> 5.0.0" # for image upload 
gem 'jquery-ui-rails' 
gem 'jquery-turbolinks' 
gem 'odf-report' 
gem 'rubyXL' 
gem 'foundation-icons-sass-rails' 
gem 'momentjs-rails' 
gem 'bootstrap3-datetimepicker-rails' 
gem "font-awesome-rails" 
gem "simple_calendar", "~> 2.0" 
gem 'whenever', :require => false 

group :development, :test do 
    gem 'sqlite3', '1.3.12' 
    gem 'byebug', '9.0.0', platform: :mri 

end 

group :development do 
    gem 'web-console',   '3.1.1' 
    gem 'listen',    '3.0.8' 
    gem 'spring',    '1.7.2' 
    gem 'spring-watcher-listen', '2.0.0' 
end 

group :test do 
    gem 'rails-controller-testing', '0.1.1' 
    gem 'minitest-reporters',  '1.1.9' 
    gem 'guard',     '2.13.0' 
    gem 'guard-minitest',   '2.4.4' 
end 

group :production do 
    gem 'pg', '0.18.4' 
end 

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

Voici la liste

damonchan:~/workspace (to_testing_site) $ ls -lah 
total 96K 
drwxr-xr-x 25 ubuntu ubuntu 4.0K Oct 9 04:05 ./ 
drwxr-xr-x 43 ubuntu ubuntu 4.0K Oct 9 03:48 ../ 
drwxr-xr-x 3 ubuntu ubuntu 4.0K May 22 05:21 .c9/ 
drwxr-xr-x 2 ubuntu ubuntu 4.0K Oct 9 06:52 .elasticbeanstalk/ 
drwxr-xr-x 8 ubuntu ubuntu 4.0K Oct 9 09:07 .git/ 
-rw-r--r-- 1 ubuntu ubuntu 711 Oct 9 09:38 .gitignore 
-rw-r--r-- 1 ubuntu ubuntu 1.6K Oct 9 04:42 Gemfile 
-rw-r--r-- 1 ubuntu ubuntu 7.6K Oct 9 06:40 Gemfile.lock 
-rw-r--r-- 1 ubuntu ubuntu 1.9K Oct 9 04:05 Guardfile 
-rw-r--r-- 1 ubuntu ubuntu 22 Oct 9 04:05 README.md 
-rw-r--r-- 1 ubuntu ubuntu 478 Oct 9 04:05 README.rdoc 
-rw-r--r-- 1 ubuntu ubuntu 249 Oct 9 04:05 Rakefile 
drwxr-xr-x 17 ubuntu ubuntu 4.0K Oct 9 04:05 app/ 
drwxr-xr-x 2 ubuntu ubuntu 4.0K Oct 9 04:05 bin/ 
drwxr-xr-x 5 ubuntu ubuntu 4.0K Oct 9 04:05 config/ 
-rw-r--r-- 1 ubuntu ubuntu 153 Oct 9 04:05 config.ru 
drwxr-xr-x 3 ubuntu ubuntu 4.0K Oct 9 06:58 db/ 
drwxr-xr-x 5 ubuntu ubuntu 4.0K Oct 9 04:05 lib/ 
drwxr-xr-x 2 ubuntu ubuntu 4.0K Oct 9 04:05 log/ 
drwxr-xr-x 4 ubuntu ubuntu 4.0K Oct 9 04:05 public/ 
drwxr-xr-x 14 ubuntu ubuntu 4.0K Oct 9 04:05 test/ 
drwxr-xr-x 6 ubuntu ubuntu 4.0K May 23 03:43 tmp/ 
drwxr-xr-x 3 ubuntu ubuntu 4.0K Oct 9 04:05 vendor/ 

Répondre

0

Je suppose que vous utilisez Linux et que vous utilisez gedit pour éditer vos fichiers. Dans/etc/nginx/sites-enabled, il se peut qu'il ait quitté un fichier temporaire, par exemple. par défaut ~ (regarder le ~). En fonction de votre éditeur, le fichier peut s'appeler .save ou quelque chose comme ça. Exécutez $ ls -lah pour voir quels fichiers ne sont pas voulus et supprimez-les.

Supprimer ce fichier, et il va résoudre votre problème.

+0

j'ai ajouté liste dans la question, je ne sais pas lequel à supprimer, Ils ont tous l'air important –

+0

Fichiers dans lesquels vous (~) cette marque –

0

Essayez-ing SSH directement sur l'instance (ou le premier du groupe si plus d'une instance) et installer le bijou manuellement

gem install ransack 

il devrait donner plus d'indices