Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

When running gosu-examples in bin/* - outputs errors (added logs) #12

Closed
Juksefantomet opened this issue Aug 26, 2018 · 4 comments
Closed

Comments

@Juksefantomet
Copy link

This issue contains attempts and error outputs in relation to ruby version:

ruby 2.5.1p57 (2018-03-29 revision 63029) [x64-mingw32]

C:\git_projects\gosu-examples\bin>ruby gosu-examples
*** Cannot load chipmunk_and_rmagick.rb:
cannot load such file -- chipmunk

*** Cannot load chipmunk_integration.rb:
cannot load such file -- chipmunk

*** Cannot load opengl_integration.rb:
cannot load such file -- gl

*** Cannot load rmagick_integration.rb:
cannot load such file -- rmagick

Added Gemfile with contents to tackle issues

source 'https://rubygems.org'
gem 'opengl'
gem 'chipmunk'
gem 'rmagick'

**Chipmunk installs as intended

ERROR:  Error installing opengl:
        The last version of opengl (= 0.10.0) to support your Ruby & RubyGems was 0.10.0. Try installing it with `gem install opengl -v 0.10.0`
        opengl requires Ruby version < 2.5, >= 2.0. The current ruby version is 2.5.0.

As above states, ruby 2.5.0+ will not work as inteded i reckon?

C:\git_projects\gosu-examples>gem install rmagick
Fetching: rmagick-2.16.0.gem (100%)
Temporarily enhancing PATH for MSYS/MINGW...
Building native extensions. This could take a while...
ERROR:  Error installing rmagick:
        ERROR: Failed to build gem native extension.

    current directory: C:/Ruby25_64/lib/ruby/gems/2.5.0/gems/rmagick-2.16.0/ext/RMagick
C:/Ruby25_64/bin/ruby.exe -r ./siteconf20180826-12800-m7rxdg.rb extconf.rb
*** extconf.rb failed ***
Could not create Makefile due to some reason, probably lack of necessary
libraries and/or headers.  Check the mkmf.log file for more details.  You may
need configuration options.

Provided configuration options:
        --with-opt-dir
        --without-opt-dir
        --with-opt-include
        --without-opt-include=${opt-dir}/include
        --with-opt-lib
        --without-opt-lib=${opt-dir}/lib
        --with-make-prog
        --without-make-prog
        --srcdir=.
        --curdir
        --ruby=C:/Ruby25_64/bin/$(RUBY_BASE_NAME)
extconf.rb:141:in ``': No such file or directory - identify -version (Errno::ENOENT)
        from extconf.rb:141:in `configure_compile_options'
        from extconf.rb:16:in `initialize'
        from extconf.rb:548:in `new'
        from extconf.rb:548:in `<main>'

extconf failed, exit code 1

Gem files will remain installed in C:/Ruby25_64/lib/ruby/gems/2.5.0/gems/rmagick-2.16.0 for inspection.
Results logged to C:/Ruby25_64/lib/ruby/gems/2.5.0/extensions/x64-mingw32/2.5.0/rmagick-2.16.0/gem_make.out

Lacking imagemagick i reckon

--

in addition for windows based i discovered the gem:

https://rubygems.org/gems/rmagick-windows

This contains fixes it claims, does this require investigation in regards to bugs that might affect stuff in relation to images and others?

Dumping install log here aswell

C:\git_projects\gosu-examples>gem install rmagick-windows
Fetching: rmagick-windows-2.16.5.gem (100%)
Temporarily enhancing PATH for MSYS/MINGW...
Building native extensions. This could take a while...
ERROR:  Error installing rmagick-windows:
        ERROR: Failed to build gem native extension.

    current directory: C:/Ruby25_64/lib/ruby/gems/2.5.0/gems/rmagick-windows-2.16.5/ext/RMagick
C:/Ruby25_64/bin/ruby.exe -r ./siteconf20180826-10484-1wu36fr.rb extconf.rb
*** extconf.rb failed ***
Could not create Makefile due to some reason, probably lack of necessary
libraries and/or headers.  Check the mkmf.log file for more details.  You may
need configuration options.

Provided configuration options:
        --with-opt-dir
        --without-opt-dir
        --with-opt-include
        --without-opt-include=${opt-dir}/include
        --with-opt-lib
        --without-opt-lib=${opt-dir}/lib
        --with-make-prog
        --without-make-prog
        --srcdir=.
        --curdir
        --ruby=C:/Ruby25_64/bin/$(RUBY_BASE_NAME)
extconf.rb:141:in ``': No such file or directory - magick identify -version (Errno::ENOENT)
        from extconf.rb:141:in `configure_compile_options'
        from extconf.rb:16:in `initialize'
        from extconf.rb:542:in `new'
        from extconf.rb:542:in `<main>'

extconf failed, exit code 1

Gem files will remain installed in C:/Ruby25_64/lib/ruby/gems/2.5.0/gems/rmagick-windows-2.16.5 for inspection.
Results logged to C:/Ruby25_64/lib/ruby/gems/2.5.0/extensions/x64-mingw32/2.5.0/rmagick-windows-2.16.5/gem_make.out
@jlnr
Copy link
Member

jlnr commented Sep 4, 2018

Yeah, that is why I didn't include a Gemfile: these gems break all the time.

I'm not sure what I can do about this issue, other than omitting these examples when their dependencies are not met.

@Juksefantomet
Copy link
Author

Oh I can see that.

I'm curious though as this is the example "showcase" for the examples.

Just making a suggestion here but..

Wouldn't it be benefitial to have a pure ruby only gosu - only - examples project. if this is to advocate the usage of gosu it would be neat to see a functional one not using external gems.

And then maybe a gosu-advanced-examples would be more of a "extras included" examples bundle where you would implement such (namely this gosu-examples project)

This would effectively allow you to make a Gemfile with ruby and gosu version locked to a stabile release.

Only in the advanced examples project locked to a stable ruby and gosu release that works in accordance with the additional gems, but with a disclaimer saying those gems are third party and might cause conflicts and such if not adhering to the recommended stabile versions of ruby and gosu.

@jlnr
Copy link
Member

jlnr commented Sep 10, 2018

Hmmm, to be honest I'm not a fan of this idea. It adds more overhead, and I don't want to fragment a niche project like gosu-examples any further.

A Gemfile would not help users who gem install gosu-examples, except if the gem dependencies were locked to very specific versions. All we really need for pure-Ruby examples is a recent-enough version of Gosu, and the gemspec lets us do this.

And people who download/git-clone the pure-Ruby repository shouldn't have to change their Ruby version to whatever I last pinned in .ruby-version. A Gemfile (without .lock) would let us specify a minimum version of Gosu, but I'm not sure if that alone is worth the extra steps.

The problem with the third-party gems is that I don't think it's viable to create a complex set of rules about Ruby versions, gem versions, and operating systems on which all three gems (OpenGL, Chipmunk, RMagick) will work. And even if that's possible, someone who wants to see the Chipmunk example shouldn't have to jump through the hoops necessary to install the RMagick gem.

The only solution I can think of is to have better error reporting when external gems cannot be loaded. Or we could drop integration examples with fragile libraries altogether. But since Ruby lets us gracefully ignore LoadErrors, why throw code away 🤷‍♂️

Closing this for now. I want to update the UI of gosu-examples some time after the Gosu 1.0 release (so, anytime from next month to 2021... :D). I'll try to improve the error messages when I get to this.

@jlnr jlnr closed this as completed Sep 10, 2018
@Juksefantomet
Copy link
Author

A Gemfile would not help users who gem install gosu-examples, except if the gem dependencies were locked to very specific versions. All we really need for pure-Ruby examples is a recent-enough version of Gosu, and the gemspec lets us do this.

What you're saying here is exactly what i was pointing out :)

the fragmentation was to separate the two, and pure projects have a recommended ruby version to pin a stable one. that was my only point. the separation of a more advanced one was a suggestion if one wanted to keep the third party unstable packages that cause issues.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants