【问题标题】:RVM. getting git-related error while installing rubyRVM。安装 ruby​​ 时出现与 git 相关的错误
【发布时间】:2011-01-08 22:10:05
【问题描述】:

我正在使用 RVM 并想安装另一个版本的 Ruby。

$ rvm install 1.9.2-head
/Users/ovsiiko/.rvm/rubies/ruby-1.9.2-head, this may take a while depending on your cpu(s)...

ruby-1.9.2-head - #fetching 
error: You have local changes to 'win32/configure.bat'; cannot switch branches.
From https://github.com/ruby/ruby
 * branch            ruby_1_9_2 -> FETCH_HEAD
error: Your local changes to 'win32/configure.bat' would be overwritten by merge.  Aborting.
Please, commit your changes or stash them before you can merge.
There has been an error while checking out branch ruby_1_9_2.           
Halting the installation.
There has been an error fetching the ruby interpreter. Halting the installation.

Spotlight 既看不到 win32 文件夹也看不到 configure.bat 文件。 实际上,我不知道此错误消息指的是哪个文件夹。 在我最近的所有基于 git 的项目中已经有 git stash 并保持不变。

有什么办法解决这个问题吗?

谢谢

附:我正在使用 MacOS X 10.6.4

更新: 我已经卸载了 RVM,然后重新安装并再次尝试...

$ rvm install 1.9.2-head
/Users/ovsiiko/.rvm/rubies/ruby-1.9.2-head, this may take a while depending on your cpu(s)...

ruby-1.9.2-head - #fetching 
Cloning from https://github.com/ruby/ruby.git, this may take a while depending on your connection...
Initialized empty Git repository in /Users/ovsiiko/.rvm/repos/ruby-1.9.2-head/.git/
remote: Counting objects: 30907, done.
remote: Compressing objects: 100% (14057/14057), done.
remote: Total 30907 (delta 23362), reused 22680 (delta 16110)
Receiving objects: 100% (30907/30907), 21.45 MiB | 261 KiB/s, done.
Resolving deltas: 100% (23362/23362), done.
Checking out files: 100% (3515/3515), done.
error: You have local changes to 'symbian/configure.bat'; cannot switch branches.
From https://github.com/ruby/ruby
 * branch            ruby_1_9_2 -> FETCH_HEAD
error: Your local changes to 'symbian/configure.bat' would be overwritten by merge.  Aborting.
Please, commit your changes or stash them before you can merge.
There has been an error while checking out branch ruby_1_9_2.           
Halting the installation.
There has been an error fetching the ruby interpreter. Halting the installation.

现在此尝试在 symbian/configure.bat 返回错误。

会不会是病毒?

【问题讨论】:

  • 提示:Spotlight 找不到文件这一事实绝不意味着它不存在。 Spotlight 不会索引整个文件系统。如需更完整的搜索,请使用find

标签: git rvm


【解决方案1】:

遇到了同样的问题。看起来 RVM 有点乱,用这个命令来修复它。

$ rvm cleanup repos

【讨论】:

    【解决方案2】:

    很明显,rvm 抱怨的 git 存储库是在 ~/.rvm 下找到的存储库之一,特别是 ruby-1.9.2-head 存储库。

    转到~/.rvm/repos/ruby-1.9.2-head,保存您的更改,您应该会没事的。

    【讨论】:

    • 感谢您的提示。我应该使用什么 rvm 命令在 ~/.rvm/repos/ruby-1.9.2-head 中的 git stash 之后安装 -head 版本? 'rvm install 1.9.2-head' 再次返回相同的错误...谢谢
    • 很奇怪。 git stash 的输出是什么?有什么东西保存在储藏室里吗?
    • 警告:CRLF 将被替换为 test/rexml/data/t63-2.svg 中的 LF。警告: CRLF 将被替换为 test/rexml/data/testsrc.xml 中的 LF。警告: CRLF 将被替换为 test/rexml/data/ticket_61.xml 中的 LF。警告:在 win32/configure.bat 中,CRLF 将被替换为 LF。警告:在 win32/ifchange.bat 中,CRLF 将被替换为 LF。警告:在 win32/rm.bat 中 CRLF 将被替换为 LF。警告:在 win32/rmall.bat 中 CRLF 将被替换为 LF。警告:在 win32/rmdirs.bat 中,CRLF 将被替换为 LF。已保存主干上的工作目录和索引状态 WIP:5a17f4c 修复空间。
    • HEAD 现在位于 5a17f4c 固定空间。
    猜你喜欢
    • 1970-01-01
    • 2014-10-04
    • 2018-03-23
    • 1970-01-01
    • 1970-01-01
    • 2011-09-18
    • 2013-01-18
    • 1970-01-01
    • 2013-09-27
    相关资源
    最近更新 更多