0

How to extract source code of specific gem so that it is possible to edit it locally? Shall I add it to my Rails application folder?

I need that to be able to make changes to the gem's code.

1 Answer 1

6

If you find an error in gem, you'd better make pull request on GitHub. But let's suppose you need your private fork of gem. Best workflow for that:

  1. Download the gem source code from GitHub: git clone https://github.com/author/awesome_gem.git.
  2. In your project's Gemfile add gem awesome_gem, path: "/local/path/to/awesome_gem"
  3. Run bundle install

Now you can make changes to the gem locally, and have your project use local copy of it. When you are done making initial changes, push your Gem to your github repository, and change Gemfile line to something like:

gem awesome_gem, github: 'QQQ/awesome_gem' ('QQQ' being your Github's account name)

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.