Solucionado (ver solução)
Solucionado
(ver solução)
3
respostas

Dúvida no Ex. 3 da Aula 2 - New Bundle Install - Servidor está saindo após ser iniciado?

Fiz tudo como descrito em aula e exercícios só que na hora de levantar o servidor aparentemente ele sai na mesma hora.

$ rails server
C:/RailsInstaller/Ruby2.2.0/lib/ruby/gems/2.2.0/gems/tzinfo-1.2.2/lib/tzinfo/data_source.rb:182:in `rescue in create_default_data_source': No source of timezone data could be found. (TZInfo::DataSourceNotFound)
Please refer to http://tzinfo.github.io/datasourcenotfound for help resolving this error.
        from C:/RailsInstaller/Ruby2.2.0/lib/ruby/gems/2.2.0/gems/tzinfo-1.2.2/lib/tzinfo/data_source.rb:179:in `create_default_data_source'
        from C:/RailsInstaller/Ruby2.2.0/lib/ruby/gems/2.2.0/gems/tzinfo-1.2.2/lib/tzinfo/data_source.rb:40:in `block in get'
        from C:/RailsInstaller/Ruby2.2.0/lib/ruby/gems/2.2.0/gems/tzinfo-1.2.2/lib/tzinfo/data_source.rb:39:in `synchronize'
        from C:/RailsInstaller/Ruby2.2.0/lib/ruby/gems/2.2.0/gems/tzinfo-1.2.2/lib/tzinfo/data_source.rb:39:in `get'
        from C:/RailsInstaller/Ruby2.2.0/lib/ruby/gems/2.2.0/gems/tzinfo-1.2.2/lib/tzinfo/timezone.rb:629:in `data_source'
        from C:/RailsInstaller/Ruby2.2.0/lib/ruby/gems/2.2.0/gems/tzinfo-1.2.2/lib/tzinfo/timezone.rb:92:in `get'
        from C:/RailsInstaller/Ruby2.2.0/lib/ruby/gems/2.2.0/gems/tzinfo-1.2.2/lib/tzinfo/timezone_proxy.rb:67:in `real_timezone'
        from C:/RailsInstaller/Ruby2.2.0/lib/ruby/gems/2.2.0/gems/tzinfo-1.2.2/lib/tzinfo/timezone_proxy.rb:30:in `period_for_utc'
        from C:/RailsInstaller/Ruby2.2.0/lib/ruby/gems/2.2.0/gems/tzinfo-1.2.2/lib/tzinfo/timezone.rb:549:in `current_period'
        from C:/RailsInstaller/Ruby2.2.0/lib/ruby/gems/2.2.0/gems/activesupport-4.2.5.1/lib/active_support/values/time_zone.rb:282:in `utc_offset'
        from C:/RailsInstaller/Ruby2.2.0/lib/ruby/gems/2.2.0/gems/activesupport-4.2.5.1/lib/active_support/values/time_zone.rb:243:in `block in []'
        from C:/RailsInstaller/Ruby2.2.0/lib/ruby/gems/2.2.0/gems/activesupport-4.2.5.1/lib/active_support/values/time_zone.rb:243:in `tap'
        from C:/RailsInstaller/Ruby2.2.0/lib/ruby/gems/2.2.0/gems/activesupport-4.2.5.1/lib/active_support/values/time_zone.rb:243:in `[]'
        from C:/RailsInstaller/Ruby2.2.0/lib/ruby/gems/2.2.0/gems/activesupport-4.2.5.1/lib/active_support/core_ext/time/zones.rb:61:in `find_zone!'
        from C:/RailsInstaller/Ruby2.2.0/lib/ruby/gems/2.2.0/gems/activesupport-4.2.5.1/lib/active_support/railtie.rb:20:in `block in <class:Railtie>'
        from C:/RailsInstaller/Ruby2.2.0/lib/ruby/gems/2.2.0/gems/railties-4.2.5.1/lib/rails/initializable.rb:30:in `instance_exec'
        from C:/RailsInstaller/Ruby2.2.0/lib/ruby/gems/2.2.0/gems/railties-4.2.5.1/lib/rails/initializable.rb:30:in `run'
        from C:/RailsInstaller/Ruby2.2.0/lib/ruby/gems/2.2.0/gems/railties-4.2.5.1/lib/rails/initializable.rb:55:in `block in run_initializers'
        from C:/RailsInstaller/Ruby2.2.0/lib/ruby/2.2.0/tsort.rb:226:in `block in tsort_each'
        from C:/RailsInstaller/Ruby2.2.0/lib/ruby/2.2.0/tsort.rb:348:in `block (2 levels) in each_strongly_connected_component'
        from C:/RailsInstaller/Ruby2.2.0/lib/ruby/2.2.0/tsort.rb:429:in `each_strongly_connected_component_from'
        from C:/RailsInstaller/Ruby2.2.0/lib/ruby/2.2.0/tsort.rb:347:in `block in each_strongly_connected_component'
        from C:/RailsInstaller/Ruby2.2.0/lib/ruby/2.2.0/tsort.rb:345:in `each'
        from C:/RailsInstaller/Ruby2.2.0/lib/ruby/2.2.0/tsort.rb:345:in `call'
        from C:/RailsInstaller/Ruby2.2.0/lib/ruby/2.2.0/tsort.rb:345:in `each_strongly_connected_component'
        from C:/RailsInstaller/Ruby2.2.0/lib/ruby/2.2.0/tsort.rb:224:in `tsort_each'
        from C:/RailsInstaller/Ruby2.2.0/lib/ruby/2.2.0/tsort.rb:203:in `tsort_each'
        from C:/RailsInstaller/Ruby2.2.0/lib/ruby/gems/2.2.0/gems/railties-4.2.5.1/lib/rails/initializable.rb:54:in `run_initializers'
        from C:/RailsInstaller/Ruby2.2.0/lib/ruby/gems/2.2.0/gems/railties-4.2.5.1/lib/rails/application.rb:352:in `initialize!'
        from C:/Users/LUAN--LAPTOP/Desktop/lojadecamisetas/config/environment.rb:5:in `<top (required)>'
        from C:/Users/LUAN--LAPTOP/Desktop/lojadecamisetas/config.ru:3:in `require'
        from C:/Users/LUAN--LAPTOP/Desktop/lojadecamisetas/config.ru:3:in `block in <main>'
        from C:/RailsInstaller/Ruby2.2.0/lib/ruby/gems/2.2.0/gems/rack-1.6.4/lib/rack/builder.rb:55:in `instance_eval'
        from C:/RailsInstaller/Ruby2.2.0/lib/ruby/gems/2.2.0/gems/rack-1.6.4/lib/rack/builder.rb:55:in `initialize'
        from C:/Users/LUAN--LAPTOP/Desktop/lojadecamisetas/config.ru:in `new'
        from C:/Users/LUAN--LAPTOP/Desktop/lojadecamisetas/config.ru:in `<main>'
        from C:/RailsInstaller/Ruby2.2.0/lib/ruby/gems/2.2.0/gems/rack-1.6.4/lib/rack/builder.rb:49:in `eval'
        from C:/RailsInstaller/Ruby2.2.0/lib/ruby/gems/2.2.0/gems/rack-1.6.4/lib/rack/builder.rb:49:in `new_from_string'
        from C:/RailsInstaller/Ruby2.2.0/lib/ruby/gems/2.2.0/gems/rack-1.6.4/lib/rack/builder.rb:40:in `parse_file'
        from C:/RailsInstaller/Ruby2.2.0/lib/ruby/gems/2.2.0/gems/rack-1.6.4/lib/rack/server.rb:299:in `build_app_and_options_from_config'
        from C:/RailsInstaller/Ruby2.2.0/lib/ruby/gems/2.2.0/gems/rack-1.6.4/lib/rack/server.rb:208:in `app'
        from C:/RailsInstaller/Ruby2.2.0/lib/ruby/gems/2.2.0/gems/railties-4.2.5.1/lib/rails/commands/server.rb:61:in `app'
        from C:/RailsInstaller/Ruby2.2.0/lib/ruby/gems/2.2.0/gems/rack-1.6.4/lib/rack/server.rb:336:in `wrapped_app'
        from C:/RailsInstaller/Ruby2.2.0/lib/ruby/gems/2.2.0/gems/railties-4.2.5.1/lib/rails/commands/server.rb:139:in `log_to_stdout'
        from C:/RailsInstaller/Ruby2.2.0/lib/ruby/gems/2.2.0/gems/railties-4.2.5.1/lib/rails/commands/server.rb:78:in `start'
        from C:/RailsInstaller/Ruby2.2.0/lib/ruby/gems/2.2.0/gems/railties-4.2.5.1/lib/rails/commands/commands_tasks.rb:80:in `block in server'
        from C:/RailsInstaller/Ruby2.2.0/lib/ruby/gems/2.2.0/gems/railties-4.2.5.1/lib/rails/commands/commands_tasks.rb:75:in `tap'
        from C:/RailsInstaller/Ruby2.2.0/lib/ruby/gems/2.2.0/gems/railties-4.2.5.1/lib/rails/commands/commands_tasks.rb:75:in `server'
        from C:/RailsInstaller/Ruby2.2.0/lib/ruby/gems/2.2.0/gems/railties-4.2.5.1/lib/rails/commands/commands_tasks.rb:39:in `run_command!'
        from C:/RailsInstaller/Ruby2.2.0/lib/ruby/gems/2.2.0/gems/railties-4.2.5.1/lib/rails/commands.rb:17:in `<top (required)>'
        from bin/rails:4:in `require'
        from bin/rails:4:in `<main>'
=> Booting WEBrick
=> Rails 4.2.5.1 application starting in development on http://localhost:3000
=> Run `rails server -h` for more startup options
=> Ctrl-C to shutdown server
Exiting
3 respostas
solução!

Oi Luan, tudo bem?

Pelo que vi aqui, no Windows é necessário adicionar mais uma gem no Gemfile para que tudo funcione como esperado.

Adiciona essa entrada no Gemfile:

gem 'tzinfo-data', platforms: [:mingw, :mswin, :x64_mingw, :jruby]

roda bundle install e tenta iniciar o servidor novamente.

e avisa no que deu? Se funcionar atualizo os exercícios com essa informação extra para usuários de Windows.

Abraço!

Deu certo, essa entrada já vem por padrão quando você roda rails new nomedoprojeto eu tirei pq na aula foi dito que não precisava e de fato funcionou no Mac e no window não rsrs brigadão Lucas, abraço.

Oi Luan,

em breve vou alterar o exercício para deixar claro que no Windows essa entrada é necessária.

Qualquer dúvida nos deixe saber. :)

Bons estudos!