console - Gem not available in self executing ruby file -


i have written myself simple ruby script requires listen gem. running in console works perfectly.

$ ruby script.rb args 

i passing pwd argument. got annoyed of wanted make script executable across linux. added following line beginning of script

#!/usr/bin/env ruby  require "listen" ... 

when use self executing file, runs error.

$ ./script.rb 

output:

./listen.rb:55: uninitialized constant listen (nameerror)     ./script.rb:3:in `require'     ./script.rb:3 

do have suggestions cause of problem be? have 1 guess: #!/usr/bin/env ruby calls different ruby env $ ruby is. how can find out? (i using rbenv manage rubys)


Comments

Popular posts from this blog

ios - UICollectionView Self Sizing Cells with Auto Layout -

node.js - ldapjs - write after end error -

DOM Manipulation in Wordpress (and elsewhere) using php -