2014-04-01 187 views
1

我最近在Windows機器上進行了分區,並安裝了rubyrubyonrails。當我創建使用rails new FirstApp它工作正常,但是當我嘗試使用rails s啓動Rails服務器,它拋出我下面提到的錯誤一個新的Rails項目:啓動rails服務器時出錯

C:/RailsInstaller/Ruby2.0.0/lib/ruby/gems/2.0.0/gems/activesupport-4.1.0.beta1/l 
ib/active_support/core_ext/time/zones.rb:70:in `rescue in find_zone!': uninitial 
ized constant TZInfo::InvalidTimezoneIdentifier (NameError) 
     from C:/RailsInstaller/Ruby2.0.0/lib/ruby/gems/2.0.0/gems/activesupport- 
4.1.0.beta1/lib/active_support/core_ext/time/zones.rb:55:in `find_zone!' 
     from C:/RailsInstaller/Ruby2.0.0/lib/ruby/gems/2.0.0/gems/activesupport- 
4.1.0.beta1/lib/active_support/railtie.rb:20:in `block in <class:Railtie>' 
     from C:/RailsInstaller/Ruby2.0.0/lib/ruby/gems/2.0.0/gems/railties-4.1.0 
.beta1/lib/rails/initializable.rb:30:in `instance_exec' 
     from C:/RailsInstaller/Ruby2.0.0/lib/ruby/gems/2.0.0/gems/railties-4.1.0 
.beta1/lib/rails/initializable.rb:30:in `run' 
     from C:/RailsInstaller/Ruby2.0.0/lib/ruby/gems/2.0.0/gems/railties-4.1.0 
.beta1/lib/rails/initializable.rb:55:in `block in run_initializers' 
     from C:/RailsInstaller/Ruby2.0.0/lib/ruby/2.0.0/tsort.rb:150:in `block i 
n tsort_each' 
     from C:/RailsInstaller/Ruby2.0.0/lib/ruby/2.0.0/tsort.rb:183:in `block (
2 levels) in each_strongly_connected_component' 
     from C:/RailsInstaller/Ruby2.0.0/lib/ruby/2.0.0/tsort.rb:219:in `each_st 
rongly_connected_component_from' 
     from C:/RailsInstaller/Ruby2.0.0/lib/ruby/2.0.0/tsort.rb:182:in `block i 
n each_strongly_connected_component' 
     from C:/RailsInstaller/Ruby2.0.0/lib/ruby/2.0.0/tsort.rb:180:in `each' 
     from C:/RailsInstaller/Ruby2.0.0/lib/ruby/2.0.0/tsort.rb:180:in `each_st 
rongly_connected_component' 
     from C:/RailsInstaller/Ruby2.0.0/lib/ruby/2.0.0/tsort.rb:148:in `tsort_e 
ach' 
     from C:/RailsInstaller/Ruby2.0.0/lib/ruby/gems/2.0.0/gems/railties-4.1.0 
.beta1/lib/rails/initializable.rb:54:in `run_initializers' 
     from C:/RailsInstaller/Ruby2.0.0/lib/ruby/gems/2.0.0/gems/railties-4.1.0 
.beta1/lib/rails/application.rb:285:in `initialize!' 
     from E:/rubydemo/test3/config/environment.rb:5:in `<top (required)>' 
     from E:/rubydemo/test3/config.ru:3:in `require' 
     from E:/rubydemo/test3/config.ru:3:in `block in <main>' 
     from C:/RailsInstaller/Ruby2.0.0/lib/ruby/gems/2.0.0/gems/rack-1.5.2/lib 
/rack/builder.rb:55:in `instance_eval' 
     from C:/RailsInstaller/Ruby2.0.0/lib/ruby/gems/2.0.0/gems/rack-1.5.2/lib 
/rack/builder.rb:55:in `initialize' 
     from E:/rubydemo/test3/config.ru:in `new' 
     from E:/rubydemo/test3/config.ru:in `<main>' 
     from C:/RailsInstaller/Ruby2.0.0/lib/ruby/gems/2.0.0/gems/rack-1.5.2/lib 
/rack/builder.rb:49:in `eval' 
     from C:/RailsInstaller/Ruby2.0.0/lib/ruby/gems/2.0.0/gems/rack-1.5.2/lib 
/rack/builder.rb:49:in `new_from_string' 
     from C:/RailsInstaller/Ruby2.0.0/lib/ruby/gems/2.0.0/gems/rack-1.5.2/lib 
/rack/builder.rb:40:in `parse_file' 
     from C:/RailsInstaller/Ruby2.0.0/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:/RailsInstaller/Ruby2.0.0/lib/ruby/gems/2.0.0/gems/rack-1.5.2/lib 
/rack/server.rb:199:in `app' 
     from C:/RailsInstaller/Ruby2.0.0/lib/ruby/gems/2.0.0/gems/railties-4.1.0 
.beta1/lib/rails/commands/server.rb:50:in `app' 
     from C:/RailsInstaller/Ruby2.0.0/lib/ruby/gems/2.0.0/gems/rack-1.5.2/lib 
/rack/server.rb:314:in `wrapped_app' 
     from C:/RailsInstaller/Ruby2.0.0/lib/ruby/gems/2.0.0/gems/railties-4.1.0 
.beta1/lib/rails/commands/server.rb:130:in `log_to_stdout' 
     from C:/RailsInstaller/Ruby2.0.0/lib/ruby/gems/2.0.0/gems/railties-4.1.0 
.beta1/lib/rails/commands/server.rb:67:in `start' 
     from C:/RailsInstaller/Ruby2.0.0/lib/ruby/gems/2.0.0/gems/railties-4.1.0 
.beta1/lib/rails/commands/commands_tasks.rb:81:in `block in server' 
     from C:/RailsInstaller/Ruby2.0.0/lib/ruby/gems/2.0.0/gems/railties-4.1.0 
.beta1/lib/rails/commands/commands_tasks.rb:76:in `tap' 
     from C:/RailsInstaller/Ruby2.0.0/lib/ruby/gems/2.0.0/gems/railties-4.1.0 
.beta1/lib/rails/commands/commands_tasks.rb:76:in `server' 
     from C:/RailsInstaller/Ruby2.0.0/lib/ruby/gems/2.0.0/gems/railties-4.1.0 
.beta1/lib/rails/commands/commands_tasks.rb:40:in `run_command!' 
     from C:/RailsInstaller/Ruby2.0.0/lib/ruby/gems/2.0.0/gems/railties-4.1.0 
.beta1/lib/rails/commands.rb:17:in `<top (required)>' 
     from bin/rails:4:in `require' 
     from bin/rails:4:in `<main>' 

誰能幫我在這裏和理解這個問題如何解決它? 我正在使用ruby 2.0.0p195 (2013-05-14) [i386-mingw32]Rails 4.1.0.beta1

+0

也許你應該使用穩定的rails版本,而不是測試版。 –

+1

試試這個:http://stackoverflow.com/questions/20713472/uninitialized-constant-tzinfoinvalidtimezoneidentifier-nameerror-rails-4 –

回答

1

似乎是這樣的問題在Windows上。這裏有一個類似的question可能會幫助你。希望這可以幫助。