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
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.
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.
Rails 4 did change the way it boots up.
Fortunately, you don't have to run rails-new
, since there is a handy task for that.
Rails 4 Release Notes:
6.1 Notable changes
- Your app's executables now live in the
bin/
dir. Runrake rails:update:bin
to getbin/bundle
,bin/rails
, andbin/rake
.
If your bin folder is already in place, you may just need to run bundle install
first. This solved the problem for me after cloning a repo that was working perfectly on another machine.