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?
run the command bundle install in your shell, once you have your Gemfile created. This command will look your Gemfile and install the relevant Gems on the indicated versions. The Gemfiles are installed because in your Gemfile you are pointing out the source where the gems can be downloaded from.
A Gemfile is a file that is created to describe the gem dependencies required to run a Ruby program. A Gemfile should always be placed in the root of the project directory.
Use File.join('..', 'Ruby_Libs', 'my_gem'')
instead of "../Ruby_Libs/my_gem"
.
gem "my_gem", :path => File.join('..', 'Ruby_Libs', 'my_gem'')
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With