1

I have installed ruby 2.2.5 / gem 2.3.0 in CygWin but I am getting installation errors in using gem install.

As suggested in some places, I also tried gem update --system but even that did not help.

How to correct this issue?

I have attached the output of the commands I ran:

$ gem install napa --backtrace
ERROR:  While executing gem ... (TypeError)
    no implicit conversion of nil into String
        /usr/local/share/ruby/site_ruby/rubygems/installer.rb:168:in `check_executable_overwrite'
        /usr/local/share/ruby/site_ruby/rubygems/installer.rb:409:in `block in generate_bin'
        /usr/local/share/ruby/site_ruby/rubygems/installer.rb:396:in `each'
        /usr/local/share/ruby/site_ruby/rubygems/installer.rb:396:in `generate_bin'
        /usr/local/share/ruby/site_ruby/rubygems/installer.rb:236:in `install'
        /usr/local/share/ruby/site_ruby/rubygems/request_set.rb:156:in `block in install'
        /usr/local/share/ruby/site_ruby/rubygems/request_set.rb:140:in `each'
        /usr/local/share/ruby/site_ruby/rubygems/request_set.rb:140:in `install'
        /usr/local/share/ruby/site_ruby/rubygems/commands/install_command.rb:249:in `install_gem'
        /usr/local/share/ruby/site_ruby/rubygems/commands/install_command.rb:291:in `block in install_gems'
        /usr/local/share/ruby/site_ruby/rubygems/commands/install_command.rb:287:in `each'
        /usr/local/share/ruby/site_ruby/rubygems/commands/install_command.rb:287:in `install_gems'
        /usr/local/share/ruby/site_ruby/rubygems/commands/install_command.rb:202:in `execute'
        /usr/local/share/ruby/site_ruby/rubygems/command.rb:307:in `invoke_with_build_args'
        /usr/local/share/ruby/site_ruby/rubygems/command_manager.rb:167:in `process_args'
        /usr/local/share/ruby/site_ruby/rubygems/command_manager.rb:137:in `run'
        /usr/local/share/ruby/site_ruby/rubygems/gem_runner.rb:54:in `run'
        /usr/bin/gem:21:in `<main>'

$ gem update --system
Updating rubygems-update
ERROR:  While executing gem ... (TypeError)
    no implicit conversion of nil into String
1
  • I have also experienced this. I was able to install sass and gem through the cygwin installer but this command fails for me the same way. When I attempt to install a gem compass I get an error of "Failed to build gem native extension". Running as admin. I'm actively working on this issue myself. Commented Apr 5, 2017 at 19:11

1 Answer 1

2

Skip to the bottom for the short answer and not join me on my journey.
So I've been working on this today because for the life of me, what worked last year to get it working did not work this year. All the steps are attempted while using admin permissions. I had done some questionable commands from other threads that required me to downgrade gem to something 6 years ago, don't do that I could not figure out how to revert so I deleted my Cygwin install and started fresh and clean for this. Windows 10 is my operating system.

I used cygwin's installer to install the current version of ruby, gem and sass. (I'm positive as time goes on these will numbers will become out of date).

  • ruby 2.3.3p222 (2016-11-21 revision 56859) [x86_64-cygwin]
  • ruby-devel 2.3.3-1
  • gem 2.6.11
  • Sass 3.4.21 selective steve

Side note I tend to use 'Category' under the View drop down and select the devel category. I also let cygwin select dependencies for me automatically.

At this point I am having the same error. Looking at the log provided by the output I decided to try out some of the commands smashed in there like 'gcc' which was absent. Loading up the cygwin installer again, installed gcc version 5.4.0 (Package called gcc-core: GNU Compiler Collection (C, OpenMP))

Attempting to run 'gem install compass' again, another error, it cant find 'make'. Warm up the installer again and locate 'make: The GNU Version of the 'make' utility (4.2.1-2)

Running the compass install command again and checking the log: 'libffi' doesnt look like its there. In our cygwin installer says under the libs category I have libffi6 v2.2.1-2 already. I'm going to give libffi-devel a shot because I'm desperate to get compass installed.

This worked! Navigate to your directory and run the command 'compass watch' I'm pretty excited. Running 'compass -v' in the command line shows us the version 1.0.3

Short answer: Useing the Cygwin installer to install the following Packages

  • ruby: interpreted object oriented scripting language
  • ruby-devel: interpreted object oriented scripting language
  • ruby-gems: Ruby Module management system
  • ruby-sass: Ruby css compiler extension
  • make: The GNU version of the make utility
  • gcc-core: GNU Compiler Collection(c, OpenMP)
  • libffi-devel: Portable foreign function interface libary

Then run cygwin as a administrator and input the command 'gem install compass'.

Sign up to request clarification or add additional context in comments.

1 Comment

The above only allows a user with admin privileges to run compass. Where I work I have two users a admin user and a regular user. Typically I use the regular user normally and only the admin when I need to. To get compass to work for a non admin: start cygwin, run 'gem install compass'. One more step, we need to tell cygwin to not use a crazy path for compass by editing our .bashrc file and add in at the bottom: export PATH="$HOME/bin:$PATH" Save .bashrc file. Close cygwin, open it and run 'compass -v' get back the compass version and you are set.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.