The Gems Mac OS

Preview is one of the most underrated gems in OS X. Even though it's our pick as the best PDF Viewer and Editor, we tend to forget about all the different things it can do. Preview does everything. MacOS – How to completely remove Ruby, Ruby gems on Mac OS X 10.6.4 mac macos ruby rubygems Most rubyists might be shocked when they'll read this, but I'd like to know if it's possible to completely remove the Ruby framework as well as all the tools and gems that ship with Mac OS X 10.6.4.

  1. The Gems Mac Os Download
  2. The Gems Mac Os X
  3. The Gems Mac Os Catalina

Question or issue on macOS:

I need to install the JSON gem to start my app but I get the error below whenever I try to install the json gem. Can anyone help me out. I’m using rails 2.2.2 and gems 1.3.1.

How to solve this problem?

Solution no. 1:

The Gems Mac OS

With Mavericks, you can solve this problem by installing the Xcode Command Line Tools from the command line like this:

xcode-select --install

Update:
Don’t forget to accept the license agreement after you install or update:

sudo xcodebuild -license

Solution no. 2:

If you have this problem:

and you are using a Mac with OS X (tested with 10.8.1 Mountain Lion), you need to download Xcode from the Mac App Store (or from developer.apple.com if you have a dev account – it’s free BTW and you can download a DMG installer)

The latest Xcode versions (I’m using Xcode 4.4.1) does NOT include command line tools. Now you need to install this additional package inside Xcode. Once done, your problem is fixed.

To do that, open Xcode, go to Preferences > Downloads > Components. Install “Command Line Tools”. You’re done. Now you can install the json Ruby gem.

Solution no. 3:

You are missing the ruby development headers. To install these on an OS like ubuntu you should use:

Solution no. 4:

The ruby headers don’t come installed with the base ruby install with Mac OS X. These can been found on Mac OS X Install Disc 2 by installing the XCode Tools.

Once installed, all was well!

UPDATE As of at least OS X 10.7.3 this is no longer a problem, it “just works”

Solution no. 5:

Installing Xcode command line tools… should fix this issue.

Solution no. 6:

It turns out certain gems require some ruby header files to install properly. These header files do not ship with Lion (OSX 10.7).

It also turns out Xcode 4 (latest release) also does not install these header files. I tried this.

Solution – Assuming you are on Mac OS X (you appear to be based on the terminal output). To get it working I installed gcc with some developer tools from the following page

  • Visit https://github.com/kennethreitz/osx-gcc-installer
  • Scroll down to the README and download the appropriate package (for OSX 10.7 or 10.6)
  • Open the .pkg file and run the installer.

You should be able to install the gems now, either with gem install or bundle install.

Overhead If you are worried about the other junk this comes with, here is a summary.

  • gcc – useful
  • make – useful
  • clang – useful for ObjectiveC
  • Developer CLI Tools (purge, etc) – useful?
  • DevSDK (headers, etc) – what you need

Solution no. 7:

A simple google search reveals this:

If you get the can’t find header files for ruby error message when trying to build an extension or a gem, it means that Ruby cannot locate its header files.

Header files are not delivered by default with Mac OS X, you need to install the Xcode Tools package after the installation. You can find it in the Optional Installs / Xcode Tools directory on the Leopard DVD.

Solution no. 8:

If you use homebrew, run brew doctor. You might find out that the required gcc libraries for compilation are outdated and/or missing.

For Lion and Mountain Lion users, Apple now provides an official Command Line Tools for Xcode package that you can install without needing to install Xcode itself! You can download it from Apple’s developer site https://developer.apple.com/downloads/index.action. If you still need gcc-4.2, and you use Homebrew, you can install it using the apple-gcc42 package from homebrew/dupes.

Solution no. 9:

I had the same problem.

Here is my adventures (hope it will be useful):

To fix it I’ve done many manipulations 🙂

I’m using Fedora Core.
I’ve fixed it this way:

I’ve installed rails-devel:


sudo yum install rails-devel

tried again:


sudo gem install rails

but I’ve got another problem:


Building native extensions. This could take a while… ERROR: Error
installing rails: ERROR: Failed to build gem native extension.
/usr/bin/ruby extconf.rb creating Makefile

make gcc -I. -I/usr/lib/ruby/1.8/i386-linux
-I/usr/lib/ruby/1.8/i386-linux -I. -D_FILE_OFFSET_BITS=64 -fPIC -O2 -g -pipe -Wall -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fstack-protector –param=ssp-buffer-size=4 -m32 -march=i686 -mtune=atom -fasynchronous-unwind-tables -fno-strict-aliasing -fPIC -O3 -Wall -c parser.c
make: gcc: Command not found

So I’ve installed GCC:


sudo yum install gcc

tried again:


sudo gem install rails

Now I’ve got another problem ))) :


Installing ri documentation for json-1.6.3… ERROR: While generating
documentation for json-1.6.3 … MESSAGE: no such file to load —
irb/slex … RDOC args: –ri –op
/usr/lib/ruby/gems/1.8/doc/json-1.6.3/ri –title JSON implemention for
Ruby –main README.rdoc ext/json/ext ext lib README.rdoc –title
json-1.6.3 Documentation –quiet

So installed ruby-irb:


sudo yum install ruby-irb

tried again:


sudo gem install rails
Successfully installed rails-3.1.3

That’s all )))

Solution no. 10:

Here is my solution:

My setup:

Hope this helps!

Install Command Line Tools

The Gems Mac Os Download

To install the command line tools to compile native extensions, open a terminal and run:

Install Ruby

Jekyll requires Ruby v2.4.0 or higher.macOS Big Sur 11.x ships with Ruby 2.6.3. Check your Ruby version using ruby -v.

If you’re running a previous version of macOS, you’ll have to install a newer version of Ruby.

With Homebrew

To run the latest Ruby version you need to install it through Homebrew.

Add the brew ruby and gems path to your shell configuration:

Relaunch your terminal and check your Ruby setup:

You’re now running the current stable version of Ruby!

With rbenv

People often use rbenv to manage multipleRuby versions. This is very useful when you need to be able to run a given Ruby version on a project.

The Gems Mac Os X

Restart your terminal to apply your changes.Next, you can install the Ruby version you want. Let’s install the latest stable version:

That’s it! Head over to rbenv command references to learn how to use different versions of Ruby in your projects.

Install Jekyll

After installing Ruby, install Jekyll and Bundler.

Local Install

Install the bundler and jekyll gems:

Get your Ruby version:

Append your path file with the following, replacing the X.X with the first two digits of your Ruby version:

Check that GEM PATHS: points to your home directory:

Every time you update Ruby to a version in which the first two digits change, update your path to match.

Global Install

We recommend not installing Ruby gems globally to avoid file permissions problems and using sudo.

On Mojave (10.14)

Because of SIP Protections in Mojave, run:

The

Before Mojave (<10.14)

Run:

Troubleshooting

The Gems Mac Os Catalina

See Troubleshooting or ask for help on our forum.