RVM。安装ruby时遇到与git相关的错误

时间:2011-01-08 22:10:06

标签: git rvm

我正在使用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个文件。 Actualy我没有得到此错误消息所指的文件夹。 在我最近的所有基于git的项目中已经有git stash并且保持不变。

任何想法如何解决这个问题?

谢谢

P.S。我正在使用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返回错误。

可能是病毒吗?

2 个答案:

答案 0 :(得分:1)

有同样的问题。看起来RVM有些混乱,做了这个命令来解决它。

$ rvm cleanup repos

答案 1 :(得分:0)

很明显,rvm抱怨的git repo是~/.rvm下的其中一个,特别是ruby-1.9.2-head repo。

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