undefined method `environment' for nil:NilClass when importing Bootstrap into rails

后端 未结 2 1185
無奈伤痛
無奈伤痛 2021-02-01 15:49

Getting error:

undefined method `environment\' for nil:NilClass
Extracted source (around line #5):


  Dossiyadata
  <%         


        
2条回答
  •  臣服心动
    2021-02-01 16:21

    When upgrading to Rails 4.0.5 you need to temporarily lock your sprockets at 2.11.x:

    gem 'sprockets', '<= 2.11.0'
    

    Then

    bundle install
    

    The exact error I was getting was:

    ActionView::Template::Error: undefined method `environment' for nil:NilClass
    

    For more context:

    https://github.com/rails/sass-rails/issues/191

    https://github.com/sstephenson/sprockets/issues/537

提交回复
热议问题