Not logged inGosu Forums
Forum back to Help Search Register Login
Up Topic Gosu / Gosu Exchange / Problem running Ruby4Kids!!
- - By rubylearning Date 2013-12-10 16:55
I'm trying to set up the Ruby for kids tutorial, and am completely stuck on the first step.
Whenever I try and run the main file as requested I get this error:

<internal:lib/rubygems/custom_require>:29:in require': no such file to load -- gosu (LoadError)
  from <internal:lib/rubygems/custom_require>:29:in
  from main.rb:1:in `<main>'

I have run the $ sudo gem install gosu any number of times in different locations, upon studying the outcome I've located this:

ERROR:  Error installing gosu:
  ERROR: Failed to build gem native extension.

    /Users/carlosamengual/.rvm/rubies/ruby-1.9.2-p320/bin/ruby extconf.rb
The Gosu gem requires some libraries to be installed system-wide.
See the following site for a list:

I'm assuming I'm doing something wrong. I've visited the site it says, but I believe, since it is a ruby project I don't need anything else?? Can anyone advise as to how to fix it?? Below is a little more info of how I am operating:

iMac-Morchetinis:my_first_game carlosamengual$ ruby -v
ruby 1.9.2p320 (2012-04-20 revision 35421) [x86_64-darwin12.5.0]
iMac-Morchetinis:my_first_game carlosamengual$ which ruby
iMac-Morchetinis:my_first_game carlosamengual$ gem -v
iMac-Morchetinis:my_first_game carlosamengual$ which gem
Many many thanks in advanced!!
Parent - - By jlnr (dev) Date 2013-12-11 20:48
If you are on a Mac, the only thing you need is an Apple compiler. Recently, there have been a few reports about rvm installing gcc46 or something which lacks support for Objective C. Can you please let me know what this command produces on the Terminal:
$ ruby -e "puts RbConfig::CONFIG['CXX']"

This will output xcrun clang++ on a normal OS X installation with Xcode, but apple-gcc42 is fine as well. gcc46 or similar is not, because it cannot use Apple's system libraries.
Parent - - By rubylearning Date 2013-12-12 16:15
Thanks for your help, the command you ask returns the following:
-e:1:in <main>': uninitialized constant Object::RbConfig (NameError)`
I am sorry to not be any more help, but I am a complete beginner!!
Parent - - By jlnr (dev) Date 2013-12-14 14:33
Oops, my mistake. It is: $ ruby -rrbconfig -e "puts RbConfig::CONFIG['CXX']"

And I just realised it actually gives me nil on OS X 10.8, but with any luck your Ruby installation will tell you what it was compiled with. This one might also be useful:

$ ruby -rrbconfig -e "puts RbConfig::CONFIG['configure_args']"
Parent - - By rubylearning Date 2013-12-16 14:53

Thanks for your help, please find the responds I get form the commands you mention:
ruby -rrbconfig -e "puts RbConfig::CONFIG['CXX']"

ruby -rrbconfig -e "puts RbConfig::CONFIG['configure_args']"
'--prefix=/Users/carlosamengual/.rvm/rubies/ruby-1.9.3-p484' '--without-tcl' '--without-tk' '--enable-shared' 'CC=gcc-4.2' 'CFLAGS=-O3 -I/opt/sm/pkg/active/include' 'LDFLAGS=-L/opt/sm/pkg/active/lib'

Just to let you know i have been playing around with it as best I could and now my error reads as follows:

/Users/carlosamengual/.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/carlosamengual/.rvm/rubies/ruby-1.9.3-p484/lib/ruby/site_ruby/1.9.1/rubygems/core_ext/kernel_require.rb:55:in
  from main.rb:1:in `<main>'

I am assuming I am missing some basic gems or something??
Thanks and regards,
Parent - By jlnr (dev) Date 2013-12-16 18:55
The last error message only points out that the Gosu gem had not been installed correctly. Can you type gcc-4.2 --version to see which compiler that might be? It should say Apple GCC and if that's the case, then you are seeing a different error than other OS X users lately :(

I think that if a gem cannot be installed, there should be another error message along the lines of: "Results logged to /.../gems/gosu-.../.../gem_make.out". Do you see a message like that when trying to gem install gosu? If yes, can you please open the file, e.g. with open -e /some/path/to/gem_make.out, and paste the contents here?
Parent - - By erisdiscord Date 2013-12-15 05:57
ugh, is rvm seriously installing gcc just to compile Ruby? Man, I'm glad I ditched it a long time ago for rbenv.
Parent - By jlnr (dev) Date 2013-12-15 19:03
Well, the good thing is that it uses homebrew to do it, it doesn't hack it on its own. But the choice of gcc46 is pretty silly IMHO, when apple-gcc42 does the job and is more "standard". =( Anyway, the lesson is that binary gems have been a very good idea and I should try to bring them back.
Up Topic Gosu / Gosu Exchange / Problem running Ruby4Kids!!

Powered by mwForum 2.29.7 © 1999-2015 Markus Wichitill