Forgive any incorrect vocabulary, I'm a ruby noob.
On my new dev machine (OSX Lion, Ruby 1.8.7) I was unable to run build.rb due to a requires error ('json'). After some googling, there are two solutions.
Solution that requires no changes to the code: Run the build script with a RUBYOPTS env variable set to -rubygems like:
$ RUBYOPT=-rubygems ./build.rb
Add require 'rubygems' above the require 'json' line in build.rb.
Either of these fixes allowed me to run the build script.
If we are going with the first, it probably warrants a little note in the readme.
actually that's because build.rb is for ruby 1.9 which has native json. It works in 1.8 yes, but that's a side effect
Gotcha .. well. .. this issue can serve as an archive for people running the stock OSX build of ruby .. at least as long as it happens to maintain backwards compatibility.
If we use the first solution, people with a vanilla system Ruby still need to gem install rubygems and gem install json before, right? (I’m asking for the documentation.)
gem install rubygems
gem install json
Require rubygems in build script so JSON is available in Ruby 1.8. Cl…
I don't remember if I had to install rubygems or json ... I think I may have had to install json but not rubygems. TBH the existence of this issue is almost enough to solve this, but adding the require just makes it that much easier. Thanks.