Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

I don't want "rake install" to publish to Rubygems

Tags:

ruby

rake

gem

I'm running:

rake install

on a project built with bundle gem <project_name>

I've published the gem to Rubygems. However, sometimes I'm on a VPN and I don't want rake install to try to also publish the gem to Rubygems.

I just want it installed locally. How can I achieve that?

like image 716
ftravers Avatar asked Feb 13 '12 03:02

ftravers


1 Answers

The rakefile created by bundler will not publish your gem when you run rake install.

You are thinking of rake release Don't forget that you can do rake -T to see a list of all described tasks.

$ bundle --version
Bundler version 1.0.21


$ bundle gem somegem
      create  somegem/Gemfile
      create  somegem/Rakefile
      create  somegem/.gitignore
      create  somegem/somegem.gemspec
      create  somegem/lib/somegem.rb
      create  somegem/lib/somegem/version.rb
Initializating git repo in /Users/joshuajcheek/deleteme/somegem


$ cd somegem
total 24
-rw-r--r--  1 staff    91B Feb 12 22:00 Gemfile
-rw-r--r--  1 staff    28B Feb 12 22:00 Rakefile
drwxr-xr-x  4 staff   136B Feb 12 22:00 lib/
-rw-r--r--  1 staff   793B Feb 12 22:00 somegem.gemspec


$ rake -T
rake build    # Build somegem-0.0.1.gem into the pkg directory
rake install  # Build and install somegem-0.0.1.gem into system gems
rake release  # Create tag v0.0.1 and build and push somegem-0.0.1.gem to Rubygems


$ mate . # removing TODOs from the .gemspec


$ rake install # notice this is not pushing to rubygems
somegem 0.0.1 built to pkg/somegem-0.0.1.gem
somegem (0.0.1) installed


$ gem list somegem

*** LOCAL GEMS ***

somegem (0.0.1)


$ gem search -r somegem # does not show up in rubygems list

*** REMOTE GEMS ***
like image 179
Joshua Cheek Avatar answered Sep 21 '22 19:09

Joshua Cheek