【问题标题】:"Warning: You have '~/.profile' file" when installing RVM“警告:安装 RVM 时,您有 '~/.profile' 文件”
【发布时间】:2014-07-04 17:03:26
【问题描述】:

关注http://installrails.com/steps/install_rvm_and_ruby

这是我得到的输出:

~/code/ruby \curl -L https://get.rvm.io | bash -s stable
  % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                 Dload  Upload   Total   Spent    Left  Speed
100   184  100   184    0     0    720      0 --:--:-- --:--:-- --:--:--   721
100 20511  100 20511    0     0  11941      0  0:00:01  0:00:01 --:--:-- 20676
Downloading https://github.com/wayneeseguin/rvm/archive/stable.tar.gz

Upgrading the RVM installation in /Users/adamzerner/.rvm/
    RVM PATH line found in /Users/adamzerner/.profile /Users/adamzerner/.bashrc /Users/adamzerner/.zshrc.
    RVM sourcing line found in /Users/adamzerner/.bash_profile /Users/adamzerner/.zlogin.
Upgrade of RVM in /Users/adamzerner/.rvm/ is complete.

# Adam Zerner,
#
#   Thank you for using RVM!
#   We sincerely hope that RVM helps to make your life easier and more enjoyable!!!
#
# ~Wayne, Michal & team.

In case of problems: http://rvm.io/help and https://twitter.com/rvm_io

Upgrade Notes:


  * WARNING: You have '~/.profile' file, you might want to load it,
    to do that add the following line to '/Users/adamzerner/.bash_profile':

      source ~/.profile

  * No new notes to display.

~/code/ruby type rvm | head -n 1
-bash: type: rvm: not found
~/code/ruby 

昨天我浏览了 InstallRails 指南,一切正常。我安装了 RVM、Rails、Ruby 等。然后我不得不更改 Ruby 版本,因为我的一个网站使用的是旧版本的 Ruby(虽然不知道我是怎么做到的)。

现在,不知何故,似乎没有安装 RVM 和 Rails。我该怎么办?

编辑:

我把.profile的内容移动到.bash_profile,把.profile的名字改成.pprofile,又跑了\curl -L https://get.rvm.io | bash -s stable。它给了我错误:RVM sourcing line not found for Bash, rerun this command with '--auto-dotfiles' flag to fix it.。我这样做了,它再次给了我错误WARNING: You have '~/.profile' file, you might want to load it。似乎--auto-dotfiles 创建了一个.profile 文件。

~ open .profile
~ \curl -L https://get.rvm.io | bash -s stable
  % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                 Dload  Upload   Total   Spent    Left  Speed
100   184  100   184    0     0    596      0 --:--:-- --:--:-- --:--:--   595
100 20511  100 20511    0     0  26570      0 --:--:-- --:--:-- --:--:-- 26570
Downloading https://github.com/wayneeseguin/rvm/archive/stable.tar.gz

Upgrading the RVM installation in /Users/adamzerner/.rvm/
    RVM PATH line found in /Users/adamzerner/.bashrc /Users/adamzerner/.bash_profile /Users/adamzerner/.zshrc.
    RVM sourcing line found in /Users/adamzerner/.zlogin.
    RVM sourcing line not found for Bash, rerun this command with '--auto-dotfiles' flag to fix it.
Upgrade of RVM in /Users/adamzerner/.rvm/ is complete.

# Adam Zerner,
#
#   Thank you for using RVM!
#   We sincerely hope that RVM helps to make your life easier and more enjoyable!!!
#
# ~Wayne, Michal & team.

In case of problems: http://rvm.io/help and https://twitter.com/rvm_io

Upgrade Notes:

  * No new notes to display.

~ type rvm | head -n 1
-bash: type: rvm: not found
~ \curl -L https://get.rvm.io | bash -s stable --auto-dotfiles
  % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                 Dload  Upload   Total   Spent    Left  Speed
100   184  100   184    0     0    791      0 --:--:-- --:--:-- --:--:--   793
100 20511  100 20511    0     0  44948      0 --:--:-- --:--:-- --:--:-- 44948
Turning on auto dotfiles mode.
Downloading https://github.com/wayneeseguin/rvm/archive/stable.tar.gz

Upgrading the RVM installation in /Users/adamzerner/.rvm/
    Removing rvm PATH line from /Users/adamzerner/.bashrc /Users/adamzerner/.bash_profile /Users/adamzerner/.zshrc.
    Adding rvm PATH line to /Users/adamzerner/.profile /Users/adamzerner/.bashrc /Users/adamzerner/.zshrc.
    Removing rvm loading line from /Users/adamzerner/.zlogin.
    Adding rvm loading line to /Users/adamzerner/.bash_profile /Users/adamzerner/.zlogin.
Upgrade of RVM in /Users/adamzerner/.rvm/ is complete.

# Adam Zerner,
#
#   Thank you for using RVM!
#   We sincerely hope that RVM helps to make your life easier and more enjoyable!!!
#
# ~Wayne, Michal & team.

In case of problems: http://rvm.io/help and https://twitter.com/rvm_io

Upgrade Notes:


  * WARNING: You have '~/.profile' file, you might want to load it,
    to do that add the following line to '/Users/adamzerner/.bash_profile':

      source ~/.profile

  * No new notes to display.

~ ls -a
.           .gitconfig      Desktop
..          .heroku         Documents
.CFUserTextEncoding .irb-history        Downloads
.DS_Store       .netrc          Dropbox
.Trash          .pprofile       Library
.bash_history       .profile        Movies
.bash_profile       .rvm            Music
.bashrc         .ssh            Pictures
.dropbox        .zlogin         Public
.dropbox-master     .zshrc          code
.gem            Applications
~ 

【问题讨论】:

  • 您是否尝试过按照警告所说的去做?
  • 是的,对不起,我忘了提。我的 .bash_profile 文件现在显示其中的那一行。

标签: ruby-on-rails ruby installation rvm


【解决方案1】:

也许这可以帮助你,bc这似乎是完全相同的问题:

此警告表明您有一个文件 ~/.profile - 当没有 ~/.bash_profile 时,此文件作为最后的手段在 Bash 中加载 - 并且安装程序找到了这两个文件,这意味着您可能期望来自 @ 的一些配置987654324@ 在 shell 启动时可用,但不是因为它没有被读取。要解决此问题,您可以

  1. 删除~/.profile(以防不使用),
  2. ~/.profile的内容移动到~/.bash_profile,或者
  3. 将以下行添加到~/.bash_profile(您需要编辑文件):source ~/.profile

来源:https://github.com/wayneeseguin/rvm/issues/2832

【讨论】:

  • 我将.profile 的内容添加到.bash_profile,但它仍然无法正常工作(给我同样的错误)。将.profile的内容移动到.bash_profile后,我应该删除它吗?
  • 最好重命名 - 并再次测试:)
【解决方案2】:

对我来说这是可行的:

替换:

[[ -s "$HOME/.rvm/scripts/rvm" ]] && source "$HOME/.rvm/scripts/rvm" # Load RVM into a shell session *as a function*

与:

source "$HOME/.profile" # Also loads RVM into a shell session *as a function*

来源:https://github.com/rvm/rvm/issues/2832

【讨论】:

    【解决方案3】:

    替换 /Users/Akorn/.bash_profile 的内容 与

    来源 ~/.profile

    方法:

    1) travel to folder: cd ~/
    2) list only hidden files: ls -ld .?*  
    3) edit file: pico .bash_profile
    4) replace content
    5) save
    

    【讨论】:

    • 这是一个答案还是您的新问题?
    • 感谢格式化。我很高兴能获得我的第二个铜牌!
    【解决方案4】:

    我遇到了同样的问题。我跑了:

    source /Users/my_user_name/.rvm/scripts/rvm
    

    在终端中,这解决了问题。希望对您有所帮助。

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2013-11-07
      • 1970-01-01
      • 1970-01-01
      • 2021-12-17
      • 2011-02-21
      • 2013-10-11
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多