简体   繁体   中英

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.

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. 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.

Anybody how how I can fix this? Thanks

I'm on a 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.

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".

  3. Make hidden files invisible again:

     defaults write com.apple.finder AppleShowAllFiles FALSE killall Finder 

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

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