Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > Ruby > Can't install gems (Windows)

Reply
Thread Tools

Can't install gems (Windows)

 
 
Sal
Guest
Posts: n/a
 
      01-17-2010
I am unable to install any gems now on my Windows 7 machine running
Ruby 1.9.1. Earlier today I was updating a gem and it failed. Since
then, I can't install or update ANY gems. I tried un/reinstalling ruby
with no luck. The error is:

ERROR: While executing gem... (Errno(EEXIST)
File exists - C:
 
Reply With Quote
 
 
 
 
Luis Lavena
Guest
Posts: n/a
 
      01-18-2010
On Jan 17, 7:27*pm, Sal <salbass...@hotmail.com> wrote:
> I am unable to install any gems now on my Windows 7 machine running
> Ruby 1.9.1. Earlier today I was updating a gem and it failed. Since
> then, I can't install or update ANY gems. I tried un/reinstalling ruby
> with no luck. The error is:
>
> ERROR: While executing gem... (Errno(EEXIST)
> File exists - C:


Please, provide more information about your ruby installation and the
version of RubyGems being used.

('gem env' will provide all that information)

Also, provide the complete output of the gem installation command with
debug and verbose mode turned on:

gem install foobar --debug -V

Paste the complete output.

Help us help you.

--
Luis Lavena
 
Reply With Quote
 
 
 
 
Alpha Blue
Guest
Posts: n/a
 
      01-18-2010
I don't think you should be using 1.9.1 on windows to begin with. I'm a
windows system admin and it's very difficult to begin to understand how
to build 1.9.1 from binaries. A lot of people, especially good people
like Luis and Roger have gone out of their way to work on a package that
is built around MinGW. For windows installations we're pretty much
stuck with either a MinGW or cygwin.

First, Luis is correct that you need to supply all of the information
for your current ruby setup.

Personally, I would not use 1.9.1. A lot of people make the mistake in
wanting to use the latest and greatest and after awhile they realize the
difficulties with trying to find gems that are compiled not only for
their ruby environment but gems that include OS dependencies. With
1.9.1 you need to install gems based on those dependency checks.

So, you have a few options you should consider here.

If you are hell bent on developing with windows, then go to the 1.8.6
one-click installer, or move to netbeans 6.8 and jruby. You can't use
Ruby EE (enterprise edition) on a windows environment so that's not a
good option. While you could go with a 1.8.7 setup, you are probably
going to run into similar compiler issues, especially with windows 7.
And, if you are trying to use 64-bit, this is a whole other headache in
itself.

So, outlining your options here if you are bent on developing on
windows:

1.8.6 - One Click Installer (no headaches)
JRuby 1.4 - use Netbeans 6.8 IDE ( very few headaches)

OR, you can do the following:

Install VMWare or Virtualbox, create a linux distro for either CentOS
5.4 OR Ubuntu 9.x, and follow numerous threads for getting your
development going.

My setup is as follows:

I develop on Windows and on Linux (CentOS and Ubuntu). On Windows I
have Ruby 1.8.6, Ruby 1.9.1(ming..), Jruby 1.2 and 1.4. On my vmware I
run two distros (centos and ubuntu) and both of those distros use Ruby
EE (which is very fast and stable version 1.8.7) I also use netbeans
6.8 on linux and it runs fine after you set it up properly.

I know this might be a lot of information to take in, but I can think of
about 5 things off the top of my head and I bet Luis can to, on what has
gone wrong with your environment.

I'm willing to help you out if you need it.

--
Posted via http://www.ruby-forum.com/.

 
Reply With Quote
 
Sal
Guest
Posts: n/a
 
      01-18-2010
I am using the latest ruby 1.9.1 windows installer.

gem env yields:

RubyGems Environment:
- RUBYGEMS VERSION: 1.3.5
- RUBY VERSION: 1.9.1 (2009-07-16 patchlevel 243) [i386-mingw32]
- INSTALLATION DIRECTORY: c:/Ruby/lib/ruby/gems/1.9.1
- RUBY EXECUTABLE: c:/Ruby/bin/ruby.exe
- EXECUTABLE DIRECTORY: c:/Ruby/bin
- RUBYGEMS PLATFORMS:
- ruby
- x86-mingw32
- GEM PATHS:
- c:/Ruby/lib/ruby/gems/1.9.1
- C:/Users/Matt/.gem/ruby/1.9.1
- GEM CONFIGURATION:
- :update_sources => true
- :verbose => true
- :benchmark => false
- :backtrace => false
- :bulk_threshold => 1000
- :sources => ["http://gems.rubyforge.org/", "http://
gemcutter.org"]
- REMOTE SOURCES:
- http://gems.rubyforge.org/
- http://gemcutter.org

Any gem install fails, but for example here is the attempt to install
rails:

Exception `NameError' at c:/Ruby/lib/ruby/site_ruby/1.9.1/rubygems/
command_manag
er.rb:161 - uninitialized constant Gem::Commands::InstallCommand
Exception `Gem::LoadError' at c:/Ruby/lib/ruby/site_ruby/1.9.1/
rubygems.rb:827 -
Could not find RubyGem test-unit (>= 0)

Exception `Errno::EEXIST' at c:/Ruby/lib/ruby/1.9.1/fileutils.rb:243 -
File exis
ts - C:/Users/Matt/.gem/specs/gems.rubyforge.org%80
Exception `Errno::EEXIST' at c:/Ruby/lib/ruby/1.9.1/fileutils.rb:243 -
File exis
ts - C:/Users/Matt/.gem/specs/gemcutter.org%80
Exception `Errno::ENOENT' at c:/Ruby/lib/ruby/1.9.1/fileutils.rb:243 -
No such f
ile or directory - C:/Users/Matt/.gem/specs/gemcutter.org%80/quick/
Marshal.4.8
Exception `Errno::EEXIST' at c:/Ruby/lib/ruby/1.9.1/fileutils.rb:243 -
File exis
ts - C:
Exception `Errno::EEXIST' at c:/Ruby/lib/ruby/1.9.1/fileutils.rb:219 -
File exis
ts - C:
ERROR: While executing gem ... (Errno::EEXIST)
File exists - C:
c:/Ruby/lib/ruby/1.9.1/fileutils.rb:243:in `mkdir'
c:/Ruby/lib/ruby/1.9.1/fileutils.rb:243:in `fu_mkdir'
c:/Ruby/lib/ruby/1.9.1/fileutils.rb:217:in `block (2 levels)
in mkdir_p'

c:/Ruby/lib/ruby/1.9.1/fileutils.rb:215:in `reverse_each'
c:/Ruby/lib/ruby/1.9.1/fileutils.rb:215:in `block in mkdir_p'
c:/Ruby/lib/ruby/1.9.1/fileutils.rb:201:in `each'
c:/Ruby/lib/ruby/1.9.1/fileutils.rb:201:in `mkdir_p'
c:/Ruby/lib/ruby/site_ruby/1.9.1/rubygems/spec_fetcher.rb:
103:in `fetch_
spec'
c:/Ruby/lib/ruby/site_ruby/1.9.1/rubygems/spec_fetcher.rb:
72:in `block i
n fetch'
c:/Ruby/lib/ruby/site_ruby/1.9.1/rubygems/spec_fetcher.rb:
71:in `map'
c:/Ruby/lib/ruby/site_ruby/1.9.1/rubygems/spec_fetcher.rb:
71:in `fetch'
c:/Ruby/lib/ruby/site_ruby/1.9.1/rubygems/
dependency_installer.rb:99:in
`find_gems_with_sources'
c:/Ruby/lib/ruby/site_ruby/1.9.1/rubygems/
dependency_installer.rb:192:in
`find_spec_by_name_and_version'
c:/Ruby/lib/ruby/site_ruby/1.9.1/rubygems/
dependency_installer.rb:213:in
`install'
c:/Ruby/lib/ruby/site_ruby/1.9.1/rubygems/commands/
install_command.rb:11
8:in `block in execute'
c:/Ruby/lib/ruby/site_ruby/1.9.1/rubygems/commands/
install_command.rb:11
5:in `each'
c:/Ruby/lib/ruby/site_ruby/1.9.1/rubygems/commands/
install_command.rb:11
5:in `execute'
c:/Ruby/lib/ruby/site_ruby/1.9.1/rubygems/command.rb:257:in
`invoke'
c:/Ruby/lib/ruby/site_ruby/1.9.1/rubygems/command_manager.rb:
132:in `pro
cess_args'
c:/Ruby/lib/ruby/site_ruby/1.9.1/rubygems/command_manager.rb:
102:in `run
'
c:/Ruby/lib/ruby/site_ruby/1.9.1/rubygems/gem_runner.rb:58:in
`run'
c:/Ruby/bin/gem:21:in `<main>'

Thank you guys so much. I appreciate nay assistance you can provide me!
 
Reply With Quote
 
Alpha Blue
Guest
Posts: n/a
 
      01-18-2010
1. Where did you build your 1.9.1 binaries from?

Did you use this one?

http://github.com/oneclick/rubyinstaller

2. Add http://gems.github.com to your gem sources

3. Run gem update.

4. Run gem list and post your gems.

--
Posted via http://www.ruby-forum.com/.

 
Reply With Quote
 
Luis Lavena
Guest
Posts: n/a
 
      01-18-2010
On Jan 18, 12:22*am, Sal <salbass...@hotmail.com> wrote:
> I am using the latest ruby 1.9.1 windows installer.
>
> gem env yields:
>
> RubyGems Environment:
> * - RUBYGEMS VERSION: 1.3.5
> * - RUBY VERSION: 1.9.1 (2009-07-16 patchlevel 243) [i386-mingw32]
> * - INSTALLATION DIRECTORY: c:/Ruby/lib/ruby/gems/1.9.1
> * - RUBY EXECUTABLE: c:/Ruby/bin/ruby.exe
> * - EXECUTABLE DIRECTORY: c:/Ruby/bin
> * - RUBYGEMS PLATFORMS:
> * * - ruby
> * * - x86-mingw32
> * - GEM PATHS:
> * * *- c:/Ruby/lib/ruby/gems/1.9.1
> * * *- C:/Users/Matt/.gem/ruby/1.9.1
> * - GEM CONFIGURATION:
> * * *- :update_sources => true
> * * *- :verbose => true
> * * *- :benchmark => false
> * * *- :backtrace => false
> * * *- :bulk_threshold => 1000
> * * *- :sources => ["http://gems.rubyforge.org/", "http://
> gemcutter.org"]
> * - REMOTE SOURCES:
> * * *-http://gems.rubyforge.org/
> * * *-http://gemcutter.org
>
> Any gem install fails, *but for example here is the attempt to install
> rails:
>
> Exception `Errno::EEXIST' at c:/Ruby/lib/ruby/1.9.1/fileutils.rb:243 -
> File exis
> ts - C:/Users/Matt/.gem/specs/gems.rubyforge.org%80
> Exception `Errno::EEXIST' at c:/Ruby/lib/ruby/1.9.1/fileutils.rb:243 -
> File exis
> ts - C:/Users/Matt/.gem/specs/gemcutter.org%80
> Exception `Errno::ENOENT' at c:/Ruby/lib/ruby/1.9.1/fileutils.rb:243 -
> No such f
> ile or directory - C:/Users/Matt/.gem/specs/gemcutter.org%80/quick/
> Marshal.4.8
> Exception `Errno::EEXIST' at c:/Ruby/lib/ruby/1.9.1/fileutils.rb:243 -
> File exis
> ts - C:
> Exception `Errno::EEXIST' at c:/Ruby/lib/ruby/1.9.1/fileutils.rb:219 -
> File exis
> ts - C:
> ERROR: *While executing gem ... (Errno::EEXIST)
> * * File exists - C:
>
> [...]
> Thank you guys so much. I appreciate nay assistance you can provide me!


Please change directory into one of the gem installation directories:

cd c:/Ruby/lib/ruby/gems/1.9.1

And try yo create a file there:

ruby -rfileutils -e "FileUtils.touch 'foobar'"

Repeat the same process with the second directory shown by gem env (C:/
Users/Matt/.gem/ruby/1.9.1)

If you or Ruby cannot write to these directories, it will fail.

If you installed Ruby with administrative privileges and you're not a
member of Administrator group, then you're hitting a permission issue.

I would recommend setting GEM_HOME and GEM_PATH environment variables
to a different place (one that you have control) and try installation
again.

Also, please remove gemcutter from your gem sources:

gem sources -r http://gemcutter.org

As Gemcutter is now gems.rubyforge.org

--
Luis Lavena
 
Reply With Quote
 
Bill Kelly
Guest
Posts: n/a
 
      01-18-2010
Alpha Blue wrote:
> If you are hell bent on developing with windows, then go to the 1.8.6
> one-click installer, or move to netbeans 6.8 and jruby. You can't use
> Ruby EE (enterprise edition) on a windows environment so that's not a
> good option. While you could go with a 1.8.7 setup, you are probably
> going to run into similar compiler issues, especially with windows 7.
> And, if you are trying to use 64-bit, this is a whole other headache in
> itself.


Hopefully not to confuse the issue, but depending on one's requirements
there are significant benefits from using 1.9.x or 1.9.2 on windows.

1.9.x provides, for the first time in FOREVER on windows ruby, a popen()
that only blocks its own thread, rather than the whole process.

And 1.9.2 provides Unicode path support on windows. (Last I checked,
Unicode path support was only partially implemented so far in 1.9.2,
but they're working on it.)

Both a non-process-blocking popen() and Unicode path support are critical
to my current application, so 1.9.2 is a must for me on Windows.

Thankfully, so far I've found it relatively simple to build ruby from
the command line using the Microsoft compiler. (Haven't tried the MinGW
route, but I presume it's at least as well-behaved.)


Regards,

Bill



 
Reply With Quote
 
Sal
Guest
Posts: n/a
 
      01-18-2010
On Jan 17, 10:38*pm, Alpha Blue <jdezen...@gmail.com> wrote:
> 1. *Where did you build your 1.9.1 binaries from?


I am using the installer from Rubyforge.

I did what you suggested but when running list I still show no gems.
Weird...
 
Reply With Quote
 
Sal
Guest
Posts: n/a
 
      01-18-2010
I have tried all of your suggestions and the problem persists. I was
able to write in those directories (not a permissions problem), and
changing the gem path/home yielded the same result.

I am really baffled as this WAS working yesterday until I had issues
with a gem called cucumber.

Any suggestions? I am really stumped here.


 
Reply With Quote
 
Alpha Blue
Guest
Posts: n/a
 
      01-18-2010
Sal wrote:
> On Jan 17, 10:38�pm, Alpha Blue <jdezen...@gmail.com> wrote:
>> 1. �Where did you build your 1.9.1 binaries from?

>
> I am using the installer from Rubyforge.
>
> I did what you suggested but when running list I still show no gems.
> Weird...


I'll build a new package with the one from Rubyforge on Win 7 and see if
I encounter any similar issues. Provide me a short list of gems you
were trying to install as well. I'll post my results.
--
Posted via http://www.ruby-forum.com/.

 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Can't install gems after a new ubuntu install Max Williams Ruby 12 07-13-2008 07:41 PM
Fail to Install Gems - My First Gems Foolish Brat Ruby 4 09-10-2007 02:51 AM
Gems -- #include <gems.hpp> Tomás C++ 7 03-05-2006 02:48 PM
'private' gems/gems hierarchy Dany Cayouette Ruby 3 11-25-2005 10:55 PM
Confusion about gems and non-gems working together. Lloyd Zusman Ruby 3 06-20-2005 11:23 PM



Advertisments
 



1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57