Is there a way to distribute a Ruby gem without access to the internet, just bundling the gem's that are installed on the dev's pc ?
This is for deploying inside our organisation, access to internet is heavily restricted. All the pc's run Windows7 with Ruby1.9.3 and Bundler 1.11.2
I have little experience with git or bundler. Rails is not used but some other gems like activerecord and logger are.
What I tried:
I created a folder with my rb. scripts and a .gemspec file with the required gem's, then I executed bundle gem name_of_the_gem_i_want_to_make
but got an error Errno::ENOENT: No such file or directory - git config user.name
.
In the past I created a git account and did some experimenting bu I'd prefer not to use it.
In the past I experimented with jRuby and Warble to produce JAR's but in this case I'd like to stick with MRI Ruby.
I have internet connection on my dev pc but some of the pc's or servers I want to deploy the scripts - and more important the gem's they depend on - don't. Ruby is allready installed everywhere though.
I'd like a simple way to gather all the needed files from my dev pc and transfer these to the target pc's. I could zip my Ruby folder and extract it elsewhere but then I have a lot of files I don't need.
Can you give me the commands I need to use or give me a site that explains how to do this ? I read a lot about bundler online but have nowhere found this way of working. Can't imagine other devs haven't the same issues and a common solution is present.
EDIT:
I managed to create a gem by executing gem build mygem.gemspec
but it has only my own scripts in it, no required gem's.
EDIT: followed the suggestion of Mihai, removed the previous attempts.
Made a subfolder vendor/gems and copied the 2 gemfiles there.
Now I can do a bundle package
and a bundle install --no-deployment
with the following Gemfile.
gem 'active_record', '4.1.1', :path => 'vendor/gems'
gem 'logger', '1.2.8', :path => 'vendor/gems'
Question now: how to deploy this onto another pc ? Copy everything in the folder and on the target pc do a bundle install --local
? Or is there a way to bundle everything in a gem so that on the target pc I can do gem install mygem --local
? A gem build mygem doesn't include anything from the bundle.