I can't explain this -- why does globally installed gem with script fail in a directory with a Gemfi

I have a gem installed system-wide called scrapers that has a binary
called rubytapas. It will run nearly everywhere except within a
directory that contains a Gemfile.

It can be a completely empty directory otherwise, and the Gemfile can
be empty. It still fails by getting confused about finding
dependencies.

The gist https://gist.github.com/tamouse/9822711 shows what is
happening, I think.

The gist of the gist is:
https://gist.github.com/tamouse/9822711#file-gistfile1-txt-L35-L50

$ 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

$ touch Gemfile

$ 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

Gem scrapers: https://github.com/tamouse/scrapers

And I have the answer, just another stupid mouse trick. :slight_smile:

I had:

require ‘rubygems’
require ‘bundler/setup’

at the top of the bin file, so it was doing exactly what I told it to,
instead of what I wanted to have it do.

On Thu, Mar 27, 2014 at 8:03 PM, tamouse pontiki

On Thu, Mar 27, 2014 at 8:28 PM, tamouse pontiki
[email protected]wrote:

And I have the answer, just another stupid mouse trick. :slight_smile:

I had:

require ‘rubygems’
require ‘bundler/setup’

at the top of the bin file, so it was doing exactly what I told it to,
instead of what I wanted to have it do.

:slight_smile:

Looks like a useful gem.

On Fri, Mar 28, 2014 at 1:26 PM, Eric C.
[email protected] wrote:

at the top of the bin file, so it was doing exactly what I told it to,
instead of what I wanted to have it do.

:slight_smile:

Looks like a useful gem.

Feel free – fork it, play with it, PRs welcome

This forum is not affiliated to the Ruby language, Ruby on Rails framework, nor any Ruby applications discussed here.

| Privacy Policy | Terms of Service | Remote Ruby Jobs