2

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.

http://i.imgur.com/1AQSEe9.jpg

  • run `gem list --local ` to show local gems – ShiningRay Feb 07 '13 at 06:54
  • If you don't develope with ruby, don't use rvm. In order to compile ruby under Mac OS X, you must install a compatible compiler. I think these are not necessary for you to do compass jobs. – ShiningRay Feb 07 '13 at 07:02
  • when I run gem list --local I see no local gems installed. Typically I'd use CodeKit to compile my Sass and JavaScript, but I'll look into some OS X compilers and avoid RVM, thank you. – minorvillain Feb 07 '13 at 16:27
  • Try macruby. http://macruby.org/ – ShiningRay Feb 07 '13 at 17:38

1 Answers1

1

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.

Community
  • 1
  • 1
Jordan Dea-Mattson
  • 5,695
  • 5
  • 35
  • 52
  • Thank you, @Jordan. I removed rvm and installed Homebrew + rbenv successfully but did receive the following warning after **brew install rbenv**: `Warning: The cleaning step did not complete successfully Still, the installation was successful, so we will link it into your prefix` I installed the rbenv-gemset extension, but not the rbenv-bundler as I run into the same problem as before while installing bundler. **gem install bundler** : `ERROR: While executing gem ... (TypeError) can't convert Array into String` Seems I cannot execute gem install (anything). – minorvillain Feb 12 '13 at 04:52
  • I might have some time this weekend to dig into this further. If I can, I will update my response or add a comment here. – Jordan Dea-Mattson Feb 26 '13 at 20:38