简体   繁体   English

RVM gemset创建的错误目录无法删除

[英]RVM gemset created wrong directory cannot remove

I did something a bit silly, when I was creating a new Rails app I accidentally created the gem set on the desktop before I changed into the app folder. 我做了一些愚蠢的事情,当我创建一个新的Rails应用程序时,我不小心在桌面上创建了gem set,然后才更改为app文件夹。

Normally I create an app by doing the following, 通常,我通过执行以下操作来创建应用,

cd desktop
mkdir officepro
cd testapp
rvm use ruby-2.1.5@officepro --ruby-version --create
gem install rails -v 4.1.8

But because I've done this everytime I cd to the desktop I get this 但是因为每次我将其安装到台式机后都这样做,所以我得到了

-> cd desktop
ruby-2.2.0-preview1 - #gemset created /Users/shane/.rvm/gems/ruby-2.2.0-preview1@officepro
ruby-2.2.0-preview1 - #generating officepro wrappers..........

I've tried uninstalling ruby 2.2.0 through rvm, but then the desktop is telling it cannot find the ruby so something is still tied to the desktop. 我试过通过rvm卸载ruby 2.2.0,但是桌面告诉它找不到ruby,所以仍然有一些东西绑定在桌面上。 I've tried going into the rvm folder itself and deleting the ruby2.2.0 folder (ruby-2.0.0-preview@officepro) then i try rvm gemset delete officepro and it seems to work but then when I open the console and cd to desktop the folder re appears and I get the same problem again. 我尝试进入rvm文件夹本身并删除ruby2.2.0文件夹(ruby-2.0.0-preview@officepro),然后尝试rvm gemset delete officepro,它似乎可以正常工作,但是当我打开控制台并cd到在桌面上,该文件夹重新出现,我再次遇到相同的问题。

Anybody how how I can fix this? 有人我该如何解决? Thanks 谢谢

I'm on a mac 我在Mac上

RVM left some hidden files in the folder and every time you enter this folder in the terminal it creates/loads the gem set. RVM在文件夹中保留了一些隐藏文件,并且每次在终端中输入此文件夹时,它都会创建/加载gem set。

My solution: 我的解决方案:

  1. Make hidden files visible in the finder via terminal: 通过终端使隐藏文件在查找程序中可见:

     defaults write com.apple.finder AppleShowAllFiles TRUE killall Finder 
  2. Delete corresponding files in the folder. 删除文件夹中的相应文件。 In my case the files were named ".ruby-gemset" and ".ruby-version". 在我的情况下,文件名为“ .ruby-gemset”和“ .ruby-version”。

  3. Make hidden files invisible again: 使隐藏文件再次不可见:

     defaults write com.apple.finder AppleShowAllFiles FALSE killall Finder 

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM