问题
Trying to push first_app to heroku. Starts out looking like it's working OK, but after a few seconds, I get:
Fetching gem metadata from https://rubygems.org/......... Bundler could not find compatible versions for gem "railties": In Gemfile: rails (= 3.2.1) ruby depends on railties (= 3.2.1) ruby sass-rails (= 3.2.3) ruby depends on railties (3.2.2.rc1)
It goes on to tell me that it failed to install gems and the push was rejected.
My Gemfile is currently as specified in the tutorial, but I have tried fiddling with the explicit version numbers to see whether I could resolve the error that way: no luck. I also tried doing a bundle update, which gave me a similar error, but straight out of Bundler, instead of from the Heroku push; and deleting the Gemfile.lock file, which caused other errors so confusing I wound up deleting everything and starting over.
回答1:
It seems to me you have changes in group assets. Use it:
group :assets do
gem 'sass-rails', '~> 3.2.3'
gem 'coffee-rails', '~> 3.2.1'
# See https://github.com/sstephenson/execjs#readme for more supported runtimes
gem 'therubyracer'
gem 'uglifier', '>= 1.0.3'
gem 'compass-rails'
end
回答2:
Try to update the gem to sass-rails ~>3.2.4 and you would most likely have to update the jquery-rails to ~>2.0.1. Then run bundle before you push the app to heroku. bundle should tell you if there are further dependency conflicts.
回答3:
I think the error is caused by running a different version of gem from the one in the tutorial. Run gem -v to find out the version you're running. He's using 1.8.24 in the tutorial. If the versions are different run gem update --system 1.8.24 to update. Then run bundle again and push the app to heroku.
来源:https://stackoverflow.com/questions/9490878/heroku-push-rejected-railties-dependency-conflict-ruby-on-rails-tutorial-secti