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

后端 未结 5 737
隐瞒了意图╮
隐瞒了意图╮ 2020-12-08 00:32

I\'ve been trying to import Bootstrap into my rails app and I\'m not quite sure what\'s going wrong. I\'ve had it working before, but I did a \'bundle update\' and destroyed

5条回答
  •  天命终不由人
    2020-12-08 00:42

    I ran into this exact problem today and managed to solve it.

    Funny thing is that yesterday everything was fine (of which I have proof because I pushed a working version to Heroku before going to bed last night), but today things broke after I did bundle update. So I went through the terminal output of that and noticed that the sprockets gem updated to 2.12.0. I then went back and realized that it was 2.11.0 yesterday. Hmm...

    On a hunch, I edited my gemfile and added this line:

    gem 'sprockets', '2.11.0'
    

    Basically, to force bundler to install that specific version. I then did another bundle update and voila! Things started working again.

提交回复
热议问题