/Users/Eamonn/.rvm/rubies/ruby-1.9.3-p484/lib/ruby/site_ruby/1.9.1/rubygems/core_ext/kernel_require.rb:55:in require': cannot load such file -- gosu (LoadError)
from /Users/Eamonn/.rvm/rubies/ruby-1.9.3-p484/lib/ruby/site_ruby/1.9.1/rubygems/core_ext/kernel_require.rb:55:in
require'
from /Users/Eamonn/Programming/Ruby/Tests/main.rb:10:in `<main>'
[Finished in 0.2s with exit code 1]
[shell_cmd: ruby "/Users/Eamonn/Programming/Ruby/Tests/main.rb"]
[dir: /Users/Eamonn/Programming/Ruby/Tests]
[path: /usr/bin:/bin:/usr/sbin:/sbin]
=begin
This very simple example demonstrates the Gosu::Window update/draw
loop by incrementing a counter on each update, and drawing the value
on each call to draw.
=end
require 'rubygems'
require 'gosu'
class GameWindow < Gosu::Window
def initialize
super(640,480,false)
self.caption = "Update/Draw Demo"
# we load the font once during initialize, much faster than
# loading the font before every draw
@font = Gosu::Font.new(self, Gosu::default_font_name, 20)
@counter = 0
end
def update
@counter += 1
end
def draw
@font.draw(@counter, 0, 0, 1)
end
def button_down(id)
if id == Gosu::KbEscape
close # exit on press of escape key
end
end
end
window = GameWindow.new
window.show
rvm
and just install Gosu into the 2.0.0 Ruby using the Xcode command line tools. rvm
has a habit of picking bizarre compilers from homebrew to compile stuff.rvm use system
, verify that it is indeed Ruby 2.0.0 and then try sudo gem install gosu
.Powered by mwForum 2.29.7 © 1999-2015 Markus Wichitill