ABOUT ME

-

Today
-
Yesterday
-
Total
-
  • Ruby Configuration
    Ruby 2024. 3. 15. 10:19

     

     

    RHEL 9.3 => asdf를 이용하여 설치하면 편함

     

    sudo dnf update -y
    sudo dnf install -y https://mirror.stream.centos.org/9-stream/CRB/x86_64/os/Packages/libyaml-devel-0.2.5-7.el9.x86_64.rpm
    
    asdf plugin add ruby https://github.com/asdf-vm/asdf-ruby.git
    
    asdf install ruby 3.3.0
    
    ruby -v

     

     

    Visual Studio Code 설정 (Windows)

     

    {workspace}/.rubocop.yml (예시)

    Layout/SpaceInsideHashLiteralBraces:
      Enabled: false
    
    Style/QuotedSymbols: # new in 1.16
      Enabled: true
    
    AllCops:
      Exclude:
        - "Gemfile"

     

     

    .solargraph.yml

    include:
      - "**/*.rb"
    exclude:
      - spec/**/*
      - test/**/*
      - vendor/**/*
      - ".bundle/**/*"
    require: ["net/http"]
    domains: []
    reporters:
      - rubocop
      - require_not_found
    max_files: 5000

     

     

    Gemfile (bundle install)

    # fronzen_string_literal: true
    
    source 'https://rubygems.org'
    
    gem 'solargraph', '~> 0.50.0'
    gem 'rubocop', require: false

     

     

    solargraph의 intellisense가 잘 동작하지 않는다면 아래 커맨드 실행

    bundle exec yard gems

     

     

    댓글

Designed by Tistory.