SPRING CLIを用いてgroovyのWebアプリケーションを実行したいのですが、spring runコマンドを打つと以下のエラーが発生してしまいます。
何が原因でしょうか?
(環境はmac)
「やったこと」
・SpringCLIインストール
・.bash_profileに、Sprign Boot CLIのPathを追加
・Desktop直下にapp.groovyを作成
「コンソール実行結果」
(base) mba:Desktop UserName$ spring run app.groovy /Users/UserName/.rbenv/versions/2.4.2/lib/ruby/gems/2.4.0/gems/spring-2.0.2/lib/spring/configuration.rb:46:in `find_project_root': Spring was unable to locate the root of your project. There was no Gemfile present in the current directory (/Users/UserName/Desktop) or any of the parent directories. (Spring::UnknownProject) from /Users/UserName/.rbenv/versions/2.4.2/lib/ruby/gems/2.4.0/gems/spring-2.0.2/lib/spring/configuration.rb:48:in `find_project_root' from /Users/UserName/.rbenv/versions/2.4.2/lib/ruby/gems/2.4.0/gems/spring-2.0.2/lib/spring/configuration.rb:48:in `find_project_root' from /Users/UserName/.rbenv/versions/2.4.2/lib/ruby/gems/2.4.0/gems/spring-2.0.2/lib/spring/configuration.rb:48:in `find_project_root' from /Users/UserName/.rbenv/versions/2.4.2/lib/ruby/gems/2.4.0/gems/spring-2.0.2/lib/spring/configuration.rb:37:in `project_root_path' from /Users/UserName/.rbenv/versions/2.4.2/lib/ruby/gems/2.4.0/gems/spring-2.0.2/lib/spring/env.rb:28:in `project_root' from /Users/UserName/.rbenv/versions/2.4.2/lib/ruby/gems/2.4.0/gems/spring-2.0.2/lib/spring/env.rb:45:in `application_id' from /Users/UserName/.rbenv/versions/2.4.2/lib/ruby/gems/2.4.0/gems/spring-2.0.2/lib/spring/env.rb:49:in `socket_path' from /Users/UserName/.rbenv/versions/2.4.2/lib/ruby/gems/2.4.0/gems/spring-2.0.2/lib/spring/env.rb:53:in `socket_name' from /Users/UserName/.rbenv/versions/2.4.2/lib/ruby/gems/2.4.0/gems/spring-2.0.2/lib/spring/client/run.rb:26:in `connect' from /Users/UserName/.rbenv/versions/2.4.2/lib/ruby/gems/2.4.0/gems/spring-2.0.2/lib/spring/client/run.rb:31:in `call' from /Users/UserName/.rbenv/versions/2.4.2/lib/ruby/gems/2.4.0/gems/spring-2.0.2/lib/spring/client/command.rb:7:in `call' from /Users/UserName/.rbenv/versions/2.4.2/lib/ruby/gems/2.4.0/gems/spring-2.0.2/lib/spring/client.rb:30:in `run' from /Users/UserName/.rbenv/versions/2.4.2/lib/ruby/gems/2.4.0/gems/spring-2.0.2/bin/spring:49:in `<top (required)>' from /Users/UserName/.rbenv/versions/2.4.2/bin/spring:23:in `load' from /Users/UserName/.rbenv/versions/2.4.2/bin/spring:23:in `<main>'
「app.groovy」
groovy
1@RestController 2class App { 3 @RequestMapping("/") 4 def home() { 5 "Hello!!" 6 } 7}
「.bash_profile」
export PATH="/Users/UserName/spring\ boot/spring-2.0.0.BUILD-SNAPSHOT/bin:$PATH”
回答1件
あなたの回答
tips
プレビュー
バッドをするには、ログインかつ
こちらの条件を満たす必要があります。