Jayson Bailey
Jayson Bailey

Reputation: 1004

Local gems for rails outside of gemfile

We've got a developer who gets errors with a gem while using zsh, but the rest of us would still like to use the gem. Is there a good solution for this?

Upvotes: 2

Views: 137

Answers (1)

Josh
Josh

Reputation: 5721

From here, add the following code to the bottom of your gemfile.

gemfile_local = File.join(File.dirname(__FILE__), 'Gemfile.local')
if File.readable?(gemfile_local)
  puts "Loading #{gemfile_local}..." if $DEBUG
  instance_eval(File.read(gemfile_local))
end

Have each of the developers who want to use the problem gem to add it to their Gemfile.local. This is the most elegant solution I have found for using gems you don't want to commit to version control. Don't forget to add Gemfile.local to your .gitignore.

Upvotes: 2

Related Questions