I am trying to install gem from a forked aws-sdk-ruby
repo where I have added some new commits.
Below is the content I have added to my Gemfile:
gem 'aws-sdk', :git => 'https://github.com/suvrat-joshi/aws-sdk-ruby.git', :branch => 'retry-throttled-cf-requests'
But when I try to run bundle install
I get the following error:
Could not find gem 'aws-sdk' in [email protected]:suvrat-joshi/aws-sdk-ruby.git (at
retry-throttled-cf-requests@b77de6d).
Also, I am able to install this gem from source by running gem install aws-sdk -s https://github.com/suvrat-joshi/aws-sdk-ruby.git
. However, I would like to install this through the bundle install
.
Note that I have already tried some of the answers I found on web. But none of these have been useful for my case. Like:
Adding
require 'bundler/setup'
to config.ru
file.
Adding
require 'bundler'
Bundler.setup(:default)
to config.ru
file.
Using specific_install
command
gem install specific_install
gem specific_install -l https://github.com/suvrat-joshi/aws-sdk-ruby.git
Building the gem from the aws-sdk.gemspec (gem build aws-sdk.gemspec
) file present at link, and then copying the generated gem file to a static path of another project and then adding the following to the Gemfile
.
gem 'aws-sdk-3.2.0.gem', path: 'vendor/gems/aws-sdk'
But this option is not suitable for my case as for each new update I will need to build the gem again and copy it over to the static path.
Can someone with expertise in Ruby help me understand why this is not working and how can I fix this?
As per https://bundler.io/guides/git.html:
If the gem is located within a subdirectory of a git repository,
you can use the :glob option to specify the location of its .gemspec
And the same page provides an example:
gem 'cf-copilot',
git: 'https://github.com/cloudfoundry/copilot',
glob: 'sdk/ruby/*.gemspec'
So in your case, it needs to be:
gem 'aws-sdk',
:git => 'https://github.com/suvrat-joshi/aws-sdk-ruby.git',
:branch => 'retry-throttled-cf-requests',
:glob => 'gems/aws-sdk/aws-sdk.gemspec'