netlist.rb:2:in `require': no such file to load -- subexec (LoadError) #1

Open
natv opened this Issue Aug 10, 2012 · 9 comments

2 participants

@natv

It could be something I'm doing wrong, kind of new to Ruby. I'm running this on the latest version of Backtrack .

This is what I get when testing:

t# ruby netlist.rb facebook
netlist.rb:2:in `require': no such file to load -- subexec (LoadError)

I did a "gem install subexec":

t# gem install subexec
Successfully installed subexec-0.2.2
1 gem installed
Installing ri documentation for subexec-0.2.2...
Installing RDoc documentation for subexec-0.2.2...

but I still get the same error.

Thanks

@EricR
Owner

What version of Ruby are you running?

If you're running Ruby 1.8, try:

ruby -rubygems netlist.rb facebook

Alternatively, you can add RubyGems to RUBYOPT:

export RUBYOPT="rubygems"
@natv

t# ruby --version
ruby 1.9.2dev (2010-07-02) [i486-linux]

Thanks Eric

@EricR
Owner

What does running gem env output?

@natv

gem env

RubyGems Environment:

  • RUBYGEMS VERSION: 1.3.7
  • RUBY VERSION: 1.9.2 (2010-07-02 patchlevel -1) [i486-linux]
  • INSTALLATION DIRECTORY: /var/lib/gems/1.9.2
  • RUBY EXECUTABLE: /usr/bin/ruby1.9.2
  • EXECUTABLE DIRECTORY: /var/lib/gems/1.9.2/bin
  • RUBYGEMS PLATFORMS:
    • ruby
    • x86-linux
  • GEM PATHS:
    • /var/lib/gems/1.9.2
    • /root/.gem/ruby/1.9.2
  • GEM CONFIGURATION:
    • :update_sources => true
    • :verbose => true
    • :benchmark => false
    • :backtrace => false
    • :bulk_threshold => 1000
  • REMOTE SOURCES:
@EricR
Owner

Hmmm, not exactly sure right off the bat.. Do you have RVM installed? Also, what's which ruby output?

@natv

Hi Eric,

which ruby

/usr/bin/ruby

If you let me know how to check for RVM I will.

@EricR
Owner

There's your issue. ruby points to "/usr/bin/ruby", but gem is using "/usr/bin/ruby1.9.2". To verify this, could you try running /usr/bin/ruby1.9.2 netlist.rb facebook?

RVM is a popular Ruby version manager, and it helps you deal with multiple installations of Ruby and multiple gemsets on your machine. Without it, your environment may end up referencing different Ruby paths, which seems to be what's happening here.

@natv

Hmm. still getting the same thing, tested both ways:

/usr/bin/ruby1.9.2 netlist.rb facebook

netlist.rb:2:in require': no such file to load -- subexec (LoadError)
from netlist.rb:2:in

'

/usr/bin/ruby netlist.rb facebook

netlist.rb:2:in require': no such file to load -- subexec (LoadError)
from netlist.rb:2:in

'

@EricR
Owner

Huh. I'm not really sure, sorry!

The last thing I can think of would be to try: export GEM_HOME="/var/lib/gems/1.9.2" and export GEM_HOME="/root/.gem/ruby/1.9.2"

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment