csmosx
csmosx

Reputation: 3381

RubyGems via MacPorts a good idea?

Upon upgrading from a MB to a new MBP, Apple's migration assistant didn't move my gems.

I'm installing rubygems via macports this time, hoping to avoid this upon next upgrade.

Are there any pitfalls I should be aware of?

Upvotes: 5

Views: 4046

Answers (7)

bias
bias

Reputation: 1474

What no one mentioned rvm?

Use rvm to manage all of your ruby issues - seriously!

Upvotes: 0

gamov
gamov

Reputation: 3859

I just installed ruby 1.8.7 with macport and when I launch scripts with gems, it complains that it doesn't know them. Anyway to add cleanly the gems in the path of my macport ruby?

Gam

PS: I installed the gems via system gem

Upvotes: 0

sal
sal

Reputation: 23623

Installing a package manager via a package manager seems like it should be wrong.

Assuming you are not going to use the system ruby, and will only be using ruby installed via MacPorts; it should not be a problem.

If you plan on using gems with system ruby, you might have problems when Apple upgrades the system version of ruby, unless you are installing your gems in /Library/Ruby/Gems/

I'm going to assume you can just copy the gems to /Library/Ruby/Gems/1.8/gems from /opt/local/lib/ruby/gems but I wouldn't count on it working 100% with every gem.

Upvotes: 1

nitecoder
nitecoder

Reputation: 5486

I would say don't use MacPorts. People that use their operating systems version of RubyGems often end up with an out of date gem version and then run into problems when they try to update their version of rubygems. Installing Rubygems from source is easy, and it's not hard to install gems when you get a new machine, I mean how often does that really happen????

Upvotes: 0

mipadi
mipadi

Reputation: 410602

Where were your gems installed? The migration assistant only moves files in certain areas; I'm not sure if it copies files from places like /usr/local or /opt/local, you may have to do that manually (in which case, you can just copy the entire tree over to your new machine).

That said, you shouldn't have a problem installing gems using the version of RubyGems installed by MacPorts.

Upvotes: 3

rampion
rampion

Reputation: 89053

If you want your gems installed in your home directory (which should copy over during a transfer, and, as a side benefit, will let you run gem install as yourself, rather than root), set the gemhome: key to a path in your home directory in your ~/.gemrc.

Upvotes: 5

Jason Watkins
Jason Watkins

Reputation: 2692

The migration assistant doesn't move a lot of unix level stuff. This will be true of the macports installed gems as well (which typically live in /opt/local/lib/ruby/gems).

I use macports gem, and this generally works fine with the macports ruby. Be sure you know which ruby executable your shell ends up using, and perhaps use symlinks to control it specifically. I prefer using the macports version so that I'm not beholden to Apple's update schedule. Sadly macports iteself is somewhat inferior to package managers offered on bsd/linux distributions.

Upvotes: 0

Related Questions