Issue on install native extension ruby with windows 7 - ruby

I'm troubled with installing a native gem on windows
Error Could not Create Makefile due to some reason, probably lack of necessary
I guess it's a version issue, because I've installed the dev kit for windows to use with ruby 2.0
my gem env is :
RUBYGEMS VERSION: 2.0.14
RUBY VERSION : 2.0.0 [x64-mingw32]
INSTALLATION DIR: C:/Ruby200-x64/bin
RUBYGEMS platforms:
- ruby
- x64-mingw32

Related

Removed rvm but gem env still says my INSTALLATION DIRECTORY is .rvm/gems which doesn't exist

I am trying to remove RVM from my desktop (which used ruby 1.9), so I can use vanilla ruby 2.3, which works on my formatted laptop. So I did
rvm implode
That got rid of the ~/.rvm dir and I soon got ruby --version to say it uses 2.3.1 etc. However when I do gem env, I still get:
$ gem env
RubyGems Environment:
- RUBYGEMS VERSION: 2.4.8
- RUBY VERSION: 1.9.3 (2015-06-17 patchlevel 551) [java]
- INSTALLATION DIRECTORY: /home/foo/.rvm/gems/ruby-1.9.3-p551
- RUBY EXECUTABLE: /usr/share/jruby/bin/jruby
- EXECUTABLE DIRECTORY: /home/foo/.rvm/gems/ruby-1.9.3-p551/bin
- SPEC CACHE DIRECTORY: /home/foo/.gem/specs
Note that the /home/foo/.gem/ directory doesn't exist any more! How can I fix gem env? I am using Fedora 23 (soon 24) and I want to reset it to the system's default.
I tried a bunch of things (like reinstalling rubygems) with no luck.

Error while installing rack gem in ruby

While i am trying install rack gem using ansible, i get an error as :
ERROR: Error installing rack:
rack requires Ruby version >= 2.2.2
I have installed rack along with the gems as :
- name: Install Ruby Gems become: yes gem: name={{ item }} state=latest user_install=no with_items:
- rubygems-update
- r509
- r509-ca-http
- rack
My current version if is see using ruby --version : 2.0.0p648
WHat is the problem , and if I have to update my ruby version and how can I update using ansible for Amazon Linux OS
The error you get while installing says: "rack requires Ruby version >= 2.2.2" Then later you report "ruby --version : 2.0.0p648". The message is telling you that your version of Ruby is too old, you need to upgrade it to at least 2.2.2 to use rack.
You are currently using the system default ruby version, therefore you are bound to the version the operating systems package management is offering you. You can use different package repositories to fetch a newer version of ruby. A better approach might be to use some ruby version management system, that allows you to have several version of ruby on your system and switch those e.g. on project level. To mention two popular of them: RBENV or RVM

Running ruby gems on Windows

I am on Windows 7 and want to use http://hospice.io/. This requires Ruby gem librarian so I installed ruby 2.0 using http://rubyinstaller.org/ then downloaded RubyGems 1.8.25 from http://rubyforge.org/frs/?group_id=126 and updated (gem update --system). I installed librarian.
ruby setup.rb
gem install librarian
Now I am in the folder with my Vagrant box and want to do command librarian-chef but I get
'librarian-chef' is not recognized as an internal or external command, operable program or batch file.
I tried it when running ruby devkit/msys with the same result. Any suggestions how to run it please? I would guess there is a problem with PATH but when gem install works why doesn't librarian-chef work too?
gem env:
RubyGems Environment:
- RUBYGEMS VERSION: 2.0.3
- RUBY VERSION: 2.0.0 (2013-02-24 patchlevel 0) [x64-mingw32]
- INSTALLATION DIRECTORY: C:/bin/ruby/lib/ruby/gems/2.0.0
- RUBY EXECUTABLE: C:/bin/ruby/bin/ruby.exe
- EXECUTABLE DIRECTORY: C:/bin/ruby/bin
- RUBYGEMS PLATFORMS:
- ruby
- x64-mingw32
- GEM PATHS:
- C:/bin/ruby/lib/ruby/gems/2.0.0
- C:/Users/Andrew/.gem/ruby/2.0.0
- GEM CONFIGURATION:
- :update_sources => true
- :verbose => true
- :backtrace => false
- :bulk_threshold => 1000
- REMOTE SOURCES:
- https://rubygems.org/
Also, might want to add that I started development on a Windows machine back in ruby 1.8.7 and through ruby 1.9.3 and then switched to Ubuntu 12.04. My development time probably cut in half or maybe even a quarter. I don't know if this has changed with Ruby 2+
I encourage you to look at having a dual boot with Ubuntu, the small investment in setup will save you TONS of time in dealing with making windows act like linux and give you the added benefit of setting up your development environment exactly like it will be in production if you will be running something like unicorn/nginx.

Properly installing Ruby and Rubygems on Ubuntu

It seems this process is far harder than it should be.
Currently, I have ruby 1.9.2 installed manually. I wanted to update this to use RVM. So I installed that successfully, and then installed 1.9.3-p0, which is in my RVM directory under /zenph/.rvm
I upgraded rubygems using http://docs.rubygems.org/read/chapter/3
And my environment shows:
rvm 1.10.0
ruby 1.9.3p0
gem 1.8.12
So, why does "gem environment" show:
RubyGems Environment:
- RUBYGEMS VERSION: 1.8.12
- RUBY VERSION: 1.9.2 (2010-08-18 patchlevel 0) [i686-linux]
- INSTALLATION DIRECTORY: /usr/lib/ruby/gems/1.9.1
- RUBY EXECUTABLE: /usr/bin/ruby1.9.1
- EXECUTABLE DIRECTORY: /usr/bin
- RUBYGEMS PLATFORMS:
- ruby
- x86-linux
- GEM PATHS:
- /usr/lib/ruby/gems/1.9.1
- /home/zenph/.gem/ruby/1.9.1
What can I try to resolve this?
To see which Ruby is the default one, open a terminal and use:
rvm list default
To specify a Ruby to be the default , open a terminal and use:
rvm --default use 1.9.3
Docs

Failed WATIR installation Server 2003

I had to rebuild my box and I currently am unable to install Watir.
gem install watir
ERROR: Error installing watir:
activesupport requires Ruby version >= 1.8.7.
Which would be fine if Watir was able to use Ruby 1.8.7 . I am using
ruby -v
ruby 1.8.6 (2008-08-11 patchlevel 287) [i386-mswin32]
gem -v
1.3.7
I am not sure when this started to occur, but the documentation on the site is lacking.
On Windows XP (Professional, Version 2002, Service Pack 3, fully pathched) I have installed ruby186-26.exe from RubyForge, as suggested at watir.com/installation.
C:\>ruby -v
ruby 1.8.6 (2007-09-24 patchlevel 111) [i386-mswin32]
C:\>gem env
RubyGems Environment:
- VERSION: 0.9.4 (0.9.4)
- INSTALLATION DIRECTORY: c:/ruby/lib/ruby/gems/1.8
- GEM PATH:
- c:/ruby/lib/ruby/gems/1.8
- REMOTE SOURCES:
- http://gems.rubyforge.org
Automatic RubyGems update did not work:
C:\>gem update --system
Updating RubyGems...
ERROR: While executing gem ... (Gem::RemoteSourceException)
HTTP Response 302
I have downloaded rubygems-update-1.3.7.gem from RubyForge, copied it to the folder where I have command prompt open (C:\ in this example) and installed:
C:\>gem install rubygems-update-1.3.7.gem
Successfully installed rubygems-update, version 1.3.7
Installing ri documentation for rubygems-update-1.3.7...
Installing RDoc documentation for rubygems-update-1.3.7...
Could not find main page README
Could not find main page README
Could not find main page README
Could not find main page README
C:\>update_rubygems
RubyGems 1.3.7 installed
...
To make sure I have the latest RubyGems:
C:\>gem env
RubyGems Environment:
- RUBYGEMS VERSION: 1.3.7
- RUBY VERSION: 1.8.6 (2007-09-24 patchlevel 111) [i386-mswin32]
- INSTALLATION DIRECTORY: c:/ruby/lib/ruby/gems/1.8
- RUBY EXECUTABLE: c:/ruby/bin/ruby.exe
- EXECUTABLE DIRECTORY: c:/ruby/bin
- RUBYGEMS PLATFORMS:
- ruby
- x86-mswin32-60
- GEM PATHS:
- c:/ruby/lib/ruby/gems/1.8
- C:/Documents and Settings/Administrator/.gem/ruby/1.8
- GEM CONFIGURATION:
- :update_sources => true
- :verbose => true
- :benchmark => false
- :backtrace => false
- :bulk_threshold => 1000
- REMOTE SOURCES:
- http://rubygems.org/
Now Watir did not want to install:
C:\>gem install watir
ERROR: Error installing watir:
activesupport requires Ruby version >= 1.8.7.
I have installed activesupport-2.3.8 as suggested by Charley Baker, and I was able to install Watir:
C:\>gem install activesupport --version="2.3.8"
Successfully installed activesupport-2.3.8
1 gem installed
Installing ri documentation for activesupport-2.3.8...
Installing RDoc documentation for activesupport-2.3.8...
C:\>gem install watir
Successfully installed firewatir-1.6.5
Successfully installed nokogiri-1.4.3.1-x86-mswin32
Successfully installed watir-1.6.5
3 gems installed
...
I had a similar issue just now and thought I would add a comment to this issue. Our dev vm's are currently running windows 7, therefore I needed to run my command prompt as administrator for the gem installation to work correctly.

Resources