Friday, January 1, 2016

Setup your own local ruby repository

I- Mirror all the gems from
a- install rubygems-mirror
$ sudo gem install rubygems-mirror

b- create rubygems-mirror configuration file in  ~/.gem/.mirrorrc with the following content

- from:
  to: ~/.gem/mirror

b- Create mirror directory

$ mkdir ~/.gem/mirror

c- Start mirroring, it might take days

$ gem mirror

II- Start Local repo repository
a- install geminabox and ruby-dev (for building native package)
$ sudo gem install geminabox
$ sudo apt-get install ruby-dev

b- create geminabox configuration file ~/.gem/mirror/ with the following content

require "rubygems"
require "geminabox" = "./"
run Geminabox

c- Start gem server:

$ cd ~/.gem/mirror
$ rackup

II- change gem repository to our newly created
$ gem source --remove
$ gem source --add http://localhost:9292

No comments:

Post a Comment