Problem with Gosu tutorial: Could not initialize SDL, No available video device

ruby

#1

Hi everyone,

I 'm trying to play Gosu tutorial.

but it doesn’t appear Window screen.
And when I try to run the Gosu, it shows

  • server error message
  • `initialize’: Could not initialize SDL
  • No available video device (RuntimeError)
/usr/local/rvm/gems/ruby-2.3.0@global/gems/gosu-0.12.1/lib/gosu/swig_patches.rb:20:in `initialize': Could not initialize SDL Video: No available video device (RuntimeError)
        from /usr/local/rvm/gems/ruby-2.3.0@global/gems/gosu-0.12.1/lib/gosu/swig_patches.rb:20:in `initialize'
        from /home/ubuntu/workspace/test.rb:13:in `initialize'
        from /home/ubuntu/workspace/test.rb:19:in `new'
        from /home/ubuntu/workspace/test.rb:19:in `<main>'

source code

require 'gosu'

class Tutorial < Gosu::Window
  def initialize
    super 640, 480
    self.caption = "Tutorial Game"
  end
  
  def update
    # ...
  end
  
  def draw
    # ...
  end
end

Tutorial.new.show
$ gem list

*** LOCAL GEMS ***

actioncable (5.1.3)
actionmailer (5.1.3)
actionpack (5.1.3)
actionview (5.1.3)
activejob (5.1.3)
activemodel (5.1.3)
activerecord (5.1.3)
activesupport (5.1.3)
arel (8.0.0)
bigdecimal (1.2.8)
builder (3.2.3)
bundler (1.15.3)
bundler-unload (1.0.2)
chipmunk (6.1.3.4)
concurrent-ruby (1.0.5)
did_you_mean (1.0.0)
erubi (1.6.1)
executable-hooks (1.3.2)
gem-wrappers (1.2.7)
globalid (0.4.0)
gosu (0.12.1)
i18n (0.8.6)
io-console (0.4.5)
json (1.8.3)
loofah (2.0.3)
mail (2.6.6)
method_source (0.8.2)
mime-types (3.1)
mime-types-data (3.2016.0521)
mini_portile2 (2.2.0)
minitest (5.8.3)
net-telnet (0.1.1)
nio4r (2.1.0)
nokogiri (1.8.0)
opengl (0.10.0)
power_assert (0.2.6)
psych (2.0.17)
rack (2.0.3)
rack-test (0.6.3)
rails (5.1.3)
rails-dom-testing (2.0.3)
rails-html-sanitizer (1.0.3)
railties (5.1.3)
rake (10.4.2)
rdoc (4.2.1)
rubygems-bundler (1.4.4)
rvm (1.11.3.9)
sprockets (3.7.1)
sprockets-rails (3.2.0)
test-unit (3.1.5)
thor (0.19.4)
thread_safe (0.3.6)
tzinfo (1.2.3)
websocket-driver (0.6.5)
websocket-extensions (0.1.2)

#2

i am getting the same error


#3

This is a bad news, Cloud9 is Web application it self. So it is not able to execute display screen.
However, I found an interesting thing from cloud9community.