I resolved a code issue with a gem, but how do I then use that gem in my Rails 3.0.10 app? Do I just include the files in my app or do I need to recompile the gem? If I recompile the gem, how do I use it in my app?
Here's 3 ways you could go about this (and I have personally done each one for differing reasons):
Method 1)
Source your fork in your Gemfile something like so:
gem 'awesome_thing', :git => 'git://github.com/yourname/awesome_thing.git'
Send pull request and polite note to current maintainer (optional)
Method 2)
Source that gem folder in your Gemfile like so:
gem 'awesome_thing', :path => 'vendor/gems/awesome_thing-0.4.5'
Method 3)
What you should do is fork the git project that hosts the original gem...make your fixes and push back to git.
Then in your Gemfile do:
gem 'gemyoufixed', git: 'git://github.com/you/gemyoufixed'
Then bundle install...
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.