nicholas79171
nicholas79171

Reputation: 1273

"Could not find activesupport" when 3 versions installed

I'm just trying to use the simple career_builder gem and just get it imported by running the simple script:

require 'career_builder'

puts 'Hello world!'

and yet get the following error: /Library/Ruby/Site/2.0.0/rubygems/dependency.rb:315:in 'to_specs': Could not find 'activesupport' (~> 2.3.5) - did find: [activesupport-4.2.1,activesupport-3.1.12,activesupport-3.0.3] (Gem::LoadError)

I installed the gem with gem install career_builder and ran bundle install and even updated activesupport to the most recent version, but for some reason, the program can't find the newer version of activesupport. Does the gem require version 2.3.5?

Upvotes: 1

Views: 990

Answers (2)

BarFooBar
BarFooBar

Reputation: 1136

http://guides.rubygems.org/patterns/

The ~>or 'twiddle-waka' is a ruby gems shortcut to specify the earliest version of the gem you can use without letting you go up to the next major release.

Your gem is being a bit unorthodox and also specifying a patch level. So the gem_specification you're working with (activesupport' (~> 2.3.5)) really means minimum version of 2.3.5 maximum of the last patch released before 2.4.0.

The activesupport versions you have installed are all for subsequent major releases and won't work. Install something between 2.3.5 and 2.4.0 and you should be good to go.

Upvotes: 1

B Seven
B Seven

Reputation: 45941

Yes. It does require Active Support version >= 2.3.5 and < 2.4.0. All of your Active Support versions are > 2.4.0.

~> is called the spermy operator. See Meaning of tilde-greater-than (~>) in version requirement?

The gem has not been updated in 4 years, so it uses Rails 2.

FWIW, I don't think you'll have much luck getting it to work, so you may want to find a similar gem that works with Rails 4 and has been updated within the last few months.

Upvotes: 1

Related Questions