Reinstall Ruby on OS X - ruby

I've gone and messed up Ruby on my Snow Leopard Machine. I've managed to introduce all sorts of issues and I'm having a hard time cleaning things up.
What are the steps to get me back to square one with Ruby? I'm fairly new to programming so I need it spelled out for me!

It sounds like what you probably want to do is clear out all your globally installed gems in the system Ruby. This can be done by running the following:
sudo rm -rf /Library/Ruby/Gems/*
This will leave all the gems that come with OS X (which is a good thing, since some apps may assume they're installed).
As macarthy said, I also highly recommend using a Ruby version manager (e.g. rbenv or RVM) to more easily install, remove, and manage Ruby versions.

My suggestion would be to forget about what you have and use RVM
https://rvm.io
you can basically ignore what you have installed then.

Related

How can I install Bugzilla on OS X without duplicating TeXlive?

This answer convincingly argues that there is no way to determine the storage needed to install a MacPorts package.
Also, as is clear from this Q & A it's a bad idea to install TeXlive using MacPorts since it becomes difficult to maintain it. It's much better to install an external TeXlive.
MacPorts has a recipe for installing Bugzilla, but during a dryrun (-y) I see texlive-bin in the list of packages Bugzilla depends on, which means that it will be duplicated.
Is there a way to install Bugzilla on a Mac (with or without MacPorts) without duplicating TeXlive?
Interesting. port rdeps --no-build bugzilla[1] shows no texlive-bin or any other tex-related ports that I'm aware of. I don't know that much about bugzilla but I can't imagine why it needs tex.
However, we have no maintainer for the bugzilla port. MacPorts is at version 4.4.5 whereas the current release is 5.0.3. It is also using MySQL version 5.1 which is getting pretty old. I wouldn't mind helping but it will be at least a few days before I could take a look at this. You might file a ticket with MacPorts requesting the update.
https://trac.macports.org/wiki/Tickets
There is already a ticket regarding the database issue:
https://trac.macports.org/ticket/43431

Using Homebrew vs a ruby version manager on OS X?

I have a few questions about using Ruby on an OS X 10.11 El Capitan:
Do you think it is ok to modify Apple's built-in Ruby installation (as in installing or upgrading Gems), or should I install a separate ruby environment? (I had been modifying the built in one previously, but once I upgraded to El Capitan Apple undid all of my changes. I never had any problems with it before the upgrade, even when I updated the Gems that Apple included in to more recent versions. Yet I am still worried.)
I'm considering leaving Apple's built in Ruby alone and installing a separate one, leading me to my second question:
Everywhere I read on the internet, people recommend using a Ruby version manager (rbenv, RVM, and the like) to install a separate Ruby environment. I feel like it would be easier, cleaner, and more straightforward to simply use homebrew, since I use it already, to install a ruby to /usr/local. What would be some problems with using homebrew instead of a dedicated Ruby version manager? What are the advantages of using a version manager over homebrew?
Don't mess w/your system Ruby, your system needs to be stable and it's not necessary.
Homebrew isn't made to manage multiple versions of software. RVM (and others) and made to do exactly that. I currently have 6 rubies installed. I'd hate to have to manage that manually. RVM (or friends) is the way to go if you are installing Ruby on your host. People often go to the next level and use Vagrant instances to further isolate their development environment.
IMHO the most important reason to use a version manager is to be able to run multiple different versions of Ruby on the same machine e.g. to test gems with different versions or to run several (legacy and new) applications on the same development computer. Rbenv or RVM makes this easy, Homebrew doesn't support this...

Ruby gems disappear on Mac OS Jenkins slave

I have a few Mac Minis and old Mac Pros we use as Jenkins slaves for automated testing.
Occasionally gems simply disappear and I have to re-install them. This is using the built-in Ruby from Mac OS Yosemite.
Why does this happen?
I use RVM on my personal Macbook Pro, and occasionally it autonomously decides to switch to a new Ruby version, so it makes sense that it won't have all my gems. When I switch back, the gems are gone again.
As for the slaves, they don't have RVM installed, and the outcome is the same.
Could this be caused by Mac OS updates?
The gems are not installed in a Jenkins workspace, I installed them before we installed the Jenkins agent.
The Macs are shared with the test-automation team who also ssh/sudo on them, but don't do anything in Ruby because their code is Java.
Could this be caused by mac OS updates ?
It could be caused by OS updates, and this is one of the big reasons you should not use the system Ruby for your development unless you're content with leaving it plain vanilla. Rightly so, Apple considers that Ruby theirs, and they can and will stomp on it with an update if it suits their purposes and you upgrade the OS.
Instead, at a minimum, install a separate Ruby from source or via Homebrew and consider that yours. Or, investigate using rbenv or RVM on the Jenkins boxes to manage your Rubies, which is what we do. That allows builds to use different Rubies and/or sets of gems and lets you fine-tune the Ruby environment on the Jenkins box to whatever the final-destination Ruby will be.
You say your personal RVM changes on its own? Unh-uh, can't happen on its own; SOMETHING told it to change. Don't attribute that stuff to voodoo or juju, something is making those things happen such as your environment variables changed or the .rvmrc file got stomped on. If your RVM configuration is correct it should be very stable; My rbenv and RVM setups have always been very solid unless I screwed them up.
Without dumps of your gem env or rvm info there's not a whole lot we can do to help you straighten it out. In general though, it sounds like you need to treat your Jenkins hosts like they are production boxes, change them very little, and separate your assets from the vendor's.

Will installing Rubymine cause any conflicts with my existing OS X configuration?

In the past, I've done all my Rails development with a simple text editor, and have setup virtual Linux machines on my MacBook so I didn't have to worry about messing up OS X's native Ruby installation. Now I am leaning towards giving Rubymine a shot. I've been trying it out on a Windows platform and I like it enough to want to try it on my main development machine.
I'm a little apprehensive about installing it - will it compromise my system's default Ruby installation at all? Is it easily (and completely) uninstalled if I decide to change my mind later?
If anyone has any experience with Rubymine on OS X and can let me know about any potential conflicts or issues, I would appreciate it.
I have used it for over a year--it does nothing environmentally damaging. It detects and uses Rubies already on your system.
I don't do any Ruby development without it, because I jump between Windows/Linux/Mac, and can have the same hotkey behavior with all that syntax highlighting, refactoring, and debugging. There is nothing better than being able to step into a gem that's acting up...

How to upgrade ruby on cygwin from source?

I installed ruby 1.9.1 from source on cygwin about 9 months ago. I did a default install i.e make, make test, make install which installed it in /usr/local. I am now trying to install 1.92. After building and installing it using the same steps, I found the gems I had installed stopped working. I though this might happen so I made a back up first and was unable to recover. Is there a way to install it without disturbing the previously installed libriaries or should I just bite the bullet and re-install them? I am also begining to think that installing it in the default location might not have been a good idea as it would be hard to tell what files are ruby and what are not if other things were also installed in this location also. I am guessing there is no such thing as make uninstall?
I know this may not be the answer you're looking for, but I highly recommend you take a look at pik, which is a Ruby version manager that works on Windows.
It's similar to rvm, which is the de-facto way to install and manage Rubies on Mac OS and *nix.

Resources