mac 및 Liux 아래 ruby+rails 환경 구축
rvm 설치(홈 페이지 http://www.rvm.io/ 참조)
첫 번 째 단 계 는 필수 가 아 닐 수도 있 습 니 다.
첫걸음
gpg --keyserver hkp://keys.gnupg.net --recv-keys 409B6B1796C275462A1703113804BB82D39DC0E3 7D2BAF1CF37B13E2069D6956105BD0E739499BDB
둘째 걸음 curl -sSL https://get.rvm.io | bash -s stable
성공 하면 보통 힌트 가 있어 요. Downloading https://github.com/rvm/rvm/archive/1.29.3.tar.gz Downloading https://github.com/rvm/rvm/releases/download/1.29.3/1.29.3.tar.gz.asc Found PGP signature at: 'https://github.com/rvm/rvm/releases/download/1.29.3/1.29.3.tar.gz.asc', but no GPG software exists to validate it, skipping. Installing RVM to /Users/echen1/.rvm/ Adding rvm PATH line to /Users/echen1/.profile /Users/echen1/.mkshrc /Users/echen1/.bashrc /Users/echen1/.zshrc. Adding rvm loading line to /Users/echen1/.profile /Users/echen1/.bash_profile /Users/echen1/.zlogin. Installation of RVM in /Users/echen1/.rvm/ is almost complete: * To start using RVM you need to run `source /Users/echen1/.rvm/scripts/rvm` in all your open shell windows, in rare cases you need to reopen all shell windows. * WARNING: '~/.profile' file found. To load it into your shell, add the following line to '/Users/echen1/.bash_profile':
위 에 rvm 를 설치 한 후 마지막 두 번 째 줄 에 WARNING 이 있 습 니 다.이때 rvm 를 직접 실행 하면 command not found 솔 루 션 이 나타 날 수 있 습 니 다.명령 을 실행 하 십시오. source ~/.profile
이 때 다시 실행:유사 한 결 과 는 설치 에 성 공 했 음 을 나타 낸다 rvm -v
image.png 스 위칭 소스
원생 의 기원 은 외국 에 있 기 때문에 보통 느 리 기 때문에 타 오 바 오 원 으로 전환 할 수 있다(참고:https://ruby.taobao.org/).
For mac
sed -i .bak -E 's!https?://cache.ruby-lang.org/pub/ruby!https://ruby.taobao.org/mirrors/ruby!' $rvm_path/config/db
For Linux sed -i -E 's!https?://cache.ruby-lang.org/pub/ruby!https://ruby.taobao.org/mirrors/ruby!' $rvm_path/config/db
rvm 사용 안내 목록 에 알려 진 ruby 버 전 rvm list known
ruby 버 전 rvm install 1.9.3
설치최신 1.9.3 이 설치 되 어 있 습 니 다.rvm list known 목록 에 있 는 것 은 모두 설치 할 수 있 습 니 다.
ruby 버 전
rvm use 1.9.3
을 기본 버 전 rvm use 1.9.3 --default
으로 설정 하여 설 치 된 ruby rvm list
을 조회 합 니 다.image.png
그림 에서 보 듯 이 전환 성공
rails 설치 방법 1(직접 설치)
gem sources --add https://gems.ruby-china.org/ --remove https://rubygems.org/
방법 2rails 프로젝트 가 있 으 면 프로젝트 에서 bundle install 을 실행 합 니 다.
이 내용에 흥미가 있습니까?
현재 기사가 여러분의 문제를 해결하지 못하는 경우 AI 엔진은 머신러닝 분석(스마트 모델이 방금 만들어져 부정확한 경우가 있을 수 있음)을 통해 가장 유사한 기사를 추천합니다:
Ruby에서 문자열을 고정하는 다른 방법Ruby에서 문자열을 고정하려면 최소한 두 가지 방법이 있습니다. 아시다시피 a와 b는 동일한 개체 인스턴스인 것 같습니다. 문자열에 적용할 수 있는 일종의 이상한 메서드 입력: - 다음과 같은 코드를 볼 수 있습니...
텍스트를 자유롭게 공유하거나 복사할 수 있습니다.하지만 이 문서의 URL은 참조 URL로 남겨 두십시오.
CC BY-SA 2.5, CC BY-SA 3.0 및 CC BY-SA 4.0에 따라 라이센스가 부여됩니다.