"Gem Install Rails" Fails With Dns Error

Error installing rails ERROR: Failed to build gem native extension

When I run sudo apt-get install ruby-dev zlib1g-dev liblzma-dev I got these logs:

build-essential patch
Reading package lists... Done
Building dependency tree
Reading state information... Done
build-essential is already the newest version (12.1ubuntu2).
patch is already the newest version (2.7.5-1).
zlib1g-dev is already the newest version (1:1.2.8.dfsg-2ubuntu4.1).
zlib1g-dev set to manually installed.
You might want to run 'apt-get -f install' to correct these:
The following packages have unmet dependencies:
ruby-dev : Depends: ruby2.3-dev but it is not going to be installed
slack-desktop : Depends: libappindicator1 but it is not going to be installed
E: Unmet dependencies. Try 'apt-get -f install' with no packages (or specify a solution).

So to solve this problem I run apt-get -f install

Then I run sudo apt-get install ruby-dev zlib1g-dev liblzma-dev dependencies were successfully installed.

gem native extension successfully build.

When I run bundle install i'm getting error with bcrypt gem

I made changes in the gem file by replacing gem 'bcrypt' instead of gem 'bcrypt-ruby' and did bundle install and worked for me!!

Error while installing rails gem

So I finally figured out what was going on. It turns out that the configuration file for the DNS servers had an extra comma after the IP addresses which caused it to not resolve properly. I'm on ubuntu 14.04 and the file was in /etc/resolve.conf.

How to list gem dependencies for some non-intalled gem?

I know that this is a bit of a necro, but I think that you can use gem install --explain rails.

from http://guides.rubygems.org/command-reference/#gem-install

-​-explain - Rather than install the gems, indicate which would be installed

You may have to run that command from another system that CAN access the rubygems.org server, get the list of gems, pull them down, and install them on your system instead of hitting rubygems directly (till you get your network problem figured out)



Related Topics



Leave a reply



Submit