Windows 10 Ruby on Rails Install Issue Json - ruby-on-rails

Hello I am trying set up ruby on rails on my pc. Everytime i do a bundle install, I receive this error
An error occurred while installing json (1.8.3), and Bundler cannot continue.
Make sure that gem install json -v '1.8.3' succeeds before bundling.
I am trying to use ruby 2.2.3, This is my first experience using Ruby on my pc.

Some gems need to build some native C/C++ extensions. You should install DevKit. Here's the link. And then add it to your system environment's path variable.

Related

How to fix permissions error when installing Rails on Windows

I have Ruby 2.2.6 and Rails 5.0 installed succesfully, however I don't seem to be able to install gems. Here's the error I get:
Errno::EACCES: Permission denied # rb_sysopen -
C:/RailsInstaller/Ruby2.3.0/lib/ruby/gems/2.3.0/gems/nokogiri-1.7.1-x86- mingw32/lib/nokogiri/2.3/nokogiri.so
An error occurred while installing nokogiri (1.7.1), and Bundler cannot
continue.
Make sure that `gem install nokogiri -v '1.7.1'` succeeds before bundling.
I searched for solutions but all the suggestions are for Unix commands.
I'm on Windows so I'm not sure how to enable permissions in order for this install to pass succesfully.
Any (ELI5 level) suggestions for me?
Have you tried executing:
gem install nokogiri -v '1.7.1'
In your command line?
If you are still getting an error, post the error message.
If you go to the Nokogiri website, you'll find special instructions for installing it on Windows.
A number of Ruby libraries are called native libraries, meaning they're written in C for Unix, and so require Unix build tools to make.

An error occurred while installing json (1.7.6), and Bundler cannot continue.

An error occurred while installing json (1.7.6), and Bundler cannot continue.
Make sure that gem install json -v '1.7.6' succeeds before bundling.
Might be your existing Ruby version does not support the gem. Use the gems that support by your Ruby version. If yours Ruby version is higher than 2.1.0 then degrade it to 2.1.0 then it works fine.
You have to update your ruby installation . Which version it is ?
check it from terminal , try
ruby -v

An error occurred while installing ruby-opencv (0.0.14)

I'm facing gem ruby-opencv installation issue
Gem files will remain installed in /home/k2/.rvm/gems/ruby-2.1.2#rails4/gems/ruby-opencv-0.0.14 for inspection.Results logged to /home/k2/.rvm/gems/ruby-2.1.2#rails4/extensions/x86_64-linux/2.1.0/ruby-opencv-0.0.14/gem_make.out
An error occurred while installing ruby-opencv (0.0.14), and Bundler cannot continue.
Make sure that `gem install ruby-opencv -v '0.0.14'` succeeds before bundling.
I tried below one also
gem install ruby-opencv -v '0.0.14'
ruby -v => 2.1.2
You need to download the opencv package from
https://github.com/Itseez/opencv/tree/master using,
git clone https://github.com/Itseez/opencv.git
or clicking on download button in that same page.
And install the above package using http://docs.opencv.org/doc/tutorials/introduction/linux_install/linux_install.html
And then start to install the gem as below
gem install ruby-opencv -- --with-opencv-dir=/usr/local.
Now it will work.
Typically the Ruby opencv gem needs to compile native extensions, including the opencv tools, the sqlite database, the python language, openssl networking, and possibly access to your system's compiler such as gcc.
These extensions are generally easiest to diagnose by using sudo.
Try this if you can:
sudo gem install ruby-opencv -v '0.0.14'
Also, you may want to try changing from using rvm to using ruby-build.
Can you please edit your question, and add the results of the log file?
cat /home/k2/.rvm/gems/ruby-2.1.2#rails4/extensions/x86_64-linux/2.1.0/ruby-opencv-0.0.14/gem_make.out
Have you already installed OpenCV successfully on its own?
You can install OpenCV with these instructions: http://docs.opencv.org/doc/tutorials/introduction/linux_install/linux_install.html
If you can install OpenCV, that may help verify you have most of the pieces you need for the Ruby gem.

Bundle install gives errors on many gems

when i try to run a bundle install on a catarse project on my VPS, many of the gems needed for this project returns errors and i can't install (i'm using: ruby 1.9.2p320).
for example the gems thats return error are:
thin
eventmachine
linecache19
the error is always something that begins with:
Gem::Installer::ExtensionBuildError: ERROR: Failed to build gem native extension.
and ends with:
Gem files will remain installed in /usr/local/rvm/gems/ruby-1.9.2-p320#catarse/gems/linecache19-0.5.12 for inspection.
Results logged to /usr/local/rvm/gems/ruby-1.9.2-p320#catarse/gems/linecache19-0.5.12/ext/trace_nums/gem_make.out
An error occurred while installing linecache19 (0.5.12), and Bundler cannot continue.
Make sure that `gem install linecache19 -v '0.5.12'` succeeds before bundling.
can you help to figure out?
Some gems need to be built locally rather than simply downloaded. This means that some of the code in the gem is written in something other than ruby (usually C). The non-ruby code needs to be compiled and built locally in order to run. In those cases you'll need an environment that is capable of compiling and building that non-ruby code.
There's a good post about native gems here : http://patshaughnessy.net/2011/10/31/dont-be-terrified-of-building-native-extensions.
In cases like these it is usually question of tracking down which libraries need to be installed locally in order to build the gem.
I am aware of some issues with linecache19 and there are questions out there that address these, for example : Installing linecache19 for Ruby 1.9.2 via rvm.

Error when installing json 1.7.5 in rails

I am trying to install latest version of json using gem bundle install and it results in an error. I am trying to install within aptana studio 3 workspace.
I get the following error - can anyone throw some light on this issue -
Installing json (1.7.5) with native extensions
Gem::Installer::ExtensionBuildError: ERROR: Failed to build gem native extension.
An error occurred while installing json (1.7.5), and Bundler cannot continue.
Make sure that gem install json -v '1.7.5' succeeds before bundling.
After seeing this error I just ran install json and it runs fine but json doesnt seem to install.
--
Sandesh
I had the same json 1.7.5 error while creating or doing bundle install on a new rails 3.2.9 app on ruby 1.9.3. This is what worked for me:
Get the latest version of Xcode (4.5.2 in my case). Open up Xcode. Go to Preferences. Go to downloads, and click INSTALL on the Command Line Tools.
In your terminal do: rvm reinstall 1.9.3
Create your new rails app, you will get the same json 1.7.5 error, but it's ok. Then open up the app and go to your Gemfile. At the top of the file, change source 'https://rubygems.org' to source 'http://rubygems.org'
run gem install json -v '1.7.5'
run bundle install
This should work, as it did in my case!
I forgot about it sorry. Please check these questions:
When I try sudo gem install json I get the following error
Why won't bundler install the json 1.7.4 gem on OS X 10.8?
Probably you need to install XCode Command Line tools.

Resources