Rails 4 doesn't detect application

后端 未结 3 771
逝去的感伤
逝去的感伤 2021-02-13 04:15

After updating to Rails 4, I\'m trying to start the server, but it won\'t start. Simply put, the application doesn\'t seem to get \"detected\", like there is no application in t

3条回答
  •  情书的邮戳
    2021-02-13 05:10

    Mostly, I've been had by my own laziness. (Even though laziness is the mother of efficiency ;o) ) I've made a point of not using Bundle when running Rails server.

    Rails 4.0.0.beta changes the way it boots up. But, since I was using my "old" version of Rails, an older 4.0.0-beta I had lying around in my local gems, which didn't have the change, I didn't notice when the change was made to my bundle.

    Now, when came the time to deploy, the obligatory bundle-exec couldn't boot because my code was used to boot the old way.

    The solution

    Do like the message says to: bundle exec rails new .. And use Bundle this time! At that point, Rails will generate the boilerplate stuff, namely the missing boot files like ./bin/rails.

    It will also update some config files, and try to overwrite some stuff. In my case, everything is checked into source control, so there's a bit of diff'ing and choosing whether to overwrite or not and reverting after.

    An maybe better idea (I haven't bothered to) would be to branch out in Git, run the "upgrade" rails-new, overwrite everything, commit that, and then three-way merge back with the main branch.

提交回复
热议问题