我正在使用Cloud9 IDE并安装了Ruby gems simple2d和ruby2d。我正在尝试运行此代码:
require 'ruby2d'
set width: 300, height: 200
s = Square.new
s.color = 'red'
show
当我运行我的代码时,屏幕底部的小终端会显示类似"您的代码正在运行... link_goes_here"。点击该链接会转到与 Ruby on Rails: Welcome Aboard非常相似的页面。
我是Ruby的新手,但是要明白这个页面表明"其他步骤"可能需要采取措施才能看到您的应用程序运行(即设置模型,控制器和路由)。然而,经过一段谷歌搜索后,人们似乎只做了这些"额外的步骤"做什么" HTML"相关的事情(请原谅我缺乏适当的术语)。例如,Getting Started with Rails引导读者更改Ruby on Rails: Welcome Aboard页面以说明" Hello,Rails" (然后是其他事情)。
有人可以解释/告诉我该怎么做才能运行我的代码吗?
谢谢!
编辑:2018-03-27
看来我有一个Gemfile:Cloud9 IDE Directory
当我跑bundle install
时,我得到以下输出:
Using rake 12.0.0
Using i18n 0.8.6
Using json 1.8.6
Using minitest 5.10.3
Using thread_safe 0.3.6
Using tzinfo 1.2.3
Using activesupport 4.2.5
Using builder 3.2.3
Using erubis 2.7.0
Using mini_portile2 2.2.0
Using nokogiri 1.8.0
Using rails-deprecated_sanitizer 1.0.3
Using rails-dom-testing 1.0.8
Using loofah 2.0.3
Using rails-html-sanitizer 1.0.3
Using actionview 4.2.5
Using rack 1.6.8
Using rack-test 0.6.3
Using actionpack 4.2.5
Using globalid 0.4.0
Using activejob 4.2.5
Using mime-types-data 3.2016.0521
Using mime-types 3.1
Using mail 2.6.6
Using actionmailer 4.2.5
Using activemodel 4.2.5
Using arel 6.0.4
Using activerecord 4.2.5
Using debug_inspector 0.0.3
Using binding_of_caller 0.7.2
Using bundler 1.16.1
Using byebug 9.1.0
Using coffee-script-source 1.12.2
Using execjs 2.7.0
Using coffee-script 2.4.1
Using thor 0.20.0
Using railties 4.2.5
Using coffee-rails 4.1.1
Using concurrent-ruby 1.0.5
Using ffi 1.9.18
Using multi_json 1.12.1
Using jbuilder 2.7.0
Using jquery-rails 4.3.1
Using sprockets 3.7.1
Using sprockets-rails 3.2.0
Using rails 4.2.5
Using rb-fsevent 0.10.2
Using rb-inotify 0.9.10
Using rdoc 4.3.0
Using sass-listen 4.0.0
Using sass 3.5.1
Using tilt 2.0.8
Using sass-rails 5.0.6
Using sdoc 0.4.2
Using spring 2.0.2
Using sqlite3 1.3.13
Using turbolinks-source 5.0.3
Using turbolinks 5.0.1
Using uglifier 3.2.0
Using web-console 2.3.0
Bundle complete! 12 Gemfile dependencies, 60 gems now installed.
Use
bundle info [gemname]
to see where a bundled gem is installed.
我在尝试运行代码时仍遇到同样的问题。