Can't update to rails 4.1: Conflict with simple_form - simple-form

When updating from rails from 4.0 to 4.1, I stumbled in the following dependency problem:
Fetching additional metadata from https://rubygems.org/..
Resolving dependencies...
Bundler could not find compatible versions for gem "activemodel":
In Gemfile:
simple_form (>= 0) ruby depends on
activemodel (< 4.1, >= 4.0.0) ruby
rails (= 4.1.0) ruby depends on
activemodel (4.1.0)
How can I install rails 4.1 with simple_form?

You need to use the github version, since the rubygems one don't seems to work.
On your gemfile, update the simple_form to:
gem 'simple_form', github: 'plataformatec/simple_form'
Source: google groups in a language which I can't read

Related

Bundler could not find compatible versions for gem activesupport with specific versions

I am trying to do a bundle install but am getting the following error:
Bundler could not find compatible versions for gem "activesupport":
In Gemfile:
***private gem*** was resolved to 0.4.2, which depends on
activesupport (~> 5.0)
***private gem*** was resolved to 1.0, which depends on
activesupport (~> 4)
What does this mean?
I have searched through the internet and getting answers such as do a bundle update, or remove the Gemfile.lock, but none has been working for me.
I have also tried doing a gem install activesupport -v 4.0 and gem install activesupport -v 5.0
Thanks in advance

Error while installing spree

Bundler could not find compatible versions for gem "railties":
In Gemfile:
rails (= 3.2.8) ruby depends on
railties (= 3.2.8) ruby
sass-rails (~> 4.0.0) ruby depends on
railties (4.0.0)
This error occured, how can i fix this error.
I do not know railties and sass-rails version.
If you're using Rails 3.2 you should use all gems with that branch too, i.e.:
Gemfile:
gem https://github.com/rails/sass-rails.git, branch: '3-2-stable'
You can see branches listed on GH next to green compare button (with new layout).
What if specific gem doesn't have branches? Well, you can fork it, modify the gemspec,see what fails and fix it.

Ruby gems fighting for two separate versions of activesupport?

I'm trying to run the resque server from the command line using:
rake resque:work
and ruby is complaining as follows:
Bundler could not find compatible versions for gem "activesupport":
In Gemfile:
daemon-kit (>= 0) ruby depends on
activesupport (< 3.2.0, >= 2.3.5) ruby
actionpack (>= 0) ruby depends on
activesupport (3.2.12)
How do I resolve these dependencies? Can I install two versions of activesupport in the same RVM gemset?
You'll need to downgrade your version of activesupport to a version that supports daemonkit - or look for an updated version of daemonkit. Your current version of rails / activesupport is newer than the version supported by your version of daemon-kit.
You can have multiple versions of activesupport in a single gemset, but only one of them can be activated at once.

Why does bundler think it needs a specific version when the gemspec specifies a pessimistic constraint?

My gemspec clearly requires active_support ~> 3.0, but bundler is failing to bundle install saying that my gem requires active_support = 3.0. WTF bundler? Can anyone explain this?
$ gem install code_filter
Successfully installed activesupport-3.0.0
Successfully installed active_support-3.0.0
Successfully installed code_filter-0.1.1
$ gem dependency code_filter
Gem code_filter-0.1.1
active_support (~> 3.0, runtime)
$ bundle
Fetching gem metadata from http://rubygems.org/.......
Fetching gem metadata from http://192.168.10.22/...
Fetching gem metadata from http://rubygems.org/...........
Fetching gem metadata from http://192.168.10.22/..
Bundler could not find compatible versions for gem "activesupport":
In Gemfile:
code_filter (= 0.1.1) ruby depends on
activesupport (= 3.0.0) ruby
json_builder (~> 3.1) ruby depends on
activesupport (3.0.20)

Why does Bundler think it needs a specific version to satisfy the dependency of a gem?

This is not the first time I've run into this, but here's a concrete example:
$ bundle update rails
Fetching source index for http://rubygems.org/
Bundler could not find compatible versions for gem "builder":
In Gemfile:
rails (~> 3.0.0) ruby depends on
builder (~> 2.1.2) ruby
hoptoad_notifier (>= 0) ruby depends on
builder (3.0.0)
So Bundler claims the hoptoad_notifier gem depends on the 3.0.0 version of builder. But that's not the case, it only requires builder >= 0.
$ gem dependency hoptoad_notifier
Gem hoptoad_notifier-2.4.11
actionpack (>= 0, development)
activerecord (>= 0, development)
activesupport (>= 0, runtime)
bourne (>= 0, development)
builder (>= 0, runtime)
nokogiri (>= 0, development)
shoulda (>= 0, development)
Why does Bundler think hoptoad_notifier depends on builder 3.0.0?
Selected bits from the Gemfile and Gemfile.lock:
source "http://rubygems.org"
gem 'rails', '~> 3.0.0'
gem 'hoptoad_notifier'
...a bunch of testing gems, custom gems, etc.
Gemfile.lock
GEM
remote: http://rubygems.org/
specs:
actionmailer (2.3.14)
actionpack (= 2.3.14)
...
builder (3.0.0)
...
cucumber (1.2.0)
builder (>= 2.1.2)
diff-lcs (>= 1.1.3)
gherkin (~> 2.10.0)
json (>= 1.4.6)
...
hoptoad_notifier (2.4.11)
activesupport
builder
... no other mentions of builder
I consider this more of a workaround than an answer to the question, so I'll leave the question open for a while to see if there's a better answer.
I found different ways to attack the problem (using bundle update on specific gems, modifying the Gemfile, running bundle install), but continued to run into some form of this error for various dependencies. It really seems like an issue with Bundler. (I'm using v1.0.22, upgrading made it worse.) Ultimately, what got me out of this mess was to delete the Gemfile.lock and run bundle install, letting Bundler resolve all the dependencies from scratch. Now of course, this is far from ideal, since the whole reason you have a lock file is to lock down your app's dependencies. But since I'm upgrading Rails to v3 anyway, it was acceptable in this case.

Resources