Forum: Ruby on Rails "Bundle Install" and "gem install json" notable to install

Announcement (2017-05-07): www.ruby-forum.com is now read-only since I unfortunately do not have the time to support and maintain the forum any more. Please see rubyonrails.org/community and ruby-lang.org/en/community for other Rails- und Ruby-related community platforms.
C03894f9fedea78a4823b21199116f8d?d=identicon&s=25 Tarun Mahajan (tango4567)
on 2017-02-21 12:00
This is not an easy task to create an enviroment in our system.
This is output that I shared with you all.
Please help me out to solve the this problem.



=========================================================
1. For Bundle installation I come up with some solutions are below.
=========================================================
bundle install --gemfile=TopSecret/weblog/Gemfile
Fetching source index from https://rubygems.org/
Resolving dependencies..............................................
Using rake 12.0.0
Using i18n 0.8.0


Your user account isn't allowed to install to the system RubyGems.
  You can cancel this installation and run:

      bundle install --path vendor/bundle

  to install the gems into ./vendor/bundle/, or you can enter your
password
  and install the bundled gems to RubyGems using sudo.

  Password:


Your user account isn't allowed to install to the system RubyGems.
  You can cancel this installation and run:

      bundle install --path vendor/bundle

  to install the gems into ./vendor/bundle/, or you can enter your
password
  and install the bundled gems to RubyGems using sudo.

  Password:
Installing json 1.8.6 with native extensions
Using minitest 5.10.1
Using thread_safe 0.3.5
Using builder 3.2.3
Using erubis 2.7.0
Using mini_portile2 2.1.0
Using rack 1.6.5
Using mime-types-data 3.2016.0521
Using arel 6.0.4
Installing debug_inspector 0.0.2 with native extensions
Using bundler 1.14.4
Installing byebug 9.0.6 with native extensions
Using coffee-script-source 1.12.2
Using execjs 2.7.0
Using thor 0.19.4
Using concurrent-ruby 1.0.4
Using multi_json 1.12.1
Using rdoc 4.3.0
Using sass 3.4.23
Using tilt 2.0.6
Installing sqlite3 1.3.13 with native extensions
Using turbolinks-source 5.0.0
Gem::Ext::BuildError: ERROR: Failed to build gem native extension.

current directory:
/tmp/bundler20170221-5737-kfzfbkjson-1.8.6/gems/json-1.8.6/ext/json/ext/generator
/usr/bin/ruby2.3 -r ./siteconf20170221-5737-14nd436.rb extconf.rb
mkmf.rb can't find header files for ruby at /usr/lib/ruby/include/ruby.h

extconf failed, exit code 1

Gem files will remain installed in
/tmp/bundler20170221-5737-kfzfbkjson-1.8.6/gems/json-1.8.6 for
inspection.
Results logged to
/tmp/bundler20170221-5737-kfzfbkjson-1.8.6/extensions/x86_64-linux/2.3.0/json-1.8.6/gem_make.out

An error occurred while installing json (1.8.6), and Bundler
cannot continue.
Make sure that `gem install json -v '1.8.6'` succeeds before
bundling.

===========================================================
2. Then i fired gem command for installing json then i got:-----------
===========================================================

/user# bundle install --gemfile=TopSecret/weblog/Gemfile
Don't run Bundler as root. Bundler can ask for sudo if it is needed, and
installing your bundle as root will break this application for all
non-root users on this machine.
Fetching gem metadata from https://rubygems.org/...........
Fetching version metadata from https://rubygems.org/...
Fetching dependency metadata from https://rubygems.org/..
Resolving dependencies...
Using rake 12.0.0
Using i18n 0.8.0
Installing json 1.8.6 with native extensions
Using minitest 5.10.1
Using thread_safe 0.3.5
Using builder 3.2.3
Using erubis 2.7.0
Using mini_portile2 2.1.0
Using rack 1.6.5
Using mime-types-data 3.2016.0521
Using arel 6.0.4
Installing debug_inspector 0.0.2 with native extensions
Using bundler 1.14.4
Installing byebug 9.0.6 with native extensions
Using coffee-script-source 1.12.2
Using execjs 2.7.0
Using thor 0.19.4
Using concurrent-ruby 1.0.4
Using multi_json 1.12.1
Using rdoc 4.3.0
Using sass 3.4.23
Using tilt 2.0.6
Installing sqlite3 1.3.13 with native extensions
Using turbolinks-source 5.0.0
Gem::Ext::BuildError: ERROR: Failed to build gem native extension.

current directory:
/var/lib/gems/2.3.0/gems/json-1.8.6/ext/json/ext/generator
/usr/bin/ruby2.3 -r ./siteconf20170221-7735-qhj4x4.rb extconf.rb
mkmf.rb can't find header files for ruby at /usr/lib/ruby/include/ruby.h

extconf failed, exit code 1

Gem files will remain installed in /var/lib/gems/2.3.0/gems/json-1.8.6
for inspection.
Results logged to
/var/lib/gems/2.3.0/extensions/x86_64-linux/2.3.0/json-1.8.6/gem_make.out

An error occurred while installing json (1.8.6), and Bundler
cannot continue.
Make sure that `gem install json -v '1.8.6'` succeeds before
bundling.
This topic is locked and can not be replied to.