Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Problem local testing Vagrant/Rails Server #425

Closed
Intimaria opened this issue Jan 15, 2018 · 23 comments
Closed

Problem local testing Vagrant/Rails Server #425

Intimaria opened this issue Jan 15, 2018 · 23 comments

Comments

@Intimaria
Copy link
Contributor

Intimaria commented Jan 15, 2018

Hi, I have tried to set up a local testing environment now both with vagrant on a friend's machine and with the rails server (as per @stardust66's instructions in #413 ) and I have gotten the same error messages. I have a feeling it has to do with the way my local git repo is doing but I would really love someone to give me a hand with it as I want to get it going. These are the error messages which are on my machine which are very similar to the ones on my friend's machine running vagrant and VB (which I don't have access to right now)

I was surprised to get the same error messages on both machines

Some are related to invalid locale data , which I suspect has to do with recent changes regarding translation which may not be correctly up to date on my local system,
However, not sure whether that, or the deprecation warnings or, invalid API key are the real problem. Or something else? Thank you!

Here is the full error message on terminal after trying to run rails server:


No valid API key has been set, notifications will not be sent
DEPRECATION WARNING: ActiveSupport.halt_callback_chains_on_return_false= is deprecated and will be removed in Rails 5.2. (called from <top (required)> at /Users/make/Development/git/refugerestrooms/config/initializers/new_framework_defaults.rb:23)
Not notifying due to an invalid api_key
rake aborted!
I18n::InvalidLocaleData: can not load translations from /Users/make/Development/git/refugerestrooms/config/locales/es/business_info.es.yml: #<Psych::SyntaxError: (/Users/make/Development/git/refugerestrooms/config/locales/es/business_info.es.yml): did not find expected key while parsing a block mapping at line 3 column 5>
/Users/make/Development/git/refugerestrooms/app/admin/admin_user.rb:1:in `<top (required)>'
/Users/make/Development/git/refugerestrooms/config/routes.rb:5:in `block in <top (required)>'
/Users/make/Development/git/refugerestrooms/config/routes.rb:1:in `<top (required)>'
/Users/make/Development/git/refugerestrooms/config/environment.rb:5:in `<top (required)>'

Caused by:
Psych::SyntaxError: (/Users/make/Development/git/refugerestrooms/config/locales/es/business_info.es.yml): did not find expected key while parsing a block mapping at line 3 column 5
/Users/make/Development/git/refugerestrooms/app/admin/admin_user.rb:1:in `<top (required)>'
/Users/make/Development/git/refugerestrooms/config/routes.rb:5:in `block in <top (required)>'
/Users/make/Development/git/refugerestrooms/config/routes.rb:1:in `<top (required)>'
/Users/make/Development/git/refugerestrooms/config/environment.rb:5:in `<top (required)>'
Tasks: TOP => db:migrate => environment
(See full trace by running task with --trace)
make:refugerestrooms make$ rails server 
=> Booting WEBrick
=> Rails 5.1.4 application starting in development on http://localhost:3000
=> Run `rails server -h` for more startup options
No valid API key has been set, notifications will not be sent
DEPRECATION WARNING: ActiveSupport.halt_callback_chains_on_return_false= is deprecated and will be removed in Rails 5.2. (called from <top (required)> at /Users/make/Development/git/refugerestrooms/config/initializers/new_framework_defaults.rb:23)
Exiting
/Users/make/.rbenv/versions/2.3.1/lib/ruby/gems/2.3.0/gems/i18n-0.8.6/lib/i18n/backend/base.rb:212:in `rescue in load_yml': can not load translations from /Users/make/Development/git/refugerestrooms/config/locales/es/business_info.es.yml: #<Psych::SyntaxError: (/Users/make/Development/git/refugerestrooms/config/locales/es/business_info.es.yml): did not find expected key while parsing a block mapping at line 3 column 5> (I18n::InvalidLocaleData)
	from /Users/make/.rbenv/versions/2.3.1/lib/ruby/gems/2.3.0/gems/i18n-0.8.6/lib/i18n/backend/base.rb:209:in `load_yml'
	from /Users/make/.rbenv/versions/2.3.1/lib/ruby/gems/2.3.0/gems/i18n-0.8.6/lib/i18n/backend/base.rb:193:in `load_file'
	from /Users/make/.rbenv/versions/2.3.1/lib/ruby/gems/2.3.0/gems/i18n-0.8.6/lib/i18n/backend/base.rb:15:in `block in load_translations'
	from /Users/make/.rbenv/versions/2.3.1/lib/ruby/gems/2.3.0/gems/i18n-0.8.6/lib/i18n/backend/base.rb:15:in `each'
	from /Users/make/.rbenv/versions/2.3.1/lib/ruby/gems/2.3.0/gems/i18n-0.8.6/lib/i18n/backend/base.rb:15:in `load_translations'
	from /Users/make/.rbenv/versions/2.3.1/lib/ruby/gems/2.3.0/gems/i18n-0.8.6/lib/i18n/backend/simple.rb:57:in `init_translations'
	from /Users/make/.rbenv/versions/2.3.1/lib/ruby/gems/2.3.0/gems/i18n-0.8.6/lib/i18n/backend/simple.rb:40:in `available_locales'
	from /Users/make/.rbenv/versions/2.3.1/lib/ruby/gems/2.3.0/gems/i18n-0.8.6/lib/i18n/config.rb:43:in `available_locales'
	from /Users/make/.rbenv/versions/2.3.1/lib/ruby/gems/2.3.0/gems/i18n-0.8.6/lib/i18n/config.rb:49:in `available_locales_set'
	from /Users/make/.rbenv/versions/2.3.1/lib/ruby/gems/2.3.0/gems/i18n-0.8.6/lib/i18n.rb:278:in `locale_available?'
	from /Users/make/.rbenv/versions/2.3.1/lib/ruby/gems/2.3.0/gems/i18n-0.8.6/lib/i18n.rb:284:in `enforce_available_locales!'
	from /Users/make/.rbenv/versions/2.3.1/lib/ruby/gems/2.3.0/gems/i18n-0.8.6/lib/i18n.rb:151:in `translate'
	from /Users/make/.rbenv/versions/2.3.1/lib/ruby/gems/2.3.0/gems/activeadmin-1.0.0/lib/active_admin/filters/resource_extension.rb:155:in `search_status_section'
	from /Users/make/.rbenv/versions/2.3.1/lib/ruby/gems/2.3.0/gems/activeadmin-1.0.0/lib/active_admin/filters/resource_extension.rb:151:in `add_search_status_sidebar_section'
	from /Users/make/.rbenv/versions/2.3.1/lib/ruby/gems/2.3.0/gems/activeadmin-1.0.0/lib/active_admin/filters/resource_extension.rb:17:in `initialize'
	from /Users/make/.rbenv/versions/2.3.1/lib/ruby/gems/2.3.0/gems/activeadmin-1.0.0/lib/active_admin/batch_actions/resource_extension.rb:6:in `initialize'
	from /Users/make/.rbenv/versions/2.3.1/lib/ruby/gems/2.3.0/gems/activeadmin-1.0.0/lib/active_admin/namespace.rb:187:in `new'
	from /Users/make/.rbenv/versions/2.3.1/lib/ruby/gems/2.3.0/gems/activeadmin-1.0.0/lib/active_admin/namespace.rb:187:in `find_or_build_resource'
	from /Users/make/.rbenv/versions/2.3.1/lib/ruby/gems/2.3.0/gems/activeadmin-1.0.0/lib/active_admin/namespace.rb:48:in `register'
	from /Users/make/.rbenv/versions/2.3.1/lib/ruby/gems/2.3.0/gems/activeadmin-1.0.0/lib/active_admin/application.rb:173:in `register'
	from /Users/make/.rbenv/versions/2.3.1/lib/ruby/gems/2.3.0/gems/activeadmin-1.0.0/lib/active_admin.rb:76:in `register'
	from /Users/make/Development/git/refugerestrooms/app/admin/admin_user.rb:1:in `<top (required)>'
	from /Users/make/.rbenv/versions/2.3.1/lib/ruby/gems/2.3.0/gems/activesupport-5.1.4/lib/active_support/dependencies.rb:286:in `load'
	from /Users/make/.rbenv/versions/2.3.1/lib/ruby/gems/2.3.0/gems/activesupport-5.1.4/lib/active_support/dependencies.rb:286:in `block in load'
	from /Users/make/.rbenv/versions/2.3.1/lib/ruby/gems/2.3.0/gems/activesupport-5.1.4/lib/active_support/dependencies.rb:258:in `load_dependency'
	from /Users/make/.rbenv/versions/2.3.1/lib/ruby/gems/2.3.0/gems/activesupport-5.1.4/lib/active_support/dependencies.rb:286:in `load'
	from /Users/make/.rbenv/versions/2.3.1/lib/ruby/gems/2.3.0/gems/activeadmin-1.0.0/lib/active_admin/application.rb:231:in `block in load'
	from /Users/make/.rbenv/versions/2.3.1/lib/ruby/gems/2.3.0/gems/activeadmin-1.0.0/lib/active_admin/error.rb:41:in `capture'
	from /Users/make/.rbenv/versions/2.3.1/lib/ruby/gems/2.3.0/gems/activeadmin-1.0.0/lib/active_admin/application.rb:231:in `load'
	from /Users/make/.rbenv/versions/2.3.1/lib/ruby/gems/2.3.0/gems/activeadmin-1.0.0/lib/active_admin/application.rb:223:in `block in load!'
	from /Users/make/.rbenv/versions/2.3.1/lib/ruby/gems/2.3.0/gems/activeadmin-1.0.0/lib/active_admin/application.rb:223:in `each'
	from /Users/make/.rbenv/versions/2.3.1/lib/ruby/gems/2.3.0/gems/activeadmin-1.0.0/lib/active_admin/application.rb:223:in `load!'
	from /Users/make/.rbenv/versions/2.3.1/lib/ruby/gems/2.3.0/gems/activeadmin-1.0.0/lib/active_admin/application.rb:245:in `routes'
	from /Users/make/.rbenv/versions/2.3.1/lib/ruby/gems/2.3.0/gems/activeadmin-1.0.0/lib/active_admin.rb:80:in `routes'
	from /Users/make/Development/git/refugerestrooms/config/routes.rb:5:in `block in <top (required)>'
	from /Users/make/.rbenv/versions/2.3.1/lib/ruby/gems/2.3.0/gems/actionpack-5.1.4/lib/action_dispatch/routing/route_set.rb:426:in `instance_exec'
	from /Users/make/.rbenv/versions/2.3.1/lib/ruby/gems/2.3.0/gems/actionpack-5.1.4/lib/action_dispatch/routing/route_set.rb:426:in `eval_block'
	from /Users/make/.rbenv/versions/2.3.1/lib/ruby/gems/2.3.0/gems/actionpack-5.1.4/lib/action_dispatch/routing/route_set.rb:408:in `draw'
	from /Users/make/Development/git/refugerestrooms/config/routes.rb:1:in `<top (required)>'
	from /Users/make/.rbenv/versions/2.3.1/lib/ruby/gems/2.3.0/gems/activesupport-5.1.4/lib/active_support/dependencies.rb:286:in `load'
	from /Users/make/.rbenv/versions/2.3.1/lib/ruby/gems/2.3.0/gems/activesupport-5.1.4/lib/active_support/dependencies.rb:286:in `block in load'
	from /Users/make/.rbenv/versions/2.3.1/lib/ruby/gems/2.3.0/gems/activesupport-5.1.4/lib/active_support/dependencies.rb:258:in `load_dependency'
	from /Users/make/.rbenv/versions/2.3.1/lib/ruby/gems/2.3.0/gems/activesupport-5.1.4/lib/active_support/dependencies.rb:286:in `load'
	from /Users/make/.rbenv/versions/2.3.1/lib/ruby/gems/2.3.0/gems/railties-5.1.4/lib/rails/application/routes_reloader.rb:55:in `block in load_paths'
	from /Users/make/.rbenv/versions/2.3.1/lib/ruby/gems/2.3.0/gems/railties-5.1.4/lib/rails/application/routes_reloader.rb:55:in `each'
	from /Users/make/.rbenv/versions/2.3.1/lib/ruby/gems/2.3.0/gems/railties-5.1.4/lib/rails/application/routes_reloader.rb:55:in `load_paths'
	from /Users/make/.rbenv/versions/2.3.1/lib/ruby/gems/2.3.0/gems/railties-5.1.4/lib/rails/application/routes_reloader.rb:18:in `reload!'
	from /Users/make/.rbenv/versions/2.3.1/lib/ruby/gems/2.3.0/gems/railties-5.1.4/lib/rails/application/routes_reloader.rb:41:in `block in updater'
	from /Users/make/.rbenv/versions/2.3.1/lib/ruby/gems/2.3.0/gems/activesupport-5.1.4/lib/active_support/file_update_checker.rb:81:in `execute'
	from /Users/make/.rbenv/versions/2.3.1/lib/ruby/gems/2.3.0/gems/railties-5.1.4/lib/rails/application/routes_reloader.rb:42:in `updater'
	from /Users/make/.rbenv/versions/2.3.1/lib/ruby/gems/2.3.0/gems/railties-5.1.4/lib/rails/application/routes_reloader.rb:31:in `execute_if_updated'
	from /Users/make/.rbenv/versions/2.3.1/lib/ruby/gems/2.3.0/gems/railties-5.1.4/lib/rails/application/finisher.rb:128:in `block in <module:Finisher>'
	from /Users/make/.rbenv/versions/2.3.1/lib/ruby/gems/2.3.0/gems/railties-5.1.4/lib/rails/initializable.rb:30:in `instance_exec'
	from /Users/make/.rbenv/versions/2.3.1/lib/ruby/gems/2.3.0/gems/railties-5.1.4/lib/rails/initializable.rb:30:in `run'
	from /Users/make/.rbenv/versions/2.3.1/lib/ruby/gems/2.3.0/gems/railties-5.1.4/lib/rails/initializable.rb:59:in `block in run_initializers'
	from /Users/make/.rbenv/versions/2.3.1/lib/ruby/2.3.0/tsort.rb:228:in `block in tsort_each'
	from /Users/make/.rbenv/versions/2.3.1/lib/ruby/2.3.0/tsort.rb:350:in `block (2 levels) in each_strongly_connected_component'
	from /Users/make/.rbenv/versions/2.3.1/lib/ruby/2.3.0/tsort.rb:431:in `each_strongly_connected_component_from'
	from /Users/make/.rbenv/versions/2.3.1/lib/ruby/2.3.0/tsort.rb:349:in `block in each_strongly_connected_component'
	from /Users/make/.rbenv/versions/2.3.1/lib/ruby/2.3.0/tsort.rb:347:in `each'
	from /Users/make/.rbenv/versions/2.3.1/lib/ruby/2.3.0/tsort.rb:347:in `call'
	from /Users/make/.rbenv/versions/2.3.1/lib/ruby/2.3.0/tsort.rb:347:in `each_strongly_connected_component'
	from /Users/make/.rbenv/versions/2.3.1/lib/ruby/2.3.0/tsort.rb:226:in `tsort_each'
	from /Users/make/.rbenv/versions/2.3.1/lib/ruby/2.3.0/tsort.rb:205:in `tsort_each'
	from /Users/make/.rbenv/versions/2.3.1/lib/ruby/gems/2.3.0/gems/railties-5.1.4/lib/rails/initializable.rb:58:in `run_initializers'
	from /Users/make/.rbenv/versions/2.3.1/lib/ruby/gems/2.3.0/gems/railties-5.1.4/lib/rails/application.rb:353:in `initialize!'
	from /Users/make/Development/git/refugerestrooms/config/environment.rb:5:in `<top (required)>'
	from /Users/make/.rbenv/versions/2.3.1/lib/ruby/gems/2.3.0/gems/activesupport-5.1.4/lib/active_support/dependencies.rb:292:in `require'
	from /Users/make/.rbenv/versions/2.3.1/lib/ruby/gems/2.3.0/gems/activesupport-5.1.4/lib/active_support/dependencies.rb:292:in `block in require'
	from /Users/make/.rbenv/versions/2.3.1/lib/ruby/gems/2.3.0/gems/activesupport-5.1.4/lib/active_support/dependencies.rb:258:in `load_dependency'
	from /Users/make/.rbenv/versions/2.3.1/lib/ruby/gems/2.3.0/gems/activesupport-5.1.4/lib/active_support/dependencies.rb:292:in `require'
	from config.ru:3:in `block in <main>'
	from /Users/make/.rbenv/versions/2.3.1/lib/ruby/gems/2.3.0/gems/rack-2.0.3/lib/rack/builder.rb:55:in `instance_eval'
	from /Users/make/.rbenv/versions/2.3.1/lib/ruby/gems/2.3.0/gems/rack-2.0.3/lib/rack/builder.rb:55:in `initialize'
	from config.ru:in `new'
	from config.ru:in `<main>'
	from /Users/make/.rbenv/versions/2.3.1/lib/ruby/gems/2.3.0/gems/rack-2.0.3/lib/rack/builder.rb:49:in `eval'
	from /Users/make/.rbenv/versions/2.3.1/lib/ruby/gems/2.3.0/gems/rack-2.0.3/lib/rack/builder.rb:49:in `new_from_string'
	from /Users/make/.rbenv/versions/2.3.1/lib/ruby/gems/2.3.0/gems/rack-2.0.3/lib/rack/builder.rb:40:in `parse_file'
	from /Users/make/.rbenv/versions/2.3.1/lib/ruby/gems/2.3.0/gems/rack-2.0.3/lib/rack/server.rb:319:in `build_app_and_options_from_config'
	from /Users/make/.rbenv/versions/2.3.1/lib/ruby/gems/2.3.0/gems/rack-2.0.3/lib/rack/server.rb:219:in `app'
	from /Users/make/.rbenv/versions/2.3.1/lib/ruby/gems/2.3.0/gems/railties-5.1.4/lib/rails/commands/server/server_command.rb:24:in `app'
	from /Users/make/.rbenv/versions/2.3.1/lib/ruby/gems/2.3.0/gems/rack-2.0.3/lib/rack/server.rb:354:in `wrapped_app'
	from /Users/make/.rbenv/versions/2.3.1/lib/ruby/gems/2.3.0/gems/railties-5.1.4/lib/rails/commands/server/server_command.rb:80:in `log_to_stdout'
	from /Users/make/.rbenv/versions/2.3.1/lib/ruby/gems/2.3.0/gems/railties-5.1.4/lib/rails/commands/server/server_command.rb:42:in `start'
	from /Users/make/.rbenv/versions/2.3.1/lib/ruby/gems/2.3.0/gems/railties-5.1.4/lib/rails/commands/server/server_command.rb:135:in `block in perform'
	from /Users/make/.rbenv/versions/2.3.1/lib/ruby/gems/2.3.0/gems/railties-5.1.4/lib/rails/commands/server/server_command.rb:130:in `tap'
	from /Users/make/.rbenv/versions/2.3.1/lib/ruby/gems/2.3.0/gems/railties-5.1.4/lib/rails/commands/server/server_command.rb:130:in `perform'
	from /Users/make/.rbenv/versions/2.3.1/lib/ruby/gems/2.3.0/gems/thor-0.20.0/lib/thor/command.rb:27:in `run'
	from /Users/make/.rbenv/versions/2.3.1/lib/ruby/gems/2.3.0/gems/thor-0.20.0/lib/thor/invocation.rb:126:in `invoke_command'
	from /Users/make/.rbenv/versions/2.3.1/lib/ruby/gems/2.3.0/gems/thor-0.20.0/lib/thor.rb:387:in `dispatch'
	from /Users/make/.rbenv/versions/2.3.1/lib/ruby/gems/2.3.0/gems/railties-5.1.4/lib/rails/command/base.rb:63:in `perform'
	from /Users/make/.rbenv/versions/2.3.1/lib/ruby/gems/2.3.0/gems/railties-5.1.4/lib/rails/command.rb:44:in `invoke'
	from /Users/make/.rbenv/versions/2.3.1/lib/ruby/gems/2.3.0/gems/railties-5.1.4/lib/rails/commands.rb:16:in `<top (required)>'
	from bin/rails:4:in `require'
	from bin/rails:4:in `<main>'
@stardust66
Copy link
Contributor

invalid API key isn't the issue. Can you show me your config/locales/es/business_info.es.yml?
There seems to be a syntax error in there that prevents the server from starting up.

@Intimaria
Copy link
Contributor Author

Yes! I'll copy and paste on here as I can't attach the yml files.

es:
  business_info:
    title: "Preguntas frecuentes para organizaciones y empresas sobre Refuge Restrooms"
    p1header: "1) Que es Refuge Restrooms?"
    p1: "REFUGE es una aplicación por internet que busca proveer acceso seguro a baños para personas trans, intersex, y personas sin conformidad a un género. Puedes leer más en <a href='/about'>Acerca de REFUGE</a>."
    p2header: "2) ¿Cómo llegó mi instalación a esta lista?"
    p2: "Alguien usó su baño y quizo enviar su ubicación como recurso. Todos nuestros datos son de fuentes múltiples y enviados por el usuario"
    p3header: "3) ¿Cómo puedo ser un buen anfitrión?"
    p3: "¡Gracias por preguntar! A menudo, los visitantes de REFUGE solo esperan pasar rápidamente y irse, y como cualquier otro visitante, apoyar potencialmente su negocio o ubicación mientras esta ahí. El personal amigable y las buenas experiencias pueden aportar mucho en recibir amor por su espacio en la sección de comentarios de la aplicación (¡más sobre eso a continuación!)"
    p4header: "4) ¿Por qué hay un problema con los baños seguros?"
    p4:
      first: "Usar el baño es una actividad cotidiana que puede ser difícil de navegar para personas de nuestra comunidad, especialmente cuando se visitan áreas fuera de sus rutinas diarias. Nuestro proyecto de mapeo aborda esta cuestión"
      second: “Según la <a href='http://www.ustranssurvey.org/'> Encuesta estadounidense de personas trans </a>:"
      list1: "El 59% de las personas encuestadas evitó usar un baño por temor a la confrontación"
      list2: "El 31% evitó comer o beber mientras estaba afuera, para evitar tener que usar el baño"
      list3: "El 24% de las personas fueron cuestionadas por usar el baño"
      list4: "12% de las personas encuestadas fueron hostigadas, atacadas o agredidas sexualmente en un baño"
      list5: "Al 9% se le denegó el acceso al baño"
      list6: "8% desarrollaron un problema renal o una infección del tracto urinario por evitar el uso del baño"
    p5header: "5) ¿Qué significa una calificación?"
    p5: "Las calificaciones ayudan a quienes visitan, a compartir experiencias sobre la ubicación. Animamos a quienes usan los baños, a compartir toda la información que tenemos sobre cada ubicación en el mapa".
    p6header: "6) ¿Cómo elimino mi listado?"
    p6: "Esperamos que considere mantener su listado, ya que puede significar mucho para la salud y el bienestar de las personas. Sin embargo, si prefiere no figurar en la lista, utilice nuestro formulario de contacto para solicitar una eliminación y las personas que trabajan voluntariamente en nuestro proyecto lo revisaran lo más pronto que sea posible (este es un proyecto de código abierto, por lo que todo el trabajo se hace a voluntad)”

@Intimaria
Copy link
Contributor Author

Intimaria commented Jan 15, 2018

I guess you mean this line - could this be a problem with the fact that my translation branch doesn't have all the requirements to have it up and running?

I18n::InvalidLocaleData: can not load translations from /Users/make/Development/git/refugerestrooms/config/locales/es/business_info.es.yml: #<Psych::SyntaxError: (/Users/make/Development/git/refugerestrooms/config/locales/es/business_info.es.yml): did not find expected key while parsing a block mapping at line 3 column 5>

EDIT: ignore the rest, I forgot I did brew services stop postgresql previously and didn't start again.
🤦‍♀️

On the back of that comment, I'm trying the local branch which is just a clone of current refugerestrooms upstream and am getting something. Screenshotted what comes up on localhost:3000

firefox_screenshot_2018-01-15t22-01-48 242z

terminal says:


make:refugerestrooms make$ rails server
=> Booting WEBrick
=> Rails 5.1.4 application starting in development on http://localhost:3000
=> Run `rails server -h` for more startup options
No valid API key has been set, notifications will not be sent
DEPRECATION WARNING: ActiveSupport.halt_callback_chains_on_return_false= is deprecated and will be removed in Rails 5.2. (called from <top (required)> at /Users/make/Development/git/refugerestrooms/config/initializers/new_framework_defaults.rb:23)
[2018-01-15 18:57:35] INFO  WEBrick 1.3.1
[2018-01-15 18:57:35] INFO  ruby 2.3.1 (2016-04-26) [x86_64-darwin17]
[2018-01-15 18:57:35] INFO  WEBrick::HTTPServer#start: pid=20359 port=3000
Started GET "/" for ::1 at 2018-01-15 18:58:32 -0300
Not notifying due to an invalid api_key

PG::ConnectionBad - could not connect to server: Connection refused
	Is the server running on host "localhost" (::1) and accepting
	TCP/IP connections on port 5432?
could not connect to server: Connection refused
	Is the server running on host "localhost" (127.0.0.1) and accepting
	TCP/IP connections on port 5432?
:

::1 - - [15/Jan/2018:18:58:32 -03] "GET / HTTP/1.1" 500 62866
- -> /
Started POST "/__better_errors/8ccac172398cb133/variables" for ::1 at 2018-01-15 18:58:32 -0300
::1 - - [15/Jan/2018:18:58:32 -03] "POST /__better_errors/8ccac172398cb133/variables HTTP/1.1" 200 3222
http://localhost:3000/ -> /__better_errors/8ccac172398cb133/variables
::1 - - [15/Jan/2018:18:58:32 -03] "GET /favicon.ico HTTP/1.1" 200 318
- -> /favicon.ico

@stardust66
Copy link
Contributor

I deleted config/locales/es/business_info.es.yml and it runs fine. There's something wrong with the file but I can't quite figure it out. You do have some weird double quotes in there though, but I removed them and it's still a problem. I'm almost done copying and pasting all the statements into a copy of the english version of the file to see which line causes the problem.

@Intimaria
Copy link
Contributor Author

thanks for your help @stardust66! I'm chuffed it is one step closer towards being able to test locally.

@stardust66
Copy link
Contributor

Oh, I don't think your postgres server is running. That's what the PG::ConnectionBad is about.

@Intimaria
Copy link
Contributor Author

🤣 I forgot I did brew services stop postgresqlafter my lst try and didn't start up again.

This is what it looks like now...

firefox_screenshot_2018-01-15t22-11-21 718z

error says:


ActiveRecord::PendingMigrationError at /

Migrations are pending. To resolve this issue, run:

        bin/rails db:migrate RAILS_ENV=development


@stardust66
Copy link
Contributor

@Intimaria. I fixed your file. I probably should do a PR or something but just copy paste this. Basically, on the lines with second and p6, there are a weird quotes instead of ", and on the line with p5, you had a period(.) on the outside of the quotes that was breaking the file.

es:
  business_info:
    title: "Preguntas frecuentes para organizaciones y empresas sobre Refuge Restrooms"
    p1header: "1) Que es Refuge Restrooms?"
    p1: "REFUGE es una aplicación por internet que busca proveer acceso seguro a baños para personas trans, intersex, y personas sin conformidad a un género. Puedes leer más en <a href='/about'>Acerca de REFUGE</a>."
    p2header: "2) ¿Cómo llegó mi instalación a esta lista?"
    p2: "Alguien usó su baño y quizo enviar su ubicación como recurso. Todos nuestros datos son de fuentes múltiples y enviados por el usuario"
    p3header: "3) ¿Cómo puedo ser un buen anfitrión?"
    p3: "¡Gracias por preguntar! A menudo, los visitantes de REFUGE solo esperan pasar rápidamente y irse, y como cualquier otro visitante, apoyar potencialmente su negocio o ubicación mientras esta ahí. El personal amigable y las buenas experiencias pueden aportar mucho en recibir amor por su espacio en la sección de comentarios de la aplicación (¡más sobre eso a continuación!)"
    p4header: "4) ¿Por qué hay un problema con los baños seguros?"
    p4:
      first: "Usar el baño es una actividad cotidiana que puede ser difícil de navegar para personas de nuestra comunidad, especialmente cuando se visitan áreas fuera de sus rutinas diarias. Nuestro proyecto de mapeo aborda esta cuestión"
      second: "Según la <a href='http://www.ustranssurvey.org/'> Encuesta estadounidense de personas trans </a>:"
      list1: "El 59% de las personas encuestadas evitó usar un baño por temor a la confrontación"
      list2: "El 31% evitó comer o beber mientras estaba afuera, para evitar tener que usar el baño"
      list3: "El 24% de las personas fueron cuestionadas por usar el baño"
      list4: "12% de las personas encuestadas fueron hostigadas, atacadas o agredidas sexualmente en un baño"
      list5: "Al 9% se le denegó el acceso al baño"
      list6: "8% desarrollaron un problema renal o una infección del tracto urinario por evitar el uso del baño"
    p5header: "5) ¿Qué significa una calificación?"
    p5: "Las calificaciones ayudan a quienes visitan, a compartir experiencias sobre la ubicación. Animamos a quienes usan los baños, a compartir toda la información que tenemos sobre cada ubicación en el mapa."
    p6header: "6) ¿Cómo elimino mi listado?"
    p6: "Esperamos que considere mantener su listado, ya que puede significar mucho para la salud y el bienestar de las personas. Sin embargo, si prefiere no figurar en la lista, utilice nuestro formulario de contacto para solicitar una eliminación y las personas que trabajan voluntariamente en nuestro proyecto lo revisaran lo más pronto que sea posible (este es un proyecto de código abierto, por lo que todo el trabajo se hace a voluntad)"

In addition, run the command

rails db:migrate

and you should be good to go!

@Intimaria
Copy link
Contributor Author

💯 🥇 🙌
Yay!

@Intimaria
Copy link
Contributor Author

Intimaria commented Jan 15, 2018

Hmmm... Am still getting

ActiveRecord::PendingMigrationError - Migrations are pending. To resolve this issue, run:

        bin/rails db:migrate RAILS_ENV=development

even after running rails db:migrate, but my head is getting foggy so I think I'll take a break and maybe if I restart everything it will be fine.

@stardust66
Copy link
Contributor

stardust66 commented Jan 15, 2018

Oh, have you run rails db:create? I think you need to create the databases before you run migrations. Sorry I didn't think of that.

@Intimaria
Copy link
Contributor Author

Yeah! you mentioned it in your step by step in #413, I tried running it again, but it says

Database 'bathrooms_development' already exists
Database 'bathrooms_test' already exists

This is what it specifies the problem is, which I'm not sure I understand (my rails is outdated?)


StandardError: An error has occurred, this and all later migrations canceled:

Directly inheriting from ActiveRecord::Migration is not supported. Please specify the Rails release the migration was written for:

  class CreateBathrooms < ActiveRecord::Migration[4.2]
/Users/make/Development/git/refugerestrooms/db/migrate/20131128044650_create_bathrooms.rb:1:in `<top (required)>'

Caused by:
StandardError: Directly inheriting from ActiveRecord::Migration is not supported. Please specify the Rails release the migration was written for:

  class CreateBathrooms < ActiveRecord::Migration[4.2]
/Users/make/Development/git/refugerestrooms/db/migrate/20131128044650_create_bathrooms.rb:1:in `<top (required)>'
Tasks: TOP => db:migrate
(See full trace by running task with --trace)

@stardust66
Copy link
Contributor

Can you run rails --version? You should take a break if you want to.

@Intimaria
Copy link
Contributor Author

I am getting Rails 5.1.4. Yeah, I think I will. My head feels heavy!

@stardust66
Copy link
Contributor

Okay. Feel better.

@Intimaria
Copy link
Contributor Author

Thanks I'll be back later and will try again! Thanks for all your help!

@stardust66
Copy link
Contributor

I found the issue and submitted a PR. The migrations need to have versions because of rails 5.

@Intimaria
Copy link
Contributor Author

Brilliant!

@DeeDeeG
Copy link
Contributor

DeeDeeG commented Jan 16, 2018

Whoops, I missed this thread entirely, somehow. Haven't been checking my e-mail today!

I can say, regarding this: . . .

Some [errors] are related to invalid locale data, which I suspect has to do with recent changes regarding translation which may not be correctly up to date on my local system,

Your suspicions are definitely correct. If your working folder has the translations for a page, but not the page itself, an error may come up that prevents the Rails server from starting.

(So if you have config/locales/[lang_subfolder_here?]/business_info.[lang].yml, but don't have app/views/pages/business_info.html.haml it will give you the error about invalid locale data.)

There have been a lot of similar errors (none of which are your fault) showing up in your branch, due to us separating a lot of stuff out which your branch would depend on into other PRs. Sorry about that! (These things can be fixed, but it and be easiest to do so once the other PRs are merged into develop.)

@stardust66
Copy link
Contributor

@Intimaria For now just change all instances of ActiveRecord::Migration to ActiveRecord::Migration[4.2] in files under the db/migrate directory. Then, run

rails db:migrate

again and the server will actually run this time.

@Intimaria
Copy link
Contributor Author

OK, I'll give it a try when I get home and do have a look at the PR too!

@Intimaria
Copy link
Contributor Author

Finally able to try this - addind the [4.2] on the end of ActiveRecord::Migration in all the files in migrate which had that instance, let me run the app locally without problem! 🙌 💯 😀

@stardust66
Copy link
Contributor

Yay! Glad it worked.

@mi-wood mi-wood closed this as completed Jan 29, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants