Unable to install gems or RVM

786 Views Asked by At

I'm trying to install Foundation with Sass and Compass but am having a difficult time getting this, or any gem installed through terminal. I'm on a Macbook Pro running the latest version of OS X.

running gem install zurb-foundation or gem install bundler returns the following error:

ERROR:  While executing gem ... (TypeError)
can't convert Array into String

I get the same error for $ sudo gem update --system --no-user-install

What my gem env looks like:

RubyGems Environment:
- RUBYGEMS VERSION: 1.8.25
- RUBY VERSION: 1.9.3 (2013-02-06 patchlevel 385) [x86_64-darwin12.2.0]
- INSTALLATION DIRECTORY: ["/Users/mc/.gems"]
- RUBY EXECUTABLE: /Users/mc/.rvm/rubies/ruby-1.9.3-p385/bin/ruby
- EXECUTABLE DIRECTORY: /Users/mc/.gems/bin
- RUBYGEMS PLATFORMS:
 - ruby
 - x86_64-darwin-12
- GEM PATHS:
 - ["/Users/mc/.gems"]
 - /usr/lib/ruby/gems/1.8
- GEM CONFIGURATION:
 - :update_sources => true
 - :verbose => true
 - :benchmark => false
 - :backtrace => false
 - :bulk_threshold => 1000
 - :sources => ["http://rubygems.org/", "https://rubygems.org"]
 - "gem" => "--no-rdoc --no-ri"
 - "gempath" => ["/usr/lib/ruby/gems/1.8"]
 - "gemhome" => ["/Users/mc/.gems"]
- REMOTE SOURCES:
 - http://rubygems.org/
 - https://rubygems.org

I have the latest version of xCode with the Command line tools add-on installed.

Something tells me it's a directory/permission issue, since if I log in as root on OS X, I have no issues. I've tried to use RVM to implode and reinstall ruby but shown in the screenshot below I always run into that same TypeError issue mentioned above.

https://i.stack.imgur.com/1F2H1.jpg

1

There are 1 best solutions below

2
On

First, by and large, I recommend rbenv over rvm for maintaining your rubies and associated gems. I find rbenv to be much easier to use as well as being less intrusive and a less of a pain in the behind with which to work.

Second, contrary to what ShiningRay commented, being able to maintain and use Ruby sandboxes is a big win. There are times you will want to try different rubies and/or gem versions out without

If you want to install rbenv, the easies way to do so is via Homebrew. If you install Homebrew, do so as a local install (do not use sudo to install it).

To install Hombrew, just execute the following at your prompt:

ruby -e "$(curl -fsSL https://raw.github.com/mxcl/homebrew/go)"

Before you install rbenv, you need to remove your existing - but apparently non-functioning - rvm installation. See How to remove rvm (ruby version manager from my system? for how to do this effectively.

I believe you will have to run rvm implode via sudo to get this work for you.

Once you have installed Homebrew as a local user, then use it to install rbenv as outlined in the rbenv Homebrew on Mac OS X section.

Important Do not run these commands as root! Do not use sudo. Just perform a local install of rbenv as you installed homebrew above.

In addition to rbenv and ruby-build, I would install the following rbenv extensions:

Note To be effective, and before installing it, rbenv-bundler requires you have bundler installed.

Now that you have done all of this, you are ready to start install the rubies and gems you need to install. I would create a gemset, associated with the ruby you want to use, and install the various gems you need to work with into it.