small medium large xlarge

03 Jun 2016, 09:58
liuzhousenye (1 post)

it seems i cannot use require to load gem gosu. here is my code :

require ‘gosu’

class WhackARuby < Gosu::Window def initialize super 800,600,false self.caption = “Whack the Ruby!” end


window =

and i got this error :

/System/Library/Frameworks/Ruby.framework/Versions/2.0/usr/lib/ruby/2.0.0/rubygems/core_ext/kernel_require.rb:55:in require': cannot load such file -- gosu (LoadError) from /System/Library/Frameworks/Ruby.framework/Versions/2.0/usr/lib/ruby/2.0.0/rubygems/core_ext/kernel_require.rb:55:in require’ from /Users/kira/Desktop/Games/WhackARuby/whack_a_ruby.rb:1:in `' [Finished in 0.1s with exit code 1]

i use sublime 2 and macbook.

03 Jun 2016, 11:46
Mark Sobkowicz (17 posts)

Sorry to hear you’re having trouble so early. Did you do the setup in the first chapter, up and including the “sudo gem install gosu”? Did that seem to work? You can see all your gems by going to the terminal and typing ‘gem list’. Is gosu in that list?

29 Sep 2016, 19:54
nano (2 posts)

Hi Mark I had the same issue and I can see the gosu gem listed on my side, what should I do then?

29 Sep 2016, 20:42
nano (2 posts)

Hey Mark I could solve the problem by my side, I had a jRuby installation in my local so the gems were being installed under the jRuby gem environment. I just uninstall my jRuby installation and installed the gems again so they are installed under Ruby gem environment and this worked! :D. Thanks!

You must be logged in to comment