Bundler could not find compatible versions for gem “railties” for Rails 4.0.0

Solution 1:

Also bundle update only allows you to update one gem at a time, which is hard if you are updating to Rails 4 and a whole lot of gems have to be updated at the same time.

I solved this by deleting the Gemfile.lock and doing bundle install.

This is of course assuming you have no conflicting explicit gem version in your Gemfile to start with. So if this fails, remove version numbers from the Gemfile.

Solution 2:

Just remove gem versions (coffee-rails and sass-rails) from Gemfile and run bundle update