We have an internal gem server to store some organisation specific gems. We use it via a source option in Gemfile
:
source 'https://local-gems.example.com' do
gem 'local-gem'
end
The internal gem server is only available on the internal network.
If I am off the network I can run bundle
if:
- I comment out the
source
declaration (and associatedend
) - The gems defined in the source group are already installed on the system.
That means that if I am working from home, I need to remember to comment out the source
declaration, and then remember to uncomment it again before committing any change.
Is there a way to modify the Gemfile
so that it will detect that the source is unavailable and ignore it? That is, can I configure Gemfile
so I don't have to comment out those lines each time I work away from the local network?