eunice
eunice

Reputation: 85

Error in Installing Ruby on Rails

I have install Ruby on my machine. The version is ruby 1.9.3p551 (2014-11-13) [i386-mingw32].

Before, I was able to install Rails. But now, I've got an error that says,

$ gem install rails
Temporarily enhancing PATH to include DevKit...
Building native extensions.  This could take a while...
ERROR:  Error installing rails:
        ERROR: Failed to build gem native extension.

    c:/Ruby193/bin/ruby.exe -r ./siteconf20150226-5328-1diphe5.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.
2 for inspection.
Results logged to c:/Ruby193/lib/ruby/gems/1.9.1/extensions/x86-mingw32/1.9.1/js
on-1.8.2/gem_make.out

I cannot understand the error. Any response will be appreciated. Thanks in advance.

Upvotes: 0

Views: 182

Answers (3)

Karan Purohit
Karan Purohit

Reputation: 2659

As far as I know command :

 gem install rails

always looks for latest version of rails, and latest versions of rails doesn't support below ruby 2.

I can see you are using it on windows.

So, download this (it is an installer with ruby 2.1 and rails 4.1), it might resolve your issue

Upvotes: 1

Gagan Gami
Gagan Gami

Reputation: 10251

I am not sure but I think issue is in version supporting. You have installed ruby version ruby 1.9.3p551 and when you try to install any gem without version specification it takes latest version. So here rails may be try to install latest version 4.2 which is not supported to ruby 1.9.3 Check here : Ruby on Rails 4.0 Release Notes

Ruby 2.0 preferred; 1.9.3+ required

Try to install rails with version specification which supported ruby-1.9.3, Rails 3.2

gem install rails --version '~> 3.2.0'

To check out Ruby and Rails version: run below command

ruby -v # return current ruby version
rails -v # return current rails version

Upvotes: 1

VDN
VDN

Reputation: 516

Try this:

gem install rails --version '~> 3.2.0'

Once successfully installed use rails -v to see installed rails version.

Upvotes: 0

Related Questions