Sprinboot CLI Installation (Mac edition)

Source: Internet
Author: User

1. Installing HomeBrew

/usr/bin/ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"

2. Use homebrew to install spring Boot CLI2.1 to introduce Pivotal tap

$ brew tap pivotal/tap

    • Note: Tap is a way to add additional warehouses to homebrew, Pivotal is the company behind spring and spring boot;
2.2 Installing the Spring Boot CLI

$ brew install springboot

3. Apply 3.1 A groovy-based spring application
// HelloController.groovy@RestControllerclass HelloController{    @RequestMapping("/")    def hello(){        return "Hello World"    }}
3.2 Run

$ spring run HelloController.groovy

3.3 Problems occurred "Spring was unable to locate the root of your project. There is no gemfile present in the current directory "
    • This is due to the fact that there is also a program called executable in Ruby Gem spring
3.4 Solution-Environment configuration
    • iTerm2It's zsh.
    • sudo vi ~/.zshrc
    • Look for the installed spring Boot CLI path and write the following in the ZSHRC file:
      • export SPRING_HOME="/usr/local/Cellar/springboot/2.0.2.RELEASE"
      • export PATH=$SPRING_HOME/bin:$PATH
    • source ~/.zshrc, update the configuration file
    • Inputspring --version
      • Output Spirng CLI v2.0.2.RELEASE indicates successful change




References:

    • Gemfile error when running App.groovy with Spring Boot CLI
    • Several ways to configure the environment variable path (MAC) in bash and zsh
    • Spring Boot Combat

Sprinboot CLI Installation (Mac edition)

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.