7

I am writing a Gemfile to help with the development of a few gems my team is creating.

I know that the Gemfile allows the use of the :path argument to reference local directories that contain a .gemspec file:

gem "my_gem", :path => "../Ruby_Libs/my_gem"

However, the members of my team are using different OSs (OS X, Win XP, Win 7) when writing their code.

So my question is how can I go about using the Gemfile's :path argument to reference local gems in development with a value that is OS agnostic?

linusthe3rd
  • 3,455
  • 3
  • 28
  • 43

1 Answers1

14

Use File.join('..', 'Ruby_Libs', 'my_gem'') instead of "../Ruby_Libs/my_gem".

gem "my_gem", :path => File.join('..', 'Ruby_Libs', 'my_gem'')
gioele
  • 9,748
  • 5
  • 55
  • 80