From: 7stud -- Date: 2009-02-14T15:09:46+09:00 Subject: Re: how to require more than one thing from the command line Roger Pack wrote: > Roger Pack wrote: >> Is there a way to do this? >> $ ruby -rrubygems -rfacets -e '3' >> ruby: no such file to load -- facets (LoadError) > > Seems this is a gems quirk of some type. > > >> Also is there a way to do something like >> $ ruby -e 'initialization code' filename.rb > > As per Nobu's advice. > ruby -e 'some pre init stuff; load($0 = ARGV.shift)' filename.rb > That doesn't work for me: r1test.rb -------- puts "hello" puts x $ ruby -e 'x=10; load($0 = ARGV.shift)' r1test.rb hello ./r1test.rb:2: undefined local variable or method `x' for main:Object (NameError) from -e:1:in `load' from -e:1 -- Posted via http://www.ruby-forum.com/.