Not logged inGosu Forums
Forum back to libgosu.org Help Search Register Login
Up Topic Gosu / Gosu Exchange / Cannot install Gosu on OS X 10.9.1?
- - By Eamonn Date 2014-01-30 21:22
I recently put an SSD into my MacBook Pro, and now I cannot seem to install Gosu. It installs fine, and says there was 1 gem installed, but when I build and run any Gosu code, I get the following error message:

/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]


This is both in Sublime Text 3 and from the command line. It seems to me that it cannot find my Gosu installation. I have no idea where it installs to. I installed it using "sudo gem install gosu", because otherwise it just get's stuck hanging. I'm still pretty inexperienced with Gosu, but I have a better understanding of both game development and Ruby now, so I think I'll give it a go again!

I doubt this would be the issue, but when installing I get LOADS of errors from CPP files. I have Xcode Command Line Tools installed, and I had one hell of a time installing Ruby itself. It look me like 5 hours to install it because it kept just producing errors and not working, but after trying the same thing over and over again it worked. This isn't working with Gosu :(

Thanks! Any help is appreciated!

P.S. I'm using the example Gosu code, which is the following:

=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
Parent - - By jlnr (dev) Date 2014-02-02 12:10
Keep in mind that OS X 10.9 ships with two Ruby installations already, 2.0.0 and 1.8.7. Gosu works fine with both of these (I'm writing this from a 10.9 machine). My suggestion would be to skip 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.

To try this, use rvm use system, verify that it is indeed Ruby 2.0.0 and then try sudo gem install gosu.

If you are trying to avoid installing gems into the system, then please post the CPP errors you've received and maybe I have an idea about those.
Parent - - By Eamonn Date 2014-02-02 20:07
Ok well I will post the CPP errors.

I didn't get Ruby pre installed on my Mavericks, I had to download Ruby myself. I installed V2.1.0. I am using an official Mavericks installation, not a Hackintosh.

I decided to install JewelaryBox and use Ruby 1.9.3-p484, just in case Gosu didn't work with Ruby 2.1.0.

I cannot find a way to download Ruby 2.0.0, just Ruby 2.1.0.

Anyway, after switching to Ruby 2.1.0 using JewelaryBox, and using the RVM command, Gosu now works! :D Thanks!
Parent - By jlnr (dev) Date 2014-02-02 21:41
?!? I am pretty sure that OS X ships with Ruby. Try "/usr/bin/ruby -v" on the Terminal - it should print "ruby 2.0.0p247 (2013-06-27 revision 41674) [universal.x86_64-darwin13]".

Anyway, if 2.1.0 works, then all the better, I guess! :)
Parent - By erisdiscord Date 2014-02-03 16:31
I'd like to chime in to add that, if you absolutely must manage multiple ruby versions on your system, use rbenv instead of rvm. It's missing some of the more advanced features of rvm, but you probably don't use them.

rbenv doesn't handle installing Ruby versions on its own, but there is a plugin, ruby-build, that will do that for you.
Up Topic Gosu / Gosu Exchange / Cannot install Gosu on OS X 10.9.1?

Powered by mwForum 2.29.7 © 1999-2015 Markus Wichitill