Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

如何移除多餘的ruby #41

Closed
koei1025 opened this issue Oct 8, 2015 · 5 comments
Closed

如何移除多餘的ruby #41

koei1025 opened this issue Oct 8, 2015 · 5 comments

Comments

@koei1025
Copy link

koei1025 commented Oct 8, 2015

我在GitHub上抓了一個範例,下載回來後執行bundle install,結果在環境中造成了有兩套ruby,使得現在沒辦法建立新的專案。

kenny@test /usr/local/bin $ which -a ruby
/usr/local/bin/ruby
/usr/bin/ruby

痛苦的是我的環境當初是土法煉鋼的,根本沒想到要去裝RVM,現在後悔莫及。
請問我該如何移除掉/usr/local/bin/ruby呢?

@hiroshiyui
Copy link

好奇請教您當時是抓哪個範例?

@chinghanho
Copy link
Member

通常放在 /usr/local/bin 目錄底下的都是 symlink,直接刪掉就可以了,如果要刪乾淨就要去找源頭:

$ ls -la /usr/local/bin | grep ruby

應該用的是 rbenv 所以才會裝在這裡,刪除 rbenv 方法可以照文件指示

不過,問題我猜應該不是「有兩套 Ruby」的關係。確認目前用的 Ruby 版本:

$ ruby --version

@koei1025
Copy link
Author

koei1025 commented Oct 8, 2015

我抓的是這個
https://github.com/ramblex/modal-form

我目前的的版本是ruby 2.2.2p95 (2015-04-13 revision 50295) [x86_64-linux]

一開始的問題是出現cannot load such file,後來去拜了google之後,才會懷疑可能會不會是這個原因

kenny@test ~/ruby_projects $ rails new test
/usr/local/bin/rails:23:in `load': cannot load such file -- /usr/local/lib/ruby/gems/2.2.0/gems/rails-4.2.3/bin/rails (LoadError)
    from /usr/local/bin/rails:23:in `<main>'

@chinghanho
Copy link
Member

如果重裝 Rails 試試看?

@koei1025
Copy link
Author

koei1025 commented Oct 8, 2015

經過把Rails移除後再重裝就解決問題了,感謝各位的幫忙

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants