I have successfully installed Ruby using the 'rubyinstaller-1.9.3-p484.exe' but I am unable to install Rails. I get an error 'The 'json' native gem requires installed build tools.'
How do I resolve this ?
If the devkit made changes to the PATH, you will have to restart the cmd terminal.
1) Download Ruby 1.9.3
2) Download DevKit file from http://rubyinstaller.org/downloads (DevKit-tdm-32-4.5.2-20110712-1620-sfx.exe)
3) Extract DevKit to path C:\Ruby193\DevKit
4) cd C:\Ruby193\DevKit
5) ruby dk.rb init
6) ruby dk.rb review
7) ruby dk.rb install
you can verify the rails installation by typing this on command prompt
rails -v
Related
I have installed Ruby 2.4.4 Development Kit. Then I installed Ruby on Rails Installer for Windows.
ruby -v
gave me before Rails installation the correct version 2.4.4 but now I only have 2.3.3
I tried to reinstall Ruby 2.4.4 but it never changed the version back to 2.4.4.
Did I make a mistake by installing Ruby and should I just deinstall everything again and install Ruby on Rails if it comes with Ruby anyways?
OR am I completely wrong and everything is just fine as it is? Do I now have multiple redundant versions of Ruby or is it intended?!
Pls help my confusion
Thnak you
Do I need to install Ruby before installing Ruby on Rails from official sources for Windows
The simple answer is Yes.
If you install using RailsInstaller then don't need this before because this software has included with Ruby.
RailsInstaller packages included are
Ruby
Rails
Bundler
...
The Simple Steps
Follow those steps, actually, I have installed Ruby on Rails to many windows machine using these steps.
Step 1: Download Git BASH as the BASH emulation behaves just like the "git" command in LINUX and UNIX environments.
Step 1.1: Download and install latest NodeJS from here and check the NodeJS version
$ node -v
#=> v6.11.5 # or something like this
Step 2: Download the ruby latest version here and install it in your directory. Check the Ruby version
$ ruby -v
#=> ruby 2.3.1p112 (2016-04-26 revision 54768) [x64-mingw32]
# or something like this
Step 3: Download Devkit here take the suitable one for matching your windows bit like 32 or 64 bit
Step 4: Create a devkit folder inside Ruby directory that means where created a default directory after installing ruby software, something like this disk (:C) or (:D)/Ruby25/devkit/
Step 5: Extract the DevKit file inside the devkit folder
Step 6: Open your GIT BASH inside the devkit folder and run this two commands
$ ruby dk.rb init
$ ruby dk.rb install
if above command running properly then done.
Step 7: Now you can run rails command for installing inside ruby folder
$ gem install rails
Step 8: Check the Rails version
$ rails -v
#=> Rails 5.0.6
if till now all are steps is ok? that's it, now run rails command and create a rails project, like
$ rails new project
create
create README.md
create Rakefile
create config.ru
create .gitignore
create Gemfile
create app
create app/assets/config/manifest.js
............
Hope it helps
I'm trying to install the Gemfile contents using Bundle install but getting the error
rbenv: version `2.0.0' is not installed
The version of ruby installed in my system is:
ruby 2.1.2p95 (2014-05-08 revision 45877) [i686-linux]
and rbenv
2.1.2 (set by /home/jay/.rbenv/version)
2.1.3
The Gemfile requires ruby "2.0.0". Can any one tell how to install the required version without affecting the existing ones.
You can find a lot of information here: rbenv on github
To list all available installation candidates:
rbenv install -l
To install a ruby version you need (for example):
rbenv install 2.0.0-p643
So that you will only use this ruby version in this specific folder and not affect anything else you can do:
rbenv local 2.0.0-p643
This will generate a .ruby-version file in that directory which will force rbenv to use this ruby version here.
Just run:
rbenv install 2.0.0-p643
Which is the lastest 2.0.0 version.
If that version is not available on your system, run ruby-build --definitions to pick the lastest known 2.0.0 version on your system.
For me, I just ran
gem install bundler
and then run
bundle install
worked like a charm
You must change the ruby's version in .ruby-version file and in Gemfile
If you are getting a build failed error when trying to run rbenv install 2.0.0-p643 and after waiting for a few minutes; you might also see the last 10 lines of a log file as an output.
This can give you the hint of what would have happened for the build failure. It might miss some required library/dependency needed to be installed.
For ex. I got the following error for build failure-
ERROR: Ruby install aborted due to missing extensions
Try running `apt-get install -y libreadline-dev` to fetch missing dependencies.
I want to learn Ruby and i found an warning message in console while installation.
I have installed Ruby 2.0.0-p481 (x64) and extracted the DevKit-mingw64-64-4.7.2-20130224-1432-sfx.exe successfully.
Then i executed following command:
chdir C:\DevKit
ruby dk.rb init
ruby dk.rb install
Then i noticed the following in my console:
C:\Users\parthap>chdir C:\DevKit
C:\DevKit>ruby dk.rb init
Initialization complete! Please review and modify the auto-generated
'config.yml' file to ensure it contains the root directories to all of
the installed Rubies you want enhanced by the DevKit.
C:\DevKit>ruby dk.rb install
Invalid configuration or no Rubies listed. Please fix 'config.yml' and
rerun 'ruby dk.rb install
I am not getting any config.yml file.I can see a config.h file.
and what should be fixed there?
Thanks
Able to install ruby 1.9.3
previously was trying with Ruby 2.0.0
Ruby 2.0.0, specially the 64bits version, are relatively new on the Windows area and not all the packages have been updated to be compatible with it. To use this version you will require some knowledge about compilers and solving dependency issues, which might be too complicated if you just want to play with the language.
Thanks
This question already has answers here:
The 'json' native gem requires installed build tools
(8 answers)
Closed 7 years ago.
i m installing Rails 3 on my windows.
I installed latest ruby 2.0.0, and i updated gems.
but when i installing rails by using gem install rails , successful message has come but at last i found
ERROR: Error installing rails:
The 'atomic' native gem requires installed build tools
Please update your PATH to include build tools or download the DevKit
from 'http://rubyinstaller.org/downloads' and follow the instructions
at 'http://github.com/oneclick/rubyinstaller/wiki/Development-Kit'
plese help me...
As error message said, you need to install Ruby DevKit which can be obtained from RubyInstaller.org. (also need to check suitable Devkit version from there..)
And extract the DevKit zip file into somewhere (you are using windows then-> : c:\xxxx)
Navigate to c:\xxxx and run "ruby dk.rb init" and then "ruby dk.rb install"..
And try to re-insall rails..
I hope this helps,
I have also gone through the same problem. After doing a lot of research, I found a solution that works.
Run this command:
pik list
It should show you
187: ruby 1.8.7 (2010-08-16 patchlevel 302) [i386-mingw32]
192: ruby 1.9.2p290 (2011-07-09) [i386-mingw32]
193: ruby 1.9.3p327 (2012-11-10) [i386-mingw32]
200: ruby 2.0.0p247 (2013-06-27) [i386-mingw32]
If it's not pointing to Ruby version 200 then run the following:
pik use 200
Now run the following to enhance DevKit to your installed Ruby:
ruby dk.rb install
Finally, run the following:
gem install rails
This will install latest Rails version 4 for Ruby 2.0.
I also gone through the same problem. :) but is my first install of ruby on windows and "pik" is not avaible
so i place me in the devkit folder and try : ruby dk.rb init
and
ruby dk.rb install
and finaly
gem install rails
...
no more faillure
github.com tells us that:
The path to your RUBY_INSTALL_DIR must not contain any whitespaces (like in “C:\Program Files\Ruby193”). This is very important because whitespaces in the path to your ruby installation will cause certain error messages as soon as you try to install gems which require the DevKit.
This solved the problem of this kind for me.
You're probably not going to like this answer but if you go:
https://github.com/oneclick/rubyinstaller/wiki/Development-Kit
like it says in the message it actually helps you quite a bit.
It tells you to install the Development-Kit then cd to the directory that you put it the run “ruby dk.rb init” and “ruby dk.rb install” and when it finishes then you can run "gem install rails" and it simply works.
Easy to miss as I didn't see it the first time either
I'm doing a local install on Mac OSX of Spree (a Ruby-based ecommerce package) following the tutorial on this page.
I'm using RVM to run Ruby 1.9.2 and rails 3.0.3. I run "gem install spree" successfully to load spree version 0.40. But when I run "Gem Install Spree" I get the following message. Can anyone help?
/Library/Ruby/Site/1.8/rubygems.rb:335:in `bin_path': can't find executable spree for spree-0.40.0 (Gem::Exception)
from /usr/bin/spree:19
Also, when I run "Gem list spree" I get an empty list.
First: Not sure why you are capitalizing the commands but it's not necessary
Second: your error is pointing to 1.8. Make sure you run:
$ rvm use 1.9.2
You can create a .rvmrc file in the directory of the project to always contain the correct environment
echo "rvm 1.9.2" > .rvmrc