Skip to content

Embed URL

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
**SOLVED** Why does globally installed gem/script fail when run in a directory with a Gemfile?
tamara@pontiki:~/a/b/c/d/e/f:2014-03-27@07:55:24
$ mkdir test_dir
tamara@pontiki:~/a/b/c/d/e/f:2014-03-27@07:55:31
$ pushd test_dir/
~/a/b/c/d/e/f/test_dir ~/a/b/c/d/e/f ~
tamara@pontiki:~/a/b/c/d/e/f/test_dir:2014-03-27@07:55:43
$ gem env
RubyGems Environment:
- RUBYGEMS VERSION: 2.0.14
- RUBY VERSION: 2.0.0 (2013-11-22 patchlevel 353) [x86_64-darwin13.0.0]
- INSTALLATION DIRECTORY: /Users/tamara/.gem/ruby/2.0.0
- RUBY EXECUTABLE: /opt/rubies/ruby-2.0.0-p353/bin/ruby
- EXECUTABLE DIRECTORY: /Users/tamara/.gem/ruby/2.0.0/bin
- RUBYGEMS PLATFORMS:
- ruby
- x86_64-darwin-13
- GEM PATHS:
- /Users/tamara/.gem/ruby/2.0.0
- /opt/rubies/ruby-2.0.0-p353/lib/ruby/gems/2.0.0
- GEM CONFIGURATION:
- :update_sources => true
- :verbose => true
- :backtrace => false
- :bulk_threshold => 1000
- "install" => "--no-wrappers --no-document"
- REMOTE SOURCES:
- https://rubygems.org/
tamara@pontiki:~/a/b/c/d/e/f/test_dir:2014-03-27@07:55:52
$ which rubytapas
/opt/rubies/ruby-2.0.0-p353/bin/rubytapas
tamara@pontiki:~/a/b/c/d/e/f/test_dir:2014-03-27@07:55:56
$ rubytapas
Commands:
rubytapas all # Download all rubytapas episodes
rubytapas download # Downloads the listed episode's files into a new directory with the episode tag in the given directory
rubytapas help [COMMAND] # Describe available commands or one specific command
tamara@pontiki:~/a/b/c/d/e/f/test_dir:2014-03-27@07:56:04
$ touch Gemfile
tamara@pontiki:~/a/b/c/d/e/f/test_dir:2014-03-27@07:56:08
$ rubytapas
/opt/rubies/ruby-2.0.0-p353/bin/rubytapas:4:in `require': cannot load such file -- thor (LoadError)
from /opt/rubies/ruby-2.0.0-p353/bin/rubytapas:4:in `<main>'
tamara@pontiki:~/a/b/c/d/e/f/test_dir:2014-03-27@07:56:12
$ gem env
RubyGems Environment:
- RUBYGEMS VERSION: 2.0.14
- RUBY VERSION: 2.0.0 (2013-11-22 patchlevel 353) [x86_64-darwin13.0.0]
- INSTALLATION DIRECTORY: /Users/tamara/.gem/ruby/2.0.0
- RUBY EXECUTABLE: /opt/rubies/ruby-2.0.0-p353/bin/ruby
- EXECUTABLE DIRECTORY: /Users/tamara/.gem/ruby/2.0.0/bin
- RUBYGEMS PLATFORMS:
- ruby
- x86_64-darwin-13
- GEM PATHS:
- /Users/tamara/.gem/ruby/2.0.0
- /opt/rubies/ruby-2.0.0-p353/lib/ruby/gems/2.0.0
- GEM CONFIGURATION:
- :update_sources => true
- :verbose => true
- :backtrace => false
- :bulk_threshold => 1000
- "install" => "--no-wrappers --no-document"
- REMOTE SOURCES:
- https://rubygems.org/
tamara@pontiki:~/a/b/c/d/e/f/test_dir:2014-03-27@07:57:34
$
@tamouse
Owner

Because at the top of the executable scripts I had:

require 'rubygems'
require 'bundler/setup'

so it was doing exactly what I told it to. Just not what I wanted it to.

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.