How do I get json gem 1.7.7 to Update? - ruby-on-rails

I'm trying to run a rails app on my Windows 8.1 computer, but I need json gem version 1.8.1. I currently have json 1.7.7. Bundle install returns an error and asks for me to make sure "gem install json -v 1.8.1" succeeds. Running that command returns
E:\rails_projects\bookit>gem install json -v 1.8.2
Temporarily enhancing PATH to include DevKit...
Building native extensions. This could take a while...
ERROR: Error installing json:
ERROR: Failed to build gem native extension.
C:/Ruby200-x64/bin/ruby.exe -r ./siteconf20150212-3852-vjuo23.rb extconf.rb
creating Makefile
make "DESTDIR=" clean
make "DESTDIR="
generating generator-x64-mingw32.def
compiling generator.c
make: x86_64-w64-mingw32-gcc: Command not found
make: *** [generator.o] Error 127
make failed, exit code 2
Gem files will remain installed in C:/Ruby200-x64/lib/ruby/gems/2.0.0/gems/json-
1.8.2 for inspection.
Results logged to C:/Ruby200-x64/lib/ruby/gems/2.0.0/extensions/x64-mingw32/2.0.
0/json-1.8.2/gem_make.out
E:\rails_projects\bookit>
I added the DevKit path to my list of environment variables. I find it odd that I am having a problem with DevKit because green_shoes installs and works fine, and it requires DevKit. What am I missing?
Note:
I am using Ruby 2.0.0, 64-bit, as well as the corresponding DevKit as recommended by rubyinstaller.org
EDIT: Gemfile for my rails app
source 'https://rubygems.org'
ruby '2.0.0'
gem 'rails', '4.1.4'
gem 'bootstrap-sass', '2.3.2.0'
gem 'sprockets', '2.11.0'
gem 'bcrypt-ruby', '3.1.2'
gem 'will_paginate', '3.0.4'
gem 'bootstrap-will_paginate', '0.0.9'
gem 'barista'
gem 'jquery-rails'
group :development, :test do
gem 'sqlite3'
gem 'rspec-rails', '2.14.0'
end
group :test do
gem 'selenium-webdriver', '2.35.1'
gem 'capybara', '2.1.0'
gem 'factory_girl_rails', '4.2.0'
end
gem 'sass-rails', '~> 4.0.3'
gem 'uglifier', '>= 1.3.0'
gem 'coffee-rails', '~> 4.0.0'
gem 'jquery-rails'
https://github.com/rails/turbolinks
gem 'turbolinks'
gem 'jbuilder', '~> 2.0'
group :doc do
gem 'sdoc', '~> 0.4.0', require: false
end
gem 'tzinfo-data', platforms: [:mingw, :mswin, :x64_mingw]
group :production do
gem 'pg', '0.15.1'
gem 'rails_12factor', '0.0.2'
end

This is your error:
make: x86_64-w64-mingw32-gcc: Command not found
--
The error is caused because the gcc/gc++ compiler is not found on your computer.
You should refer to this page for more information on this.
You should download this build kit, install it and then run the following:
set PATH=c:/path/to/your/mingw64/installation;%PATH%
Then perform the build again - it should work.

Related

An error occurred while installing eventmachine (1.0.3) [duplicate]

This question already has answers here:
gem eventmachine fatal error: 'openssl/ssl.h' file not found
(15 answers)
Closed 7 years ago.
I have Rails 4.2.5 and ruby 2.0.0 installed.
This is a Gemfile of a project :
source 'https://rubygems.org'
gem "whenever"
gem "therubyracer"
gem "less-rails"
gem 'twitter-bootstrap-rails', :git => 'git://github.com/seyhunak/twitter-bootstrap-rails.git'
gem 'geokit'
gem 'sequenced'
gem 'acts-as-taggable-on'
gem 'bcrypt', :require => 'bcrypt'
gem 'rack-cors', :require => 'rack/cors'
# Paperclip
gem "paperclip", "~> 4.2"
gem "thin"
gem "passenger"
gem 'geocoder'
# Bundle edge Rails instead: gem 'rails', github: 'rails/rails'
gem 'rails', '4.1.6'
# Use sqlite3 as the database for Active Record
gem 'mysql2'
# Use SCSS for stylesheets
gem 'sass-rails', '~> 4.0.3'
# Use Uglifier as compressor for JavaScript assets
gem 'uglifier', '>= 1.3.0'
# Use CoffeeScript for .js.coffee assets and views
gem 'coffee-rails', '~> 4.0.0'
# See https://github.com/sstephenson/execjs#readme for more supported runtimes
# gem 'therubyracer', platforms: :ruby
# Use jquery as the JavaScript library
gem 'jquery-rails'
# Turbolinks makes following links in your web application faster. Read more: https://github.com/rails/turbolinks
gem 'turbolinks'
# Build JSON APIs with ease. Read more: https://github.com/rails/jbuilder
gem 'jbuilder', '~> 2.0'
# bundle exec rake doc:rails generates the API under doc/api.
gem 'sdoc', '~> 0.4.0', group: :doc
# Spring speeds up development by keeping your application running in the background. Read more: https://github.com/rails/spring
gem 'spring', group: :development
When I make bundle install I receive the following error :
"An error occurred while installing eventmachine (1.0.3), and Bundler cannot continue. Make sure that gem install eventmachine -v '1.0.3' succeeds before bundling."
And if I make gem install eventmachine I have the following error
make "DESTDIR=" compiling binder.cpp
In file included from binder.cpp:20:
./project.h:116:10: fatal error: 'openssl/ssl.h' file not found
#include <openssl/ssl.h>
^
1 error generated.
make: *** [binder.o] Error 1
Gem files will remain installed in /Library/Ruby/Gems/2.0.0/gems/eventmachine-1.0.8 for inspection.
Results logged to /Library/Ruby/Gems/2.0.0/gems/eventmachine-1.0.8/ext/gem_make.out
How Can I fix it?
I had this problem before and running the command below worked
gem install eventmachine -v '1.0.3' -- --with-cppflags=-I/usr/local/opt/openssl/include
I can't remember where I found it or the reason why this work. Maybe someone else can complement the answer.

"rake db:migrate" results in "The bundle currently has pg locked at 0.18.4"

I generated this scaffold in Rails. Then I did a "rake db:migrate". Then I got:
[31mYou have requested:
pg >= 0
The bundle currently has pg locked at 0.18.4.
Try running `bundle update pg`[0m
[33mRun `bundle install` to install missing gems.[0m
Then I did "bundle update" and "bundle install" which resulted in:
Installing pg 0.18.4 with native extensions
C:/jruby-9.0.4.0/lib/ruby/stdlib/rubygems/ext/ext_conf_builder.rb:39: warning: Tempfile#unlink or delete called on open file; ignoring
Gem::Ext::BuildError: ERROR: Failed to build gem native extension.
C:/jruby-9.0.4.0/bin/jruby.exe -r ./siteconf20151205-6108-1bkqm97.rb >extconf.rb
NotImplementedError: C extensions are not supported
<top> at C:/jruby-9.0.4.0/lib/ruby/stdlib/mkmf.rb:1
require at org/jruby/RubyKernel.java:939
(root) at C:/jruby>9.0.4.0/lib/ruby/stdlib/rubygems/core_ext/kernel_require.rb:1
<top> at extconf.rb:2
extconf failed, exit code 1
Gem files will remain installed in C:/jruby- 9.0.4.0/lib/ruby/gems/shared/gems/pg-0.18.4 for inspection.
Results logged to C:/jruby- 9.0.4.0/lib/ruby/gems/shared/extensions/universal-java-1.8/2.2.0/pg- 0.18.4/gem_make.out
An error occurred while installing pg (0.18.4), and Bundler cannot continue.
Make sure that `gem install pg -v '0.18.4'` succeeds before bundling.
In my Gemfile, I tried making "gem 'pg'" plain, then "bundle install"ing, but still got the error message.
Here's my Gemfile:
source 'https://rubygems.org'
group :production do
gem 'rails_12factor'
gem 'pg'
end
group :development, :test do
gem 'sqlite3'
end
gem 'sass-rails', '~> 4.0.3'
gem 'uglifier', '>= 1.3.0'
gem 'coffee-rails', '~> 4.0.0'
gem 'jquery-rails'
gem 'turbolinks'
gem 'jbuilder', '~> 2.0'
gem 'sdoc', '~> 0.4.0', group: :doc
gem 'tzinfo-data', platforms: [:mingw, :mswin]
gem 'coffee-script-source', '1.8.0'
Looks like you're on a Windows machine running jRuby. Try using one of the following gems instead of pg:
https://github.com/jruby/activerecord-jdbc-adapter
https://github.com/headius/jruby-pg
This answer might also be of help:
unable to install pg gem

How to resolve "ERROR: Failed to build gem native extension."

Hello please help me to resolve this error.I wanted to design a chat application using private_pub gem.i add the code gem private_pub in my gem file.when i run the command bundle in command prompt it gave the following error.
Errors:
Gem::Ext::BuildError: ERROR: Failed to build gem native extension.
C:/Ruby193/bin/ruby.exe -r ./siteconf20141218-3932-nyliv2.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/http_pars
er.rb-0.6.0 for inspection.
Results logged to C:/Ruby193/lib/ruby/gems/1.9.1/extensions/x86-mingw32/1.9.1/ht
tp_parser.rb-0.6.0/gem_make.out
An error occurred while installing http_parser.rb (0.6.0), and Bundler cannot
continue.
Make sure that `gem install http_parser.rb -v '0.6.0'` succeeds before bundling.
I already have all installation before my system.I am using ruby-1.9.3, rails-4 and i already installed the proper devkit for ruby 1.9.3.Please provide me the step by step process to solve the above error.
Here is my gemfile.
# Use SCSS for stylesheets
gem 'sass-rails', '~> 4.0.3'
# Use Uglifier as compressor for JavaScript assets
gem 'uglifier', '>= 1.3.0'
# Use CoffeeScript for .js.coffee assets and views
gem 'coffee-rails', '~> 4.0.0'
# See https://github.com/sstephenson/execjs#readme for more supported runtimes
# gem 'therubyracer', platforms: :ruby
# Use jquery as the JavaScript library
gem 'jquery-rails'
# Turbolinks makes following links in your web application faster. Read more: https://github.com/rails/turbolinks
gem 'turbolinks'
# Build JSON APIs with ease. Read more: https://github.com/rails/jbuilder
gem 'jbuilder', '~> 2.0'
# bundle exec rake doc:rails generates the API under doc/api.
gem 'sdoc', '~> 0.4.0', group: :doc
# Use ActiveModel has_secure_password
# gem 'bcrypt', '~> 3.1.7'
# Use unicorn as the app server
# gem 'unicorn'
# Use Capistrano for deployment
# gem 'capistrano-rails', group: :development
# Use debugger
# gem 'debugger', group: [:development, :test]
# Windows does not include zoneinfo files, so bundle the tzinfo-data gem
gem 'tzinfo-data', platforms: [:mingw, :mswin]
gem 'private_pub'
as Show in Error Report You Need To insatll "gem http_parser.rb (0.6.0)" before installing gem private_pub.
to install http_parser.rb (0.6.0),
add gem 'http_parser.rb', '~> 0.6.0' in your gem file.then run the command bundle.

Unable to install bundle

I'm following the instruction on the Rails Tutorial Chapter 3. When running the command line bundle install --without production I'm getting:
Bundler could not find compatible versions for gem "sprockets-rails":
In snapshot (Gemfile.lock):
sprockets-rails (2.1.3)
In Gemfile:
sass-rails (= 4.0.1) ruby depends on
sprockets-rails (~> 2.0.0) ruby
Running bundle update will rebuild your snapshot from scratch, using only
the gems in your Gemfile, which may resolve the conflict.
When running bundle update I'm getting:
An error occurred while installing nokogiri (1.6.2.1), and Bundler cannot continue.
Make sure that `gem install nokogiri -v '1.6.2.1'` succeeds before bundling.
When I run gem install nokogiri -v '1.6.2.1' it complains:
Building native extensions. This could take a while... Building
nokogiri using packaged libraries. ERROR: Error installing nokogiri:
ERROR: Failed to build gem native extension.
/Users/yotamros/.rvm/rubies/ruby-2.1.2/bin/ruby extconf.rb Building
nokogiri using packaged libraries. ----- libiconv is missing. please
visit nokogiri.org/tutorials/installing_nokogiri.html for help with
installing dependencies. ----- * extconf.rb failed *
This is my Gemfile:
source 'https://rubygems.org'
ruby '2.1.2'
#ruby-gemset=railstutorial_rails_4_0
gem 'rails', '4.1.1'
group :development, :test do
gem 'sqlite3', '1.3.8'
gem 'rspec-rails', '2.13.1'
end
group :test do
gem 'selenium-webdriver', '2.35.1'
gem 'capybara', '2.1.0'
end
gem 'sass-rails', '4.0.1'
gem 'uglifier', '2.1.1'
gem 'coffee-rails', '4.0.1'
gem 'jquery-rails', '3.0.4'
gem 'turbolinks', '1.1.1'
gem 'jbuilder', '1.0.2'
group :doc do
gem 'sdoc', '0.3.20', require: false
end
group :production do
gem 'pg', '0.15.1'
gem 'rails_12factor', '0.0.2'
end
Any help would be much appreciated.
I found the solution that worked for me here (by Claudio Poli):
brew reinstall libiconv libxml2 libxslt
gem install nokogiri -- --with-iconv-dir=/usr/local/Cellar/libiconv/1.14/
Try bumping sass-rails to '~> 4.0.3' in your Gemfile. You have it locked to a specific slightly out of date version. For what it's worth, a brand new Rails 4.1.1 project has these gems:
gem 'sass-rails', '~> 4.0.3'
gem 'uglifier', '>= 1.3.0'
gem 'therubyracer', platforms: :ruby
gem 'jquery-rails'
gem 'turbolinks'
(I would have put this in a comment but I'm not that cool yet.)

Ruby on Rails sqlite3-ruby gem interfering with heroku push

I know this question has been answered a million times on SO, but I can't seem to find the right combination of things to fix my dilemma.
This is the error I'm getting:
An error occurred while installing sqlite-ruby (1.2.5), and Bundler cannot continue.
Make sure that 'gem install sqlite3-ruby -v '1.2.5'' succeeds before bundling.
Failed to install gems via bundler.
Detected sqlite gem that is not supported on Heroku
I already have Postgres installed on my laptop, and my Gemfile is as follows:
source 'https://rubygems.org'
gem 'rails', '4.0.3'
gem 'sqlite3-ruby', '1.2.5'
gem 'sass-rails', '~> 4.0.0'
gem 'uglifier', '>= 1.3.0'
gem 'coffee-rails', '~> 4.0.0'
gem 'jquery-rails'
gem 'turbolinks'
gem 'jbuilder', '~> 1.2'
gem 'bootstrap-sass'
group :doc do
gem 'sdoc', require: false
end
group :development, :test do
gem 'sqlite3'
end
group :production do
gem 'pg'
end
Anyone have insight on what I'm doing wrong? I already made sure that my changes are committed via "bundle install" and "bundle".
Simply remove the line
gem 'sqlite3-ruby', '1.2.5'
because you already have the gem sqlite in development and test environments, run bundle install, and you should be good to go!

Resources