rvm 安装 ruby 之后,必须执行 /bin/bash --login 才能执行 ruby 命令

安装ruby以后执行

rvm use 2.3.0 --default

错误信息:

RVM is not a function, selecting rubies with 'rvm use ...' will not work.

You need to change your terminal emulator preferences to allow login shell.
Sometimes it is required to use `/bin/bash --login` as the command.
Please visit https://rvm.io/integration/gnome-terminal/ for an example.

解决办法:

echo '[[ -s "$HOME/.rvm/scripts/rvm" ]] && . "$HOME/.rvm/scripts/rvm"' >>~/.bashrc
source ~/.bashrc
ruby -v

ps:

  • /etc/profile:此文件为系统的每个用户设置环境信息,当用户第一次登录时,该文件被执行.
    并从/etc/profile.d目录的配置文件中搜集shell的设置.
  • /etc/bashrc:为每一个运行bash shell的用户执行此文件.当bash shell被打开时,该文件被读取.
  • ~/.bash_profile:每个用户都可使用该文件输入专用于自己使用的shell信息,当用户登录时,该文件仅仅执行一次!默认情况下,他设置一些环境变量,执行用户的.bashrc文件.
  • ~/.bashrc:该文件包含专用于你的bash shell的bash信息,当登录时以及每次打开新的shell时该文件被读取.
  • ~/.bash_logout:当每次退出系统(退出bash shell)时,执行该文件.
  • 2
    点赞
  • 3
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
“ bundler: failed to load command: pod (/opt/homebrew/Cellar/fastlane/2.211.0/libexec/bin/pod)RubyGems Environment:- RUBYGEMS VERSION: 3.0.3.1- RUBY VERSION: 2.6.10 (2022-04-12 patchlevel 210) [universal.arm64e-darwin22]- INSTALLATION DIRECTORY: /Library/Ruby/Gems/2.6.0- USER INSTALLATION DIRECTORY: /Users/e125866/.gem/ruby/2.6.0- RUBY EXECUTABLE: /System/Library/Frameworks/Ruby.framework/Versions/2.6/usr/bin/ruby- GIT EXECUTABLE: /usr/local/bin/git- EXECUTABLE DIRECTORY: /usr/local/bin- SPEC CACHE DIRECTORY: /Users/e125866/.gem/specs- SYSTEM CONFIGURATION DIRECTORY: /Library/Ruby/Site- RUBYGEMS PLATFORMS:- ruby- universal-darwin-22- GEM PATHS:- /Library/Ruby/Gems/2.6.0- /Users/e125866/.gem/ruby/2.6.0- /System/Library/Frameworks/Ruby.framework/Versions/2.6/usr/lib/ruby/gems/2.6.0- GEM CONFIGURATION:- :update_sources => true- :verbose => true- :backtrace => false- :bulk_threshold => 1000- :sources => ["https://gems.ruby-china.com/"]- :concurrent_downloads => 8- REMOTE SOURCES:- https://gems.ruby-china.com/- SHELL PATH:- /opt/apache-maven-3.8.6/bin- /opt/homebrew/bin- /opt/homebrew/sbin- /usr/local/bin- /System/Cryptexes/App/usr/bin- /usr/bin- /bin- /usr/sbin- /sbin- /usr/local/sbin- /Library/Apple/usr/bin- /var/run/com.apple.security.cryptexd/codex.system/bootstrap/usr/local/bin- /var/run/com.apple.security.cryptexd/codex.system/bootstrap/usr/bin- /var/run/com.apple.security.cryptexd/codex.system/bootstrap/usr/appleinternal/bin- /Users/e125866/.rvm/bin”这个有问题吗?
最新发布
06-09
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值