The Artima Developer Community
Sponsored Link

.NET Buzz Forum
Installing Ruby Gems When On A Domain (Errno::ENOENT)

0 replies on 1 page.

Welcome Guest
  Sign In

Go back to the topic listing  Back to Topic List Click to reply to this topic  Reply to this Topic Click to search messages in this forum  Search Forum Click for a threaded view of the topic  Threaded View   
Previous Topic   Next Topic
Flat View: This topic has 0 replies on 1 page
Jerrel Blankenship

Posts: 10
Nickname: jerrelb
Registered: Oct, 2011

Jerrel Blankenship is a senior programmer at Heuristics Solutions
Installing Ruby Gems When On A Domain (Errno::ENOENT) Posted: Oct 3, 2011 10:25 AM
Reply to this message Reply

This post originated from an RSS feed registered with .NET Buzz by Jerrel Blankenship.
Original Post: Installing Ruby Gems When On A Domain (Errno::ENOENT)
Feed Title: The Agile .NET Developer
Feed URL: http://www.jerrelblankenship.com/feeds/posts/default?alt=rss
Feed Description: A Blog about Agile and .Net and anything else related to software development
Latest .NET Buzz Posts
Latest .NET Buzz Posts by Jerrel Blankenship
Latest Posts From The Agile .NET Developer

Advertisement

 

As someone who is new to Ruby I really love the idea of installing what you need for the language through gems. However, when I am at work I am on my company’s domain and when I try to install a gem I get the following error:

ERROR:  While executing gem ... (Errno::ENOENT)   
    No such file or directory - H:\

After searching for a solution to this problem, I believe I have found one.

The problem stems from the fact that logging into my domain at work changes my  %HOMEDRIVE% and %HOMEPATH% environment variables to my networked H:\ drive. To solve this problem you need to change your gem.bat.

The gem.bat file is located in your RubyFolder\bin folder. I would suggest that you first make a copy of the original before any tweaking of this file. What you are going to do is modify this file so that it changes the %HOMEDRIVE% and %HOMEPATH% before it tries to install the gem and then, when it is done, change those environment variables back to the original values. Below is an example of what you want this file to look like when you are done.

@ECHO OFF
SET _HOMEDRIVE=%HOMEDRIVE%
SET _HOMEPATH=%HOMEPATH%
SET HOMEDRIVE=C:
SET HOMEPATH=/Ruby192
IF NOT "%~f0" == "~f0" GOTO :WinNT
@"ruby.exe" "C:/Ruby192/bin/gem" %1 %2 %3 %4 %5 %6 %7 %8 %9
GOTO :EOF
:WinNT
@"ruby.exe" "%~dpn0" %*
SET HOMEDRIVE=%_HOMEDRIVE%
SET HOMEPATH=%_HOMEPATH%

In the above example, Ruby192 is where Ruby is installed.

So if you are stuck behind on a domain and cannot install a much needed Ruby gem, this solution will get you back in business in no time.

I cannot take credit for this solution so here are some places where I found this solution


Read: Installing Ruby Gems When On A Domain (Errno::ENOENT)

Topic: Installing Ruby Gems When On A Domain (Errno::ENOENT) Previous Topic   Next Topic Topic: Serialization in WCF-Part I

Sponsored Links



Google
  Web Artima.com   

Copyright © 1996-2019 Artima, Inc. All Rights Reserved. - Privacy Policy - Terms of Use