Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP

Loading…

Passing options in /etc/gemrc doesn't work #827

Closed
benlangfeld opened this Issue · 2 comments

2 participants

@benlangfeld

Background:

vagrant@default-debian-720:~$ gem list

*** LOCAL GEMS ***

bigdecimal (1.2.3)
dotenv (0.9.0)
foreman (0.63.0)
io-console (0.4.2)
json (1.8.1)
minitest (4.7.5)
psych (2.0.2)
rake (10.1.0)
rdoc (4.1.0)
rubygems-update (2.2.2)
test-unit (2.1.0.0)
thor (0.18.1)
vagrant@default-debian-720:~$ gem env
RubyGems Environment:
  - RUBYGEMS VERSION: 2.2.2
  - RUBY VERSION: 2.1.0 (2013-12-25 patchlevel 0) [x86_64-linux]
  - INSTALLATION DIRECTORY: /usr/local/ruby/2.1.0/lib/ruby/gems/2.1.0
  - RUBY EXECUTABLE: /usr/local/ruby/2.1.0/bin/ruby
  - EXECUTABLE DIRECTORY: /usr/local/ruby/2.1.0/bin
  - SPEC CACHE DIRECTORY: /home/vagrant/.gem/specs
  - RUBYGEMS PLATFORMS:
    - ruby
    - x86_64-linux
  - GEM PATHS:
     - /usr/local/ruby/2.1.0/lib/ruby/gems/2.1.0
     - /home/vagrant/.gem/ruby/2.1.0
  - GEM CONFIGURATION:
     - :update_sources => true
     - :verbose => true
     - :backtrace => false
     - :bulk_threshold => 1000
  - REMOTE SOURCES:
     - https://rubygems.org/
  - SHELL PATH:
     - /usr/local/bin
     - /usr/bin
     - /bin
     - /usr/local/games
     - /usr/games

[FAIL] Attempt with gem: --bindir /usr/local/bin:

vagrant@default-debian-720:~$ cat /etc/gemrc
---
:backtrace: false
:benchmark: false
:update_sources: true
:bulk_threshold: 1000
:verbose: true
gem: --bindir /usr/local/bin

vagrant@default-debian-720:~$ sudo gem install bundler
Fetching: bundler-1.5.3.gem (100%)
Successfully installed bundler-1.5.3
Parsing documentation for bundler-1.5.3
Installing ri documentation for bundler-1.5.3
Done installing documentation for bundler after 2 seconds
1 gem installed

vagrant@default-debian-720:~$ ls -flh /usr/local/bin/
total 44K
drwxrwsr-x  2 root staff 4.0K Feb 14 20:20 .
-rwxr-xr-x  1 root staff 5.3K Feb 14 19:06 rbenv-install
-rwxr-xr-x  1 root staff  24K Feb 14 19:06 ruby-build
drwxrwsr-x 11 root staff 4.0K Feb 14 19:10 ..
-rwxr-xr-x  1 root staff 1.7K Feb 14 19:06 rbenv-uninstall

vagrant@default-debian-720:~$ sudo gem uninstall bundler
Remove executables:
    bundle, bundler

in addition to the gem? [Yn]  y
Removing bundle
Removing bundler
Successfully uninstalled bundler-1.5.3

[FAIL] Attempt with install: --bindir /usr/local/bin:

vagrant@default-debian-720:~$ cat /etc/gemrc
---
:backtrace: false
:benchmark: false
:update_sources: true
:bulk_threshold: 1000
:verbose: true
install: --bindir /usr/local/bin

vagrant@default-debian-720:~$ sudo gem install bundler
Fetching: bundler-1.5.3.gem (100%)
Successfully installed bundler-1.5.3
Parsing documentation for bundler-1.5.3
Installing ri documentation for bundler-1.5.3
Done installing documentation for bundler after 2 seconds
1 gem installed

vagrant@default-debian-720:~$ ls -flh /usr/local/bin/
total 44K
drwxrwsr-x  2 root staff 4.0K Feb 14 20:20 .
-rwxr-xr-x  1 root staff 5.3K Feb 14 19:06 rbenv-install
-rwxr-xr-x  1 root staff  24K Feb 14 19:06 ruby-build
drwxrwsr-x 11 root staff 4.0K Feb 14 19:10 ..
-rwxr-xr-x  1 root staff 1.7K Feb 14 19:06 rbenv-uninstall

vagrant@default-debian-720:~$ bundle
-bash: bundle: command not found
vagrant@default-debian-720:~$ sudo gem uninstall bundler
Remove executables:
    bundle, bundler

in addition to the gem? [Yn]  y
Removing bundle
Removing bundler
Successfully uninstalled bundler-1.5.3

[FAIL] Attempt with install: -n/usr/local/bin:

vagrant@default-debian-720:~$ cat /etc/gemrc
---
:backtrace: false
:benchmark: false
:update_sources: true
:bulk_threshold: 1000
:verbose: true
install: -n/usr/local/bin

vagrant@default-debian-720:~$ sudo gem install bundler
Fetching: bundler-1.5.3.gem (100%)
Successfully installed bundler-1.5.3
Parsing documentation for bundler-1.5.3
Installing ri documentation for bundler-1.5.3
Done installing documentation for bundler after 2 seconds
1 gem installed

vagrant@default-debian-720:~$ ls -flh /usr/local/bin/
total 44K
drwxrwsr-x  2 root staff 4.0K Feb 14 20:20 .
-rwxr-xr-x  1 root staff 5.3K Feb 14 19:06 rbenv-install
-rwxr-xr-x  1 root staff  24K Feb 14 19:06 ruby-build
drwxrwsr-x 11 root staff 4.0K Feb 14 19:10 ..
-rwxr-xr-x  1 root staff 1.7K Feb 14 19:06 rbenv-uninstall

vagrant@default-debian-720:~$ sudo gem uninstall bundler
Remove executables:
    bundle, bundler

in addition to the gem? [Yn]  y
Removing bundle
Removing bundler
Successfully uninstalled bundler-1.5.3

[PASS] Attempt passing on command line:

vagrant@default-debian-720:~$ sudo gem install --bindir /usr/local/bin bundler
Fetching: bundler-1.5.3.gem (100%)
Successfully installed bundler-1.5.3
Parsing documentation for bundler-1.5.3
Installing ri documentation for bundler-1.5.3
Done installing documentation for bundler after 2 seconds
1 gem installed

vagrant@default-debian-720:~$ ls -flh /usr/local/bin/
total 52K
drwxrwsr-x  2 root staff 4.0K Feb 14 21:54 .
-rwxr-xr-x  1 root staff  509 Feb 14 21:54 bundle
-rwxr-xr-x  1 root staff 5.3K Feb 14 19:06 rbenv-install
-rwxr-xr-x  1 root staff  24K Feb 14 19:06 ruby-build
-rwxr-xr-x  1 root staff  510 Feb 14 21:54 bundler
drwxrwsr-x 11 root staff 4.0K Feb 14 19:10 ..
-rwxr-xr-x  1 root staff 1.7K Feb 14 19:06 rbenv-uninstall

vagrant@default-debian-720:~$ which bundle
/usr/local/bin/bundle

vagrant@default-debian-720:~$ bundle -v
Bundler version 1.5.3
@drbrain drbrain added this to the 2.3 milestone
@drbrain drbrain closed this issue from a commit
@drbrain drbrain Show system configuration directory in `gem env`
This allows users to determine where to put the all-users gemrc.

Fixes #827
f9f7d80
@drbrain drbrain closed this in f9f7d80
@drbrain
Owner

The help message in gem env was incorrect, so I fixed the output. The gemrc is lookup up in the system configuration directory which is probably /usr/local/etc for your system:

$ ruby -retc -e 'p Etc.sysconfdir'
"/usr/local/etc"
@benlangfeld

Thanks @drbrain, that fixed it!

@zzak zzak referenced this issue from a commit in zzak/rubygems
@drbrain drbrain Show system configuration directory in `gem env`
This allows users to determine where to put the all-users gemrc.

Fixes #827
5ed4e27
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Something went wrong with that request. Please try again.