Gem Install memcached-northscale error - ruby-on-rails

Trying to install memcached-northscale and getting a weird error. Any help would be appreciated.
$ sudo gem install memcached-northscale
Building native extensions. This could take a while...
ERROR: Error installing memcached-northscale:
ERROR: Failed to build gem native extension.
/System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/bin/ruby extconf.rb
mkmf.rb can't find header files for ruby at /System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/lib/ruby/ruby.h

I was able to fix the issue by installing XCode from Apple

Related

Failed to Build Gem Extension Error Installing rails

I'm on a fresh Ubuntu installation and using the guide to install rails found here.
When I get to the final sudo gem install rails, I get this error:
Building native extensions. This could take a while...
ERROR: Error installing rails:
ERROR: Failed to build gem native extension.
current directory: /var/lib/gems/2.3.0/gems/nio4r-1.2.1/ext/nio4r
/usr/bin/ruby2.3 -r ./siteconf20160821-19665-u7rxlt.rb extconf.rb
mkmf.rb can't find header files for ruby at /usr/lib/ruby/include/ruby.h
extconf failed, exit code 1
Gem files will remain installed in /var/lib/gems/2.3.0/gems/nio4r-1.2.1 for inspection.
Results logged to /var/lib/gems/2.3.0/extensions/x86_64-linux/2.3.0/nio4r-1.2.1/gem_make.out
Try this
gem update --system 2.0.3
Ref: https://stackoverflow.com/a/17657242/4132578

Issue with Ruby gem install

I am trying to install json on windows as follows, but its not working. Please help me with possible resoultion for the same.
C:\Ruby193\bin>gem install --local json-1.8.1.gem
Temporarily enhancing PATH to include DevKit...
Building native extensions. This could take a while...
ERROR: Error installing json-1.8.1.gem:
ERROR: Failed to build gem native extension.
C:/Ruby193/bin/ruby.exe -r ./siteconf20140725-4216-11o740j.rb extconf.rb
creating Makefile
make clean
Makefile:165: *** target pattern contains no `%'. Stop.
make
Makefile:165: *** target pattern contains no `%'. Stop.
make failed, exit code 2
Gem files will remain installed in C:/Ruby193/lib/ruby/gems/1.9.1/gems/json-1.8.1 for inspection.
Results logged to C:/Ruby193/lib/ruby/gems/1.9.1/extensions/x86-mingw32/1.9.1/json-1.8.1/gem_make.out
RubyGems 2.4.1 will not build native extensions in Ruby version 1.9.3 and earlier on Windows.
You will need to downgrade RubyGems to 1.8.29.
To do this run the following command:
gem update --system 1.8.29
Check gem version:
gem -v
1.8.29
Now try your command again:
gem install --local json-1.8.1.gem
ref: https://groups.google.com/forum/#!topic/rubyinstaller/k19SeJijpKU/discussion

Unable to install linecache19 gem on ruby193

I know this is one of the problem everybody is having these days and many of them have found ways to troubleshoot this problem. Unfortunately I have tried all the solutions but none of them seem to work on my system.
when I do
gem install linecache19
I get this error, as below
gem install linecache19
Temporarily enhancing PATH to include DevKit...
Building native extensions. This could take a while...
The system cannot find the path specified.
ERROR: Error installing linecache19:
ERROR: Failed to build gem native extension.
C:/Ruby193/bin/ruby.exe extconf.rb
checking for vm_core.h... no
C:/Ruby193/lib/ruby/gems/1.9.1/gems/ruby_core_source-0.1.5/lib/ruby_core_source.
rb:39: Use RbConfig instead of obsolete and deprecated Config.
checking for vm_core.h... yes
checking for version.h... yes
creating Makefile
Gem files will remain installed in C:/Ruby193/lib/ruby/gems/1.9.1/gems/linecache
19-0.5.13 for inspection.
Results logged to C:/Ruby193/lib/ruby/gems/1.9.1/gems/linecache19-0.5.13/ext/tra
ce_nums/gem_make.out
Use debugger-linecache, it's just an updated working fork of linecache19. You won't have installation issues like the one you are having because it's not built as a C extension anymore, it's 100% ruby.
gem install debugger-linecache
Hope it helps.

Installation of Rails

I tried to install Rails on OS X Lion using the following command in Terminal:
sudo gem install rails
But I am getting the following error:
Building native extensions. This could take a while...
ERROR: Error installing rails:
ERROR: Failed to build gem native extension.
/System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/bin/ruby extconf.rb
mkmf.rb can't find header files for ruby at /System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/lib/ruby/ruby.h
Gem files will remain installed in /Library/Ruby/Gems/1.8/gems/json-1.7.6 for inspection.
Results logged to /Library/Ruby/Gems/1.8/gems/json-1.7.6/ext/json/ext/generator/gem_make.out
Any help would be appreciated.
First install the Command Line Tools in the latest Xcode-Version.
and then run sudo gem install rails
To install Command Line Tools, go to XCode Preferences > Downloads.

Why am I having a problem installing rmagick

On Ruby 1.8.7 and rails 2.3.5 I get:
gem install rmagick
ERROR: Error installing rmagick:
ERROR: Failed to build gem native extension.
/System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/bin/ruby extconf.rb
mkmf.rb can't find header files for ruby at
/System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/lib/ruby/ruby.h
Gem files will remain installed in /Library/Ruby/Gems/1.8/gems/rmagick-2.13.1 for inspection.
Results logged to /Library/Ruby/Gems/1.8/gems/rmagick-2.13.1/ext/RMagick/gem_make.out
Building native extensions. This could take a while...
Cynicalgrinch:levelous pawel$ gem install rmagick
Building native extensions. This could take a while...
ERROR: Error installing rmagick:
ERROR: Failed to build gem native extension.
/System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/bin/ruby extconf.rb
mkmf.rb can't find header files for ruby at /System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/lib/ruby/ruby.h
Gem files will remain installed in /Library/Ruby/Gems/1.8/gems/rmagick-2.13.1 for inspection.
Results logged to /Library/Ruby/Gems/1.8/gems/rmagick-2.13.1/ext/RMagick/gem_make.out
Gem_make.out says this:
/System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/bin/ruby extconf.rb
mkmf.rb can't find header files for ruby at /System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/lib/ruby/ruby.h
on Ubuntu/Debian you would need to install:
sudo apt-get install libmagickwand-dev
on RedHat/Fedora/CentOS:
yum install ImageMagick-devel
To install rmagick with the gem system, you must have "imagemagick" on your system. The following error line says that rmagick failed to build because the native extension (imagemagick) does not exist on your system.
ERROR: Failed to build gem native extension.
On OSX, you can use brew (the best way in my opinion) to install imagemagick. Once brew is installed :
brew install imagemagick
gem install rmagick
On Mountain Lion (OSX), after:
brew install imagemagick
it may be necessary to force the re-creation of some symlinks manually before being able to install the rmagick gem.
> brew link -f jpeg
> brew link -f libpng
> brew link -f freetype
> brew link -f imagemagick
On fedora make sure you have ImageMagick-devel installed.

Resources