After installing ruby through brew, run following command to update the links to the latest ruby installation: brew link --overwrite ruby. Late to the party, but using brew is enough.
It's not necessary to install rvm and for me it just complicated things. By brew install ruby you're actually installing the latest currently v2. However, your path finds 2. To avoid this just change precedence source. After this I found that bundler gem was still using version 2. For MacOS visit this link. If you are on mac, Use rvm to install your specific version of ruby.
You can add the flag --no-document if you do not want to download the documentation. Here is sample output after running the command:. Stack Overflow for Teams — Collaborate and share knowledge with a private group. Create a free Team What is Teams? Collectives on Stack Overflow.
Learn more. How to update Ruby Version 2. Ask Question. Asked 5 years, 6 months ago. Active 11 months ago. Viewed k times. Improve this question. Abhinay Reddy Keesara 8, 2 2 gold badges 15 15 silver badges 27 27 bronze badges. ChuchaC ChuchaC 4, 3 3 gold badges 8 8 silver badges 6 6 bronze badges. ChuchaC Please, take a look here and here — vhristoskov. Add a comment. Active Oldest Votes. Now, run rvm list known This shows the list of versions of the ruby. Now, run rvm install ruby latest to get the latest ruby version.
If you type ruby -v in the terminal, you should see ruby X. If it still shows you ruby 2. X --default. Prerequisites for windows C compiler. Improve this answer. Jonathan 3 2 2 bronze badges. Abhinay Reddy Keesara Abhinay Reddy Keesara 8, 2 2 gold badges 15 15 silver badges 27 27 bronze badges.
Jordan My bad 2. Show 19 more comments. Brew only solution Update: From the comments kudos to Maksim Luzik , I haven't tested but seems like a more elegant solution: After installing ruby through brew, run following command to update the links to the latest ruby installation: brew link --overwrite ruby Original answer: Late to the party, but using brew is enough. Sergio Basurco Sergio Basurco 3, 2 2 gold badges 17 17 silver badges 40 40 bronze badges. Exactly what I was looking for, thanks.
If I was a ruby dev then rvm would make sense, but I'm not, so this is perfect. Of course, at some point, you might want to update the version of a particular dependency your application relies on. For instance, you might want to update rails to 3. Importantly, just because you're updating one dependency, it doesn't mean you want to re-resolve all of your dependencies and use the latest version of everything.
In our example, you only have three dependencies, but even in this case, updating everything can cause complications. To illustrate, the rails 3. Let's assume that the rails 3. However, we didn't specifically ask to update rack-cache , which may not be compatible with rack 1. And while an update from rack 1. In order to avoid this problem, when you update a gem, bundler will not update a dependency of that gem if another gem still depends on it. In this example, since rack-cache still depends on rack , bundler will not update the rack gem.
This ensures that updating rails doesn't inadvertently break rack-cache. Since rails 3. Find centralized, trusted content and collaborate around the technologies you use most. Connect and share knowledge within a single location that is structured and easy to search.
I need to upgrade gems to 1. Best is to refer to the actual documentation. You should not blindly use sudo. In fact if you're not required to do so you most likely should not use it. I wouldn't use the debian packages, have a look at RVM or Rbenv. If you're using RVM, the command below helped me a lot when upgrading from a very very old rubygems eg 1. Stack Overflow for Teams — Collaborate and share knowledge with a private group.
Create a free Team What is Teams? Collectives on Stack Overflow. Learn more. How to upgrade rubygems Ask Question. Asked 9 years, 1 month ago. Active 7 months ago.
Viewed k times. Improve this question. Anuj Anuj 8, 8 8 gold badges 30 30 silver badges 30 30 bronze badges. Just to clarify, your question is on how to update Rubygems itself — not any particular gem managed by rubygems. Add a comment. Active Oldest Votes. Improve this answer. Sacx Sacx 6, 3 3 gold badges 20 20 silver badges 29 29 bronze badges.
0コメント