gemspec What I would like to do is to add the runtime dependency on the gem in the gemspec, but make some local modifications to gem-bar and have a bundle install use the local development checkout. The gem build command, which comes standard with Rubygems, evaluates the .gemspec in the context of the directory in … This may work for simple gems, but not work for others. bundle init. bundle-gem - Generate a project skeleton for creating a rubygem. So at the end all gems are in the gemspec and bundle install works without errors. Init generates a default Gemfile(5) in the current working directory. Bundler's runtime will add the load paths listed in the .gemspec to the load path, as well as the load paths of any of the gems listed as dependencies (and so on). If there is no .gemspec, you probably shouldn't use the gem from git. Here’s an example of a default gemspec file created by bundler using the command bundle gem brandon (brandon being the name of my fake gem): In my case I had made a Gemfile in a directory and was doing a bundle install and I happened to deleted gem manually on os x due to which I was not able to install the gem again. Assume the case where I control both gems, and am hacking on them somewhat concurrently, and I'll be pushing the new versions simultaneously. end Protected Instance Methods When adding a Gemfile(5) to a gem with a gemspec, the --gemspec option will automatically add each dependency listed in the gemspec file to the newly created Gemfile(5). raise "Couldn't install gem, run `gem install #{built_gem_path}' for more detailed output" end Bundler.ui.confirm "#{name} (#{version}) installed." bundle gem GEM_NAME OPTIONS Description. bundle init [--gemspec=FILE] Description. Afterwards, when running bundle install, bundle-download will automatically download extra files at the end. To install a gem located in a git repository, bundler changes to the directory containing the gemspec, runs gem build name.gemspec and then installs the resulting gem. When you run bundle install, bundler will find the .gemspec and treat the local directory as a local, unpacked gem. As we’ve seen before, the gemspec file (located at the root of the gem) defines the specification of a Ruby gem. When I installed I set gem install --default bundler -v 'X.x.x' but now I have 2 defaults. bundle-init - Generates a Gemfile into the current working directory. If a Ruby Gem needs to depend on one of those gems, it can declare as a standard dependency in .gemspec. 1. gem list | grep your_gem_name 2. uninstall your_gem_name 3. removed Gemfile.lock 4. bundle install from my … Add bundler-download as a standard .gemspec dependency: Using bundler to bootstrap a new gem will automatically create this file. bundle gem. – Lomefin Mar 10 '19 at 4:05 @Lomefin The previous version's gemspec must be removed from the /default directory. In this Gemfile, the `gemspec` method imports gems listed with `add_runtime_dependency` in the `my_gem.gemspec` file, and it also installs rspec and rubocop to test and develop the gem. It will find and resolve the dependencies listed in the .gemspec . This way all the gems are added and finally the bundle install works fine. If the git repository does not contain a .gemspec file, bundler will create a simple one, without any dependencies, executables or C extensions. Having this specific gemspec and commenting out all gems initially running bundle install and then adding one or two individually and running bundle install again works fine. Gem Instructions.