I ran into a problem recently installing gems in an offline system... I am not understanding something about how the `pdk bundle` setup creates it's cache directories.
If you try to do a `pdk bundle exec gem install ~/path/to/module.gem`, it will place it's cache files in ~/.gem/ruby, but the PDK expects it's files in ~/.pdk/cache/ruby/
I followed these basic steps to get it 'working' enough...
- Copy over .gem file and it's dependencies to the offline system to be able to do a local `gem install`
- Install it using `pdk bundle gem install ~/gems/*`
- Copy over the installed gems from ~/.gem to ~/.pdk/cache - `cp --no-clobber ~/.gem/ruby ~/.pdk/cache/`
- Update your Gemfile (in your PDK base directory) to include the gems you want to local install
- `pdk bundle install --local` to install the gems from the gemfile, but source them from the cache that you just manually populated.
I'd love to know if there is a better way to do this!
No comments:
Post a Comment