Ruby Install GEM package failed generic Solution _ruby topic

Source: Internet
Author: User

Ruby language upgrades are still more diligent. But a large number of versions make library compatibility a big problem. Some gems indicate that Ruby is explicitly unsupported by a particular version, while some gems are incompatible with a higher version. In addition, the gem itself has a version, it is simply chaos into a porridge. Even with ruby versioning tools such as RVM and rbenv, you can't avoid falling into a hole. And some other environmental settings from time to time are also disturbing you. Therefore, when using Ruby programs, it is prudent to upgrade Ruby versions or various gem versions, so that you do not fall into the pit with your hands cheap.

Of course, you can't be a turtle, and in some cases you have to upgrade. For example, to use the features of a new version of Ruby or Gem. I personally like to upgrade to the latest version of whatever software I use, and Ruby programs are no exception. Time has been planted more times, but also slowly groped out some experience. Here to share, I hope everyone can avoid these pits, bold upgrades.

Because I use the operating system is a Mac, so these tips are based on the MAC system.

When running a Ruby script or bundle install, the error log must be read carefully. If there is a clear error log, they can solve the problem can be solved, I do not know how to solve the choice of keywords Google, and generally can find solutions. Fear is afraid of Google after a lap or do not know what to do. Then you can try several of the following methods.

Upgrade a small version of Ruby.

First, upgrade the current RVM to the latest version.

Copy Code code as follows:
$ RVM Get Stable

Then look at the version of Ruby currently in use and the version of Ruby available to the server.
Copy Code code as follows:
$ RVM List
$ RVM list known

Although you are not going to upgrade the main Ruby version, the iteration is an attempt to upgrade to see if it solves the problem. For example, your Ruby is currently using ruby-1.9.3-p448, but see the latest version of 1.9.3 that is currently available is ruby-1.9.3-p545. Then you can try to switch to this new version of the next to see if the problem can be solved.
Copy Code code as follows:
$ RVM Install ruby-1.9.3-p545

$ RVM Use ruby-1.9.3-p545


Ensure Xcode and command line developer tools are the latest version
Make sure that the Xcode command line developer tools for this machine are installed and up to date. After you upgrade the Xcode to the latest version, at the command line, enter:
Copy Code code as follows:
$ xcode-select-install

This will bring up an upgrade dialog box to upgrade the appropriate software.

Make sure GCC is the latest version
View the current version of GCC for your computer.

Copy Code code as follows:
$ gcc-v

If you need to update GCC, the recommendation is updated with homebrew. Update homebrew first.
Copy Code code as follows:
$ Brew Update

Then enter the following command.

Copy Code code as follows:
$ brew Tap Homebrew/dupes
$ Brew Search GCC

Brew will tell you the latest version of GCC. For example, it is apple-gcc42. Then install a new version of GCC.
Copy Code code as follows:
$ Brew Install Apple-gcc42

Then check to see if the system has this version of GCC applied.
Copy Code code as follows:
$ which gcc-4.2
/usr/local/bin/gcc-4.2

Basically, some of these checks will solve a number of problems caused by the ruby environment.

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.