いつもと違うパソコンでrubyをインストールして開発をしようとしましたが、コマンドプロンプトにファイル名を書いても実行されません。なぜなのでしょうか。インストールしたバージョンはruby 1.93p551です。
これは、いつもやっているパソコンにも入っていますが、普通に実行できていました。
エラー文
ruby
1C:/Ruby193/lib/ruby/site_ruby/1.9.1/rubygema/custom_require.rb:36:in'require' 2 from E:.window.rb:1:in '<top (required>' 3 from C:/Ruby193/lib/ruby/site_ruby/1.9.1/rubygems/custom_require.rb:36:in'require' 4 from C:/Ruby193/lib/ruby/site_ruby/1.9.1/rubygems/custom_require.rb:36:in'require' 5 from main.rb:2:in
main.rb
ruby
1#!ruby -Ks 2require "./window.rb" 3require "./kuizu.rb" 4require "./zairyo.rb" 5 6window = Window.new 7window.drawBack 8window.gamestart 9window.refresh 10 11while true do 12 while event = SDL::Event2.poll do 13 case event 14 when SDL::Event2::Quit 15 exit 16 when SDL::Event2::MouseButtonDown 17 x = event.x 18 y = event.y 19 if window.kuizuclicked?(x,y) 20 hajime 21 window.refresh 22 end 23 if window.zairyoclicked?(x,y) 24 zairyo = Zairyo.new 25 zairyo.kaisi 26 SDL.init 27 end 28 end 29 end 30 31end
window.rb
ruby
1require "sdl" 2require "./color.rb" 3 4 5class Window 6 WINDOW_YOKO = 750 7 WINDOW_TATE = 550 8 BITPIKUSERU = 0 9 KUIZUX = 550 10 KUIZUY = 200 11 ZAIRYOX = 570 12 ZAIRYOY = 300 13def initialize 14 SDL.init(SDL::INIT_EVERYTHING) 15 @screen = SDL.set_video_mode(WINDOW_YOKO,WINDOW_TATE,BITPIKUSERU,SDL::SWSURFACE) 16 SDL::TTF.init 17 @font = SDL::Kanji.open("font/jiskan24.bdf",24) 18 @font.set_coding_system(SDL::Kanji::SJIS) 19end 20 21def drawBack 22 @screen.fill_rect(0,0,WINDOW_YOKO,WINDOW_TATE,Color::GREEN) 23 @font.put(@screen,"###",230,50,255,255,255) 24end 25 26def refresh 27 @screen.update_rect(0,0,0,0) 28end 29 30def gamestart 31 @font.put(@screen,"##",KUIZUX,KUIZUY,255,255,255) 32 @font.put(@screen,"####", ZAIRYOX,ZAIRYOY,255,255,255) 33end 34 35def kuizuclicked?(x,y) 36 if (KUIZUX <= x) and (x <= 690) and (KUIZUY <= y) and (y <= 230) 37 return true 38 else 39 return false 40 end 41end 42 43def zairyoclicked?(x,y) 44 if (ZAIRYOX <= x) and (x <= 600) and (ZAIRYOY <= y) and (y <= 330) 45 return true 46 else 47 return false 48 end 49end 50 51end
分かる方よろしくお願いします。
回答1件
あなたの回答
tips
プレビュー
バッドをするには、ログインかつ
こちらの条件を満たす必要があります。
2016/08/09 13:53
2016/09/03 01:20
2016/09/03 01:25
2016/09/03 01:32
2016/09/03 01:36
2016/09/03 01:41
2016/09/03 01:43
2016/09/03 05:40
2016/09/03 11:15