Bundler could not find compatible versions for gem "railties":

349 views
Skip to first unread message

Sanjay

unread,
Feb 28, 2012, 12:26:08 AM2/28/12
to Ruby on Rails: Talk
Hello,
Just getting going on Rails... I have been working through Michael
Hartl's tutorial and things were going good till I suddenly got the
error below when deploying to Heroku.
Before this I had deployed number of times successfully. Locally via
localhost things work fine.... I can see there is a dependency
mismatch but I can't figure out how to solve it or what caused it.
----------------------------------------------------------------------------------------------------------------------------------------
-----> Heroku receiving push
-----> Ruby/Rails app detected
-----> Installing dependencies using Bundler version 1.1.rc.7
Running: bundle install --without development:test --path
vendor/bundle --binstubs bin/
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)

!
! Failed to install gems via Bundler.
----------------------------------------------------------------------------------------------------------------------------------------

I did a fresh install of rails and started another project from
scratch. But this time I got this error on very first heroku push.

I will appreciate if someone can tell me what I have messed up and how
to fix this.
Thanks.. sanjay

Bruce A.

unread,
Feb 29, 2012, 9:24:47 PM2/29/12
to rubyonra...@googlegroups.com
I have the same problem. Here is an attempt to recreate the steps that
caused it for me:

Platform Windows 7 x64
- installed latest git (1.7.8.msysgit.0)
- installed RailsInstaller (ruby 1.9.3)
- installed DevKit
- installed Heroku tools w/o Git

I also have cygwin installed (not sure that is relevant but there have
been issues with mingw32 apps). After installing all of the above I did
the following:

- Ran "gems update"
- Followed Rails Tutorial exactly

The tutorial process failed at the step for pushing to Heroku with error
shown in the original question. I tried to work around the problem:

* Tried changing Gemfile back to "~> " versions
* Deleted extra local versions of installed railsties and
sass-rails, reinstalled only the specified versions
* Tried using sass-rails 3.2.4 in Gemfile in hopes the dependency
would correct itself

Nothing worked. Sometimes a local "bundle update"/"bundle install" would
work, sometimes it would fail. It seemed to always work from a git bash
window and cmd.exe failed most of the time. But no matter what the
outcome locally, when I tried to push to Heroku it always gave the
error message above.

Rubygems.org clearly shows that the sass-rails dependency on railties
should be on 3.2.0.beta so something funky is going on. Just wish I knew
what it is.

--
Posted via http://www.ruby-forum.com/.

Darren G.

unread,
Mar 1, 2012, 3:27:58 PM3/1/12
to rubyonra...@googlegroups.com
Also a first-timer working through the tutorial so not sure this is
right way but it worked for me.

1. Ran gem update
2. Changed gemfile in your project root to add the '~> ' for sass-rails,
coffee-rails and jquery-rails to appear as follows:

"
gem 'rails', '3.2.1'
...
group :assets do
gem 'sass-rails', '~> 3.2.3'
gem 'coffee-rails', '~> 3.2.2'
...
gem 'jquery-rails', '~> 2.0.0'
"

3. git commit -a -m "updating gemfile for heroku"
4. git push heroku master

As I say, not necessarily right answer but worked on my side. Hope it
helps.

Bruce A.

unread,
Mar 2, 2012, 2:46:14 PM3/2/12
to rubyonra...@googlegroups.com
Thanks for the recipe.

I thought I'd tried that combination before but it had failed. This time
it worked. Either something new in 'gems update' changed things or I
neglected to do the commit for this particular combination.

Either way, thanks for getting me up and running again.

Nisha D.

unread,
May 17, 2012, 11:20:18 AM5/17/12
to rubyonra...@googlegroups.com
I am first time user and struggling with heroku deployment. Your
solution worked for me. Thanks.
Reply all
Reply to author
Forward
0 new messages