I need to locally use a gem (Rails Panel) in a rails app without adding code to git.
The reason I cannot modify code in version control is because my team has a very strict policy on adding new gems. It's not ideal but I can exclude files from version control if I have to.
I tried the following solution but it doesn't work:
Run
gem install meta_requestModify the file
bin/railswith the following code:
#!/usr/bin/env ruby
# original code [...]
gems = %w[meta_request]
gem_home = ENV['GEM_HOME']
gem_dir = Dir["#{gem_home}/gems/*/lib"]
gems.each do |gem|
gem_path = gem_dir.select { |r| r.include?(gem) }
$LOAD_PATH.append(*gem_path)
require gem
end
- Add
bin/railsto.git/info/exclude
NB: The answer to this thread doesn't work in this case because the gem needs to be "required". How can I use a gem locally without forcing it on collaborators?