matsko
matsko

Reputation: 22223

Difficulty creating local gems using RubyGems

Whenever I develop gems using RubyGems I always need to push any changes as a different version to rubygems and then update my Gemfile for testing program. While this does work, it's pretty annoying since I need to update the version each time, then download the Gemfile contents and run the program to to see if it works.

Ideally I would like to setup the project I'm working to use the gem, but to point to it locally instead of being a gem downloaded from RubyGems. I've tried using a local and remote git repository using the :git => '...' attribute and I've also tried using the :local => /path/to/gem-directory but nothing works.

Any idea on how to set this up?

Upvotes: 1

Views: 33

Answers (1)

edouardbriere
edouardbriere

Reputation: 1260

Whenever I need to test a rubygem against my Rails application I edit my Rails app’s Gemfile like so:

gem 'my_gem_name', :path => '/path/to/my_gem_name'

Each time you want to test a change in your gem, don’t forget to run bundle update on the main app so bundler will fetch the latest version of your gem.

Upvotes: 1

Related Questions