---
# System prepended metadata

title: '[Ruby On Rails]解決安裝rvm時遇到的一些問題'
tags: [Ruby On Rails, rvm]

---

# [Ruby On Rails]解決安裝rvm時遇到的一些問題

###### tags: `Ruby On Rails`,`rvm`

參考資料:
https://progressbar.tw/notes/RubyOnRails/24

https://stackoverflow.com/questions/23650992/ruby-rvm-apt-get-update-error

https://askubuntu.com/questions/378558/unable-to-locate-package-while-trying-to-install-packages-with-apt

若是apt-get update有failed的package,
安裝rvm就會遇到問題

解決方式:
```terminal
sudo apt-get update | grep "Failed"
```

可能看到的情形:
```terminal
:~# apt-get update  | grep "Failed"
W: Failed to fetch http://ppa.launchpad.net/upubuntu-com/web/ubuntu/dists/trusty/main/binary-amd64/Packages  404  Not Found

W: Failed to fetch http://ppa.launchpad.net/upubuntu-com/web/ubuntu/dists/trusty/main/binary-i386/Packages  404  Not Found

E: Some index files failed to download. They have been ignored, or old ones used instead.
```

這時就要把failed的package移除:

```terminal
sudo add-apt-repository --remove ppa:{failing ppa}
```

舉例而言,要移除上面範例中的package:

```terminal
sudo add-apt-repository --remove ppa:upubuntu-com/web
```



另外,也請參考以下連結開啟軟件與更新的設定.
https://askubuntu.com/questions/378558/unable-to-locate-package-while-trying-to-install-packages-with-apt
https://i.stack.imgur.com/YbDic.png
