2014-05-19 173 views
0

我是RoR的開端,我正在嘗試使導軌服務器工作時真的很糟糕。每次我運行命令導軌服務器問題(導軌4.1.1)

rails server 

它八方通顯示所有這行

C:\Users\Familia-PC\RoR\holamundo>rails server 
=> Booting WEBrick 
=> Rails 4.1.1 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 
Exiting 
C:/Ruby200-x64/lib/ruby/gems/2.0.0/gems/tzinfo-1.1.0/lib/tzinfo/data_source.rb:1 
99:in `rescue in create_default_data_source': No timezone data source could be f 
ound. To resolve this, either install TZInfo::Data (e.g. by running `gem install 
tzinfo-data`) or specify a zoneinfo directory using `TZInfo::DataSource.set(:zo 
neinfo, zoneinfo_path)`. (TZInfo::DataSourceNotFound) 
     from C:/Ruby200-x64/lib/ruby/gems/2.0.0/gems/tzinfo-1.1.0/lib/tzinfo/dat 
a_source.rb:196:in `create_default_data_source' 
     from C:/Ruby200-x64/lib/ruby/gems/2.0.0/gems/tzinfo-1.1.0/lib/tzinfo/dat 
a_source.rb:62:in `block in get' 
     from C:/Ruby200-x64/lib/ruby/gems/2.0.0/gems/tzinfo-1.1.0/lib/tzinfo/dat 
a_source.rb:61:in `synchronize' 
     from C:/Ruby200-x64/lib/ruby/gems/2.0.0/gems/tzinfo-1.1.0/lib/tzinfo/dat 
a_source.rb:61:in `get' 
     from C:/Ruby200-x64/lib/ruby/gems/2.0.0/gems/tzinfo-1.1.0/lib/tzinfo/tim 
ezone.rb:601:in `data_source' 
     from C:/Ruby200-x64/lib/ruby/gems/2.0.0/gems/tzinfo-1.1.0/lib/tzinfo/tim 
ezone.rb:114:in `get' 
     from C:/Ruby200-x64/lib/ruby/gems/2.0.0/gems/tzinfo-1.1.0/lib/tzinfo/tim 
ezone_proxy.rb:84:in `real_timezone' 
     from C:/Ruby200-x64/lib/ruby/gems/2.0.0/gems/tzinfo-1.1.0/lib/tzinfo/tim 
ezone_proxy.rb:52:in `period_for_utc' 
     from C:/Ruby200-x64/lib/ruby/gems/2.0.0/gems/tzinfo-1.1.0/lib/tzinfo/tim 
ezone.rb:524:in `current_period' 
     from C:/Ruby200-x64/lib/ruby/gems/2.0.0/gems/activesupport-4.1.1/lib/act 
ive_support/core_ext/object/try.rb:45:in `public_send' 
     from C:/Ruby200-x64/lib/ruby/gems/2.0.0/gems/activesupport-4.1.1/lib/act 
ive_support/core_ext/object/try.rb:45:in `try' 
     from C:/Ruby200-x64/lib/ruby/gems/2.0.0/gems/activesupport-4.1.1/lib/act 
ive_support/values/time_zone.rb:223:in `utc_offset' 
     from C:/Ruby200-x64/lib/ruby/gems/2.0.0/gems/activesupport-4.1.1/lib/act 
ive_support/values/time_zone.rb:396:in `block in []' 
     from C:/Ruby200-x64/lib/ruby/gems/2.0.0/gems/activesupport-4.1.1/lib/act 
ive_support/values/time_zone.rb:396:in `tap' 
     from C:/Ruby200-x64/lib/ruby/gems/2.0.0/gems/activesupport-4.1.1/lib/act 
ive_support/values/time_zone.rb:396:in `[]' 
     from C:/Ruby200-x64/lib/ruby/gems/2.0.0/gems/activesupport-4.1.1/lib/act 
ive_support/core_ext/time/zones.rb:60:in `find_zone!' 
     from C:/Ruby200-x64/lib/ruby/gems/2.0.0/gems/activesupport-4.1.1/lib/act 
ive_support/railtie.rb:20:in `block in <class:Railtie>' 
     from C:/Ruby200-x64/lib/ruby/gems/2.0.0/gems/railties-4.1.1/lib/rails/in 
itializable.rb:30:in `instance_exec' 
     from C:/Ruby200-x64/lib/ruby/gems/2.0.0/gems/railties-4.1.1/lib/rails/in 
itializable.rb:30:in `run' 
     from C:/Ruby200-x64/lib/ruby/gems/2.0.0/gems/railties-4.1.1/lib/rails/in 
itializable.rb:55:in `block in run_initializers' 
     from C:/Ruby200-x64/lib/ruby/2.0.0/tsort.rb:150:in `block in tsort_each' 

     from C:/Ruby200-x64/lib/ruby/2.0.0/tsort.rb:183:in `block (2 levels) in 
each_strongly_connected_component' 
     from C:/Ruby200-x64/lib/ruby/2.0.0/tsort.rb:219:in `each_strongly_connec 
ted_component_from' 
     from C:/Ruby200-x64/lib/ruby/2.0.0/tsort.rb:182:in `block in each_strong 
ly_connected_component' 
     from C:/Ruby200-x64/lib/ruby/2.0.0/tsort.rb:180:in `each' 
     from C:/Ruby200-x64/lib/ruby/2.0.0/tsort.rb:180:in `each_strongly_connec 
ted_component' 
     from C:/Ruby200-x64/lib/ruby/2.0.0/tsort.rb:148:in `tsort_each' 
     from C:/Ruby200-x64/lib/ruby/gems/2.0.0/gems/railties-4.1.1/lib/rails/in 
itializable.rb:54:in `run_initializers' 
     from C:/Ruby200-x64/lib/ruby/gems/2.0.0/gems/railties-4.1.1/lib/rails/ap 
plication.rb:288:in `initialize!' 
     from C:/Users/Familia-PC/RoR/holamundo/config/environment.rb:5:in `<top 
(required)>' 
     from C:/Users/Familia-PC/RoR/holamundo/config.ru:3:in `require' 
     from C:/Users/Familia-PC/RoR/holamundo/config.ru:3:in `block in <main>' 
     from C:/Ruby200-x64/lib/ruby/gems/2.0.0/gems/rack-1.5.2/lib/rack/builder 
.rb:55:in `instance_eval' 
     from C:/Ruby200-x64/lib/ruby/gems/2.0.0/gems/rack-1.5.2/lib/rack/builder 
.rb:55:in `initialize' 
     from C:/Users/Familia-PC/RoR/holamundo/config.ru:in `new' 
     from C:/Users/Familia-PC/RoR/holamundo/config.ru:in `<main>' 
     from C:/Ruby200-x64/lib/ruby/gems/2.0.0/gems/rack-1.5.2/lib/rack/builder 
.rb:49:in `eval' 
     from C:/Ruby200-x64/lib/ruby/gems/2.0.0/gems/rack-1.5.2/lib/rack/builder 
.rb:49:in `new_from_string' 
     from C:/Ruby200-x64/lib/ruby/gems/2.0.0/gems/rack-1.5.2/lib/rack/builder 
.rb:40:in `parse_file' 
     from C:/Ruby200-x64/lib/ruby/gems/2.0.0/gems/rack-1.5.2/lib/rack/server. 
rb:277:in `build_app_and_options_from_config' 
     from C:/Ruby200-x64/lib/ruby/gems/2.0.0/gems/rack-1.5.2/lib/rack/server. 
rb:199:in `app' 
     from C:/Ruby200-x64/lib/ruby/gems/2.0.0/gems/railties-4.1.1/lib/rails/co 
mmands/server.rb:50:in `app' 
     from C:/Ruby200-x64/lib/ruby/gems/2.0.0/gems/rack-1.5.2/lib/rack/server. 
rb:314:in `wrapped_app' 
     from C:/Ruby200-x64/lib/ruby/gems/2.0.0/gems/railties-4.1.1/lib/rails/co 
mmands/server.rb:130:in `log_to_stdout' 
     from C:/Ruby200-x64/lib/ruby/gems/2.0.0/gems/railties-4.1.1/lib/rails/co 
mmands/server.rb:67:in `start' 
     from C:/Ruby200-x64/lib/ruby/gems/2.0.0/gems/railties-4.1.1/lib/rails/co 
mmands/commands_tasks.rb:81:in `block in server' 
     from C:/Ruby200-x64/lib/ruby/gems/2.0.0/gems/railties-4.1.1/lib/rails/co 
mmands/commands_tasks.rb:76:in `tap' 
     from C:/Ruby200-x64/lib/ruby/gems/2.0.0/gems/railties-4.1.1/lib/rails/co 
mmands/commands_tasks.rb:76:in `server' 
     from C:/Ruby200-x64/lib/ruby/gems/2.0.0/gems/railties-4.1.1/lib/rails/co 
mmands/commands_tasks.rb:40:in `run_command!' 
     from C:/Ruby200-x64/lib/ruby/gems/2.0.0/gems/railties-4.1.1/lib/rails/co 
mmands.rb:17:in `<top (required)>' 
     from bin/rails:4:in `require' 
     from bin/rails:4:in `<main>' 

我希望你們能幫助我解決這個問題

+0

你不是唯一有這個問題的人。這不會是你最喜歡的答案,但回到穩定版本的「Rails 4.1」可能會有所幫助。 'gem「rails」,::git =>「git://github.com/rails/rails.git」,:branch =>「4-1-stable」'。話雖如此,我看到一些人使用@Matheus的答案解決了這個問題。 –

+0

可能重複[TZInfo :: DataSourceNotFound錯誤在Windows上啓動Rails v4.1.0服務器](http://stackoverflow.com/questions/23022258/tzinfodatasourcenotfound-error-starting-rails-v4-1-0-server-on-窗戶) –

+0

同樣的問題,我如何解決這個 – vinodh

回答

1

將這個在你的Gemfile:

gem "tzinfo-data" 
+1

我不知道你爲什麼downvoted。這是他/她的問題的可能解決方案。 –

+1

...因爲它已經在錯誤信息中說過,我想補充一點。 ;-) –

+1

感謝您的回答,但我的寶石文件已經有了它。無論如何,我找到了解決方案,我只需要將x64_mingw添加到gem「tzinfo-data」數組中。 – DanielHolguin