Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Upgrading to Ruby 2.0, overwrite executables without prompt

Tags:

linux

ruby

When upgrading from ruby 1.9.3 to ruby 2.0 on linux (at least 12.04) you get an unexpected prompt.

rdoc's executable "rdoc" conflicts with /path/bin/rdoc
Overwrite the executable? [yN]  

It works fine to overwrite it manually but I'm looking for a way that my scripts will auto reply yes without halting.

Just found this issue on rubygems from a year ago. I'm using gem install in a script so I think I can somewhat easily add yes | gem install

Edit: Tried yes | gem install rdoc but it fails with:

ERROR:  Error installing rdoc:
"rdoc" from rdoc conflicts with /usr/local/rubies/2.0.0-p0/bin/rdoc
like image 329
ScotterC Avatar asked May 08 '13 21:05

ScotterC


2 Answers

You can prepend

 yes |

yes just enters y over and over again, which gets piped to to standard input.

(thanks @adamdunson)

like image 131
Shawn Balestracci Avatar answered Oct 19 '22 22:10

Shawn Balestracci


--force worked for me:

gem install --force rdoc

Disclaimer: this is not what --force is for, and I don't know why yes | doesn't work.

like image 35
pwnall Avatar answered Oct 20 '22 00:10

pwnall