Uninitialized Constant TZInfo::InvalidTimezoneIdentifier (NameError) - Rails 4

前端 未结 2 1458
难免孤独
难免孤独 2020-12-21 13:13

I\'m in the process of upgrading a Rails 3.2 app to Rails 4.1. Whenever I try to start the console or server though, I come across this error:

C:/Ruby200/lib         


        
相关标签:
2条回答
  • 2020-12-21 13:45

    Requiring the tzinfo gem before initializing the app in environment.rb fixes the issue for me. Doesn't really explain everything, but seems to work

    # adding this fixes the issue
    require 'tzinfo'
    
    # Initialize the rails application
    RailsApp::Application.initialize!
    

    Edit: Seems this was a problem with Rails: https://github.com/rails/rails/issues/13553

    0 讨论(0)
  • 2020-12-21 13:53

    This worked for me:

    gem uninstall tzinfo
    #select 'All versions'
    gem install tzinfo
    rails c
    
    0 讨论(0)
提交回复
热议问题