Faraday conflicts in google_drive and google-api-client - ruby

I'd like to be able to use both the google-api-client gem to do service to service authentication and the google_drive api to access spreadsheets. Unfortunately, these gems seem to conflict due to requiring different versions of Faraday in their dependencies. Anyone know how to solve this?
Error if google_drive is required first:
specification.rb:1637:in `raise_if_conflicts': Unable to activate google-api-client-0.4.4, because faraday-0.8.1 conflicts with faraday (~> 0.7.0) (Gem::LoadError)
Error if google/api_client comes first:
specification.rb:1637:in `raise_if_conflicts': Unable to activate oauth2-0.7.1, because faraday-0.7.6 conflicts with faraday (~> 0.8) (Gem::LoadError)

Give me an day or so and I'll update the google-api-client gem to use the more recent version of Faraday.
That said, you shouldn't need a separate gem to use Google Drive, and any gem designed to add syntactic sugar to a discovery based Google API should really be using the official gem as a base.

Related

Unable to activate watir-screenshot-stitch-0.7.4, because rubyzip-2.3.0 conflicts with rubyzip (~> 1.2) (Gem::ConflictError)

ERROR : Unable to activate watir-screenshot-stitch-0.7.4, because rubyzip-2.3.0 conflicts with rubyzip (~> 1.2) (Gem::ConflictError)
The above error is displayed when trying to run job from jenkins
It has started coming up after i upgraded ruby
Any ideas around what can be the root cause of this error and what can be done to resolve the same.
I removed rubyzip-2.3.0 gem from the path as 'Ruby25-x64\lib\ruby\gems\2.5.0\gems..
This resolved the issue.
NOTE: rubyzip--1.3.0 remains in the above mentioned path as is.

AWS-SDK Undefined Method presigned_post

A friend has a project that i'm looking to, to be able to upload a video directly to s3. All the code, all the aws gems, and configurations are the same. My codebase says that presigned_post isn't a method on the bucket object - The S3_BUCKET is defined.
Does anyone know why my S3_BUCKET object simply doesn't have the presigned_post method? It has to be somewhere in configurations or gems i'm thinking but i feel like i've tried everything.
GEM LIST:
aws-sdk (2.8.11, 2.0.6.pre)
aws-sdk-core (2.8.11, 2.0.6)
aws-sdk-resources (2.8.11, 2.0.6.pre)
aws-sdk-v1 (1.66.0)
aws-sigv4 (1.0.0)
fog-aws (0.9.4, 0.9.1)
By updating the gemfile to explicitly say gem 'aws-sdk', '>= 2.6.1' i was able to solve the problem

How do I include a commit in a ruby library that hasn't been added to the gem yet?

Specifically, this commit has been merged into mongomapper master to fix a bug that is causing my application to crash:
https://github.com/mongomapper/mongomapper/pull/572
However, it hasn't been released in a new gem. Is it possible to include it prematurely or do I have to wait until it's released? I'm on heroku with a Gemfile.lock that specifies version.
My gemfile.lock currently reads:
mongo_mapper (0.13.0)
activemodel (>= 3.0.0)
activesupport (>= 3.0)
mongo (~> 1.8)
plucky (~> 0.6.5)
I don't know about Heroku, but if you want to use a git version of a gem that is not on Rubygems yet, you must add the git path to your Gemfile.
In your Gemfile change:
gem 'mongomapper'
To:
gem 'mongomapper', :git => 'https://github.com/mongomapper/mongomapper.git'
Or if you're on a more modern ruby, you can also use:
gem 'mongomapper', github: 'mongomapper/mongomapper'
And of course after that you must run bundle install or bundle update mongomapper.
Since the Ruby code isn't compiled, if you have the notes for that patch you can always manually add those changes to the lib directory of the mongomapper gem, although I can't advise against this enough - it's undesirable to change the source code, especially underneath an installed gem.
Once you go down this road you can't really count on any support for related issues until you are updated to a newer version or reverted to the original files.

Ruby Builder conflict

I have a small ruby app that has been working. I am now getting a conflict error with builder. It looks like I updated my gems and now it is conflicting. I have it set in the Gemfile to use v2.1.2. But that is not working either. Thanks for any help you can give me.
Gemfile
gem 'builder', '2.1.2'
Bundler output
$ bundle
Using builder (2.1.2)
Using bundler (1.2.3)
$ bundle show builder
/Users/covard/.rvm/gems/ruby-1.9.3-p327/gems/builder-2.1.2
Conflict message
`raise_if_conflicts': Unable to activate actionpack-3.2.11, because rack-1.5.0 conflicts with rack (~> 1.4.0), builder-3.1.4 conflicts with builder (~> 3.0.0) (Gem::LoadError)
Figured out what my problem was even though I had my Gemfile I wasn't using it. Since rails handles that automatically I didn't know I had to add a require to use it. After adding this to my ruby files it worked perfectly.
require "bundler/setup"

bundler complains about unfilled dependency version but there is no such entry in Gemfile

In both, the Gemfile and in Gemfile.lock there's nothing about oauth2 (=0.5.0) , both are set to 0.4.1
Where is this dependency written?
Here's end of output from bundle install
Bundler could not find compatible versions for gem "oauth2":
In snapshot (Gemfile.lock):
oauth2 (0.4.1)
In Gemfile:
diaspora-client depends on
oauth2 (= 0.5.0)
I faced this problem before, for my case, i just reinstall everything using a network where there is no firewall or any restriction. Previously i use a network with alot of restriction, then it keep give me error. After I change network, all work perfectly fine.

Resources