ホームにhello_world.rbを作りました。
class HelloController < Controller
def start
puts "Hello, World!"
end
end
と書きました。trema run hello_trema.rbとやると、大量のエラーがでました…
/var/lib/gems/2.2.0/gems/trema-0.8.4/lib/trema/command.rb:40:in `load': cannot load such file -- hello_trema.rb (LoadError)
from /var/lib/gems/2.2.0/gems/trema-0.8.4/lib/trema/command.rb:40:in `run'
from /var/lib/gems/2.2.0/gems/trema-0.8.4/bin/trema:54:in `block (2 levels) in <module:App>'
from /var/lib/gems/2.2.0/gems/gli-2.13.4/lib/gli/command_support.rb:126:in `call'
from /var/lib/gems/2.2.0/gems/gli-2.13.4/lib/gli/command_support.rb:126:in `execute'
from /var/lib/gems/2.2.0/gems/gli-2.13.4/lib/gli/app_support.rb:296:in `block in call_command'
from /var/lib/gems/2.2.0/gems/gli-2.13.4/lib/gli/app_support.rb:309:in `call'
from /var/lib/gems/2.2.0/gems/gli-2.13.4/lib/gli/app_support.rb:309:in `call_command'
from /var/lib/gems/2.2.0/gems/gli-2.13.4/lib/gli/app_support.rb:83:in `run'
from /var/lib/gems/2.2.0/gems/trema-0.8.4/bin/trema:260:in `<module:App>'
from /var/lib/gems/2.2.0/gems/trema-0.8.4/bin/trema:14:in `<module:Trema>'
from /var/lib/gems/2.2.0/gems/trema-0.8.4/bin/trema:12:in `<top (required)>'
from /usr/local/bin/trema:23:in `load'
from /usr/local/bin/trema:23:in `<main>'
ruby -vと打つとruby 2.2.3p173、trema -vと打つとVERSION 0.8.4と出てきます。どうすればよいでしょうか?よろしくお願いします。(Ubuntu14.04)
hello_world.rb と保存しているファイル名を hello_trema.rb へと変更して trema run hello_trema.rb と実行するか、
または、 hello_world.rb と保存しているファイル名をそのままにして trema run hello_world.rb と実行することで、表示されないでしょうか。
質問者
お礼
回答有難うございます!
質問者
補足
trema run hello_world.rbと入力すると、
/home/vaio/hello_world.rb:1:in `<top (required)>': uninitialized constant Controller (NameError)
from /var/lib/gems/2.2.0/gems/trema-0.8.4/lib/trema/command.rb:40:in `load'
from /var/lib/gems/2.2.0/gems/trema-0.8.4/lib/trema/command.rb:40:in `run'
from /var/lib/gems/2.2.0/gems/trema-0.8.4/bin/trema:54:in `block (2 levels) in <module:App>'
from /var/lib/gems/2.2.0/gems/gli-2.13.4/lib/gli/command_support.rb:126:in `call'
from /var/lib/gems/2.2.0/gems/gli-2.13.4/lib/gli/command_support.rb:126:in `execute'
from /var/lib/gems/2.2.0/gems/gli-2.13.4/lib/gli/app_support.rb:296:in `block in call_command'
from /var/lib/gems/2.2.0/gems/gli-2.13.4/lib/gli/app_support.rb:309:in `call'
from /var/lib/gems/2.2.0/gems/gli-2.13.4/lib/gli/app_support.rb:309:in `call_command'
from /var/lib/gems/2.2.0/gems/gli-2.13.4/lib/gli/app_support.rb:83:in `run'
from /var/lib/gems/2.2.0/gems/trema-0.8.4/bin/trema:260:in `<module:App>'
from /var/lib/gems/2.2.0/gems/trema-0.8.4/bin/trema:14:in `<module:Trema>'
from /var/lib/gems/2.2.0/gems/trema-0.8.4/bin/trema:12:in `<top (required)>'
from /usr/local/bin/trema:23:in `load'
from /usr/local/bin/trema:23:in `<main>'
となります。
お礼
回答有難うございます!
補足
trema run hello_world.rbと入力すると、 /home/vaio/hello_world.rb:1:in `<top (required)>': uninitialized constant Controller (NameError) from /var/lib/gems/2.2.0/gems/trema-0.8.4/lib/trema/command.rb:40:in `load' from /var/lib/gems/2.2.0/gems/trema-0.8.4/lib/trema/command.rb:40:in `run' from /var/lib/gems/2.2.0/gems/trema-0.8.4/bin/trema:54:in `block (2 levels) in <module:App>' from /var/lib/gems/2.2.0/gems/gli-2.13.4/lib/gli/command_support.rb:126:in `call' from /var/lib/gems/2.2.0/gems/gli-2.13.4/lib/gli/command_support.rb:126:in `execute' from /var/lib/gems/2.2.0/gems/gli-2.13.4/lib/gli/app_support.rb:296:in `block in call_command' from /var/lib/gems/2.2.0/gems/gli-2.13.4/lib/gli/app_support.rb:309:in `call' from /var/lib/gems/2.2.0/gems/gli-2.13.4/lib/gli/app_support.rb:309:in `call_command' from /var/lib/gems/2.2.0/gems/gli-2.13.4/lib/gli/app_support.rb:83:in `run' from /var/lib/gems/2.2.0/gems/trema-0.8.4/bin/trema:260:in `<module:App>' from /var/lib/gems/2.2.0/gems/trema-0.8.4/bin/trema:14:in `<module:Trema>' from /var/lib/gems/2.2.0/gems/trema-0.8.4/bin/trema:12:in `<top (required)>' from /usr/local/bin/trema:23:in `load' from /usr/local/bin/trema:23:in `<main>' となります。