I've tried all of the other solutions people have talked about on here, but none of them have helped / applied.
I've written a Ruby script that requires the spreadsheet gem. The requiring works fine when I execute the script normally with ruby myscript.rb
, but after running chmod +x myscript.rb
, and then trying to run the program with ./myscript.rb
I get the following error....
/System/Library/Frameworks/Ruby.framework/Versions/2.0/usr/lib/ruby/2.0.0/rubygems/core_ext/kernel_require.rb:45:in `require': cannot load such file -- spreadsheet (LoadError)
from /System/Library/Frameworks/Ruby.framework/Versions/2.0/usr/lib/ruby/2.0.0/rubygems/core_ext/kernel_require.rb:45:in `require'
from /Users/fcangialosi/dev/mTC/parse.rb:2:in `<top (required)>'
from /System/Library/Frameworks/Ruby.framework/Versions/2.0/usr/lib/ruby/2.0.0/rubygems/core_ext/kernel_require.rb:45:in `require'
from /System/Library/Frameworks/Ruby.framework/Versions/2.0/usr/lib/ruby/2.0.0/rubygems/core_ext/kernel_require.rb:45:in `require'
from /Users/fcangialosi/dev/mTC/interpreter.rb:1:in `<top (required)>'
from /System/Library/Frameworks/Ruby.framework/Versions/2.0/usr/lib/ruby/2.0.0/rubygems/core_ext/kernel_require.rb:45:in `require'
from /System/Library/Frameworks/Ruby.framework/Versions/2.0/usr/lib/ruby/2.0.0/rubygems/core_ext/kernel_require.rb:45:in `require'
from ./pmcnp.rb:7:in `<main>'
The beginning of my script looks like this:
#!/usr/bin/ruby
require 'rubygems'
require 'spreadsheet'
If anyone has any ideas, I would really appreciate it.