"Unable to activate" ruby gem: dependencyissue - ruby-on-rails

I'm a noob to run gem dependencies. I get this error when trying to run a ruby program
.rbenv/versions/2.1.5/lib/ruby/2.1.0/rubygems/specification.rb:2064:in `raise_if_conflicts': Unable to activate familysearch-0.4.2, because faraday-0.9.1 conflicts with faraday (~> 0.8.4), multi_json-1.11.2 conflicts with multi_json (~> 1.5.0) (Gem::LoadError)
In trouble shooting, I installed Bundler. Here is what my lock file looks like:
GEM
remote: https://rubygems.org/
specs:
mini_portile (0.6.2)
nokogiri (1.6.6.2)
mini_portile (~> 0.6.0)
rack (1.6.4)
PLATFORMS
ruby
DEPENDENCIES
faraday (~> 0.9.1)
nokogiri
rack (~> 1.1)
BUNDLED WITH
1.10.5
I found similar stuff over the webs and their solutions. Unfortunately, none of these worked for me. Thank you for looking :)

The gem you're having issues with, familysearch-0.4.2, hasn't been updated since March of 2014. Hence, it's dependent on old gem versions.
I'd recommend submitting an issue to the Gem created, jimmyz, on Github via https://github.com/jimmyz/familysearch-rb/issues/new.
While the VCR tests for the gem aren't working (so I couldn't check my work), try using my forked version of the gem below where I updated the dependencies.
gem "familysearch", git: 'https://github.com/acpk/familysearch-rb.git'

Related

Bundler could not find compatible versions for gem mime-types

Super baffled by this problem. Everything is working great local but when I deploy to Heroku it hits this error:
Bundler could not find compatible versions for gem "mime-types":
In Gemfile:
rails (= 3.2.17) ruby depends on
mime-types (~> 1.16) ruby
stripe (>= 0) ruby depends on
mime-types (2.3)
I've tried gem installing mime-types 2.3 both in the gemfile and from the command line and neither have given any great results, though maybe it's from my lack of experience.
If I had hair I'd be pulling it out! Again, this problem only happens when deploying to Heroku. Everything bundle installs and updates fine locally.
I was able to resolve a similar problem:
Bundler could not find compatible versions for gem "mime-types":
In Gemfile:
rails (= 4.0.7) ruby depends on
mime-types (~> 1.16) ruby
stripe (~> 1.15.0) ruby depends on
mime-types (2.3)
By throwing away my Gemfile.lock and running bundle install.
Hope this helps!
There is better way to resolve this msg,
go to your gemfile.lock and change your mime-types version to 1.25.1,
rub bundle install again, then go back to Gemfile.lock and switch mime-types to 2.4.3, and again run bundle install :)
Run bundle update mime-types resolved my problem

Rails 4.0.2 dependency mime-types (~> 1.16) is conflicting with other tools using mime-types 2.0

When trying to install the Mechanize gem, I get the following error:
Resolving dependencies...
Bundler could not find compatible versions for gem "mime-types":
In Gemfile:
rails (= 4.0.2) ruby depends on
mime-types (~> 1.16) ruby
mechanize (~> 2.7.3) ruby depends on
mime-types (2.0)
Now I understand that it's because rails depends on mime-types ~1.16 and Mechanize mime-types 2.0 but is there no way to get those two to play nicely together?
Specify mechanize ~> 2.6.0 for now and you should be okay until the Rails team can update their gem requirements for mime-types.
Check https://github.com/sparklemotion/mechanize/blob/master/CHANGELOG.rdoc to see if any of the revisions after 2.6.0 fix bugs or add features that may be important to you.

ERROR: Error installing friendly_id: activesupport requires Ruby version >= 1.9.3. with Rails2.3.3 and Ruby 1.8.7

When I try to install friendly_id :version => "~> 3.0.6" with rails 2.3.3 wtih ruby 1.8.7 getting error for Ruby version
ERROR: Error installing friendly_id: activesupport requires Ruby version >= 1.9.3.
Current version of Rails is 2.3.3 and Ruby is 1.8.7
I have goggled but couldn't find any solution, Please help me for resolving it.
my gems are:
and gem list
* LOCAL GEMS *
actionmailer (2.3.3)
actionpack (2.3.3)
activerecord (2.3.3)
activeresource (2.3.3)
activesupport (2.3.18, 2.3.3)
atomic (1.1.14)
authlogic (2.1.9)
bundler (1.3.5)
bundler-unload (1.0.1)
crummy (1.7.2)
currencies (0.4.2)
declarative_authorization (0.5.7)
exceptional (2.0.6)
geoip (1.3.0)
geokit (1.6.7)
geonames (0.3.3)
god (0.13.3)
i18n (0.6.5)
json (1.8.0)
minitest (4.7.5)
multi_json (1.8.0)
rack (1.0.1)
rails (2.3.3)
rake (10.1.0)
rdoc (4.0.1)
rdoc-data (4.0.1)
rubygems-bundler (1.2.2)
rubygems-update (1.4.2)
rvm (1.11.3.8)
SystemTimer (1.1.3)
thread_safe (0.1.3)
tzinfo (1.1.0, 0.3.37)
validates_timeliness (2.3.2)
Please help me how to install friendly_id with rails2.3.3 and Ruby 1.8.7
I think you need to check exactly what friendly_id version you are attempting to install outside of Gemfile specifications.
According to friendly_id documentation here:
For (Active Record) 2.3 support, you can use FriendlyId 3.x, which will continue to be
maintained until people don't want it any more.
So, 3.0.6 should work for you, if that is what you are installing. Use "gem list friendly_id" to see what you have locally, which should be nothing. Use "gem list friendly_id -r" to see what is available remotely. It will try to install the highest level available by default. What I got was friendly_id (4.0.10.1).
Do you have 3.0.6 downloaded to your system? If you do, are you using gem build/gem install to build and install it? At what point do you get the error message? The gem install will install the locally built version by default if you are in its directory...
If all of this still fails, post the Gemspec file from it so that we can review the requirements. You may need to update these before the build/install. However, YMMV and you must test it fully before you can trust it if you change Gemspec.
However, let me reiterate the recommendation to upgrade to current supported software, especially if you are making extensive changes. As you indicated, you may face having to upgrade both your local code and the installed gems. That is the price you pay for support and advanced features.

Could not find twitter-1.6.2 in any of the sources

I'm trying to install the bundles but it can't install twitter-1.6.2 in specific.
mauricio#mauricio-ubuntu:$ bundle install
Fetching gem metadata from http://rubygems.org/.......
Fetching gem metadata from http://rubygems.org/..
Could not find twitter-1.6.2 in any of the sources
Could someone help?
Gemfile:
gem 'twitter'
Gemfile.lock:
twitter (1.6.2)
faraday (~> 0.7.4)
faraday_middleware (~> 0.7.0)
hashie (~> 1.1.0)
multi_json (~> 1.0.0)
multi_xml (~> 0.2.0)
simple_oauth (~> 0.1.5)
I'm using ruby 1.8.7-p334 (I know, it's old).
Thanks!
$ gem list ^twitter$ --remote --all
*** REMOTE GEMS ***
twitter (4.8.1, 4.8.0, 4.7.0, 4.6.2, 4.6.1, 4.6.0, 4.5.0, 4.4.4, 4.4.3, 4.4.2, 4.4.1, 4.4.0, 4.3.0, 4.2.0, 4.1.2, 4.1.1, 4.1.0, 4.0.0)
You aren't even close.
Ahh,
1) Go here:
https://rubygems.org/gems/twitter/
2) Scroll to the bottom, and click on Show all versions.
3) Click on 1.6.2.
4) Now even though the next page doesn't show version 1.6.2 in the list of versions, just click on the Download link(above the list of versions)
5) Install the gem:
If you are using rvm, switch to whatever gemset you created for your current project.
Install the twitter gem:
$ gem install --local /path/to/twitter.gem
The bundle install command is not supposed to go looking for gems to download if the version specified in your Gemfile is already installed. To be safe, I would change the twitter line in your Gemfile to this:
gem 'twitter', '1.6.2'

RoR omniauth and facebooker2

In a new application Rails 3.1 with only in Gemfile:
gem "omniauth"
gem "facebooker2"
bundle install give the error:
Bundler could not find compatible versions for gem "hashie":
In Gemfile:
facebooker2 (= 0.0.16) ruby depends on
hashie (~> 1.1.0) ruby
omniauth (>= 0) ruby depends on
hashie (1.2.0)
How can I install facebooker2 with omniauth?
I just ran bundle with those 2 gems and it worked.
It did install facebooker2 0.0.12 however, and not 0.0.16
gem 'omniauth', '1.0.2'
gem 'facebooker2'
it also worked without specifying the omniauth version, but I highly recommend using the a 1.0.0 release as there are huge differences. The main one being all the providers are now in their own gems.
If bundle install doesn't work, run bundle update.
The relevant sections of my Gemfile.lock:
facebooker2 (0.0.12)
mogli (>= 0.0.12)
ruby-hmac
hashie (1.2.0)
hike (1.2.1)
httparty (0.8.1)
multi_json
multi_xml
...
mogli (0.0.28)
httparty (>= 0.4.3)
omniauth (1.0.2)
hashie (~> 1.2)
rack
The only way I have to solve the problem was to clone the mogli project and update the hashie dependence to 1.2:
https://github.com/davidsf/mogli/commit/bcee3dd815bab7c8eb68511ee0d7c2da39115e14

Resources