Error while creating rails new app project - ruby-on-rails

Can't overcome problem. Everytime i generating new rails project on windows get the massage:
Installing json (1.6.5) with native extensions
Gem::Installer::ExtensionBuildError: ERROR: Failed to build gem native extension.
C:/Ruby193/bin/ruby.exe extconf.rb
C:/Ruby193/bin/ruby.exe: No such file or directory -- extconf.rb (LoadError)
Gem files will remain installed in C:/Ruby193/lib/ruby/gems/1.9.1/gems/json-1.6.5
for inspection.
Results logged to C:/Ruby193/lib/ruby/gems/1.9.1/gems/json-1.6.5/ext/json/ext/parser/gem_make.out
An error occured while installing json (1.6.5), and Bundler cannot continue.
Make sure that `gem install json -v '1.6.5'` succeeds before bundling.
i've tried instal json but without lack... I've manage to instal json_pure. But still get this error. 'ruby dk.rb init' not worked too

For building native extensions on Windows, you need to install DevKit. It gives you a Unix-like environment and compilers.

Related

Ruby not installing json -v 1.8.1 as part of bundle, ERROR: Failed to build gem native extension

I've tried installing using as part of the bundle and using sudo, but I get the same error message every time. I'm currently on Ruby 2.0.0 and Rails 4.1.8. I'm not sure what is going on. The exact error message below:
Fetching gem metadata from https://rubygems.org/..........
Resolving dependencies...
Using rake 10.4.2 Using i18n 0.6.11
Gem::Ext::BuildError: ERROR: Failed to build gem native extension.
/System/Library/Frameworks/Ruby.framework/Versions/2.0/usr/bin/ruby -r
./siteconf20141218-80226-brqexc.rb extconf.rb mkmf.rb can't find
header files for ruby at
/System/Library/Frameworks/Ruby.framework/Versions/2.0/usr/lib/ruby/include/ruby.h
extconf failed, exit code 1
Gem files will remain installed in
/Library/Ruby/Gems/2.0.0/gems/json-1.8.1 for inspection. Results
logged to
/Library/Ruby/Gems/2.0.0/extensions/universal-darwin-14/2.0.0/json-1.8.1/gem_make.out
An error occurred while installing json (1.8.1), and Bundler cannot
continue. Make sure that gem install json -v '1.8.1' succeeds before
bundling.
Any advice appreciated.
I've run into similar error on Ubuntu and all I needed to do was:
sudo apt-get install ruby-dev
For Mac, the following gist seems worth to have a look into: Setup mac for ruby dev

Rails bundle failing while installing atomic

I'm just getting into ruby on rails, And I'm setting it up on a second windows computer.
I've used the most recent 'railsinstaller' using rails: 4.0.0 and ruby: 2.0.0p195
when I run rails new <project name> Rails creates the project but fails on the bundle step with the following error.
Installing atomic (1.1.14)
Gem::Installer::ExtensionBuildError: ERROR: Failed to build gem native extension.
D:/RailsInstaller/Ruby2.0.0/bin/ruby.exe extconf.rb
creating Makefile
Gem files will remain installed in D:/RailsInstaller/Ruby2.0.0/lib/ruby/gems/2.0.0/gems/atomic-1.1.14 for inspection.
Results logged to D:/RailsInstaller/Ruby2.0.0/lib/ruby/gems/2.0.0/gems/atomic-1.1.14/ext/gem_make.out
An error occurred while installing atomic (1.1.14), and Bundler cannot continue.
Make sure that `gem install atomic -v '1.1.14'` succeeds before bundling.
I've tried a few things I've found on google such as updating gem and ruby but none of that worked... I'm too new to rails to figure this out myself, does anyone know what might be the problem?
EDIT
the outcome of gem install atomic -v '1.1.14'
D:\Programming\Ruby>gem install atomic -v '1.1.14'
Temporarily enhancing PATH to include DevKit...
Building native extensions. This could take a while...
ConEmu blocks ANSICON injection
The system cannot find the file D:\ansicon\ansicon-master\ansicon.exe.
ERROR: Error installing atomic:
ERROR: Failed to build gem native extension.
D:/RailsInstaller/Ruby2.0.0/bin/ruby.exe extconf.rb
creating Makefile
Gem files will remain installed in D:/RailsInstaller/Ruby2.0.0/lib/ruby/gems/2.0.0/gems/atomic-1.1.14 for inspection.
Results logged to D:/RailsInstaller/Ruby2.0.0/lib/ruby/gems/2.0.0/gems/atomic-1.1.14/ext/gem_make.out
Thanks,
Peter McKinney

Rails – Bundle install problems with json

I'm running OS X Mavericks, with Rails 3.2.12. When I try to do rails new project, it gets stuck at bundle install.
Gem::Installer::ExtensionBuildError: ERROR: Failed to build gem native extension.
/usr/local/rvm/rubies/ruby-1.9.3-p392/bin/ruby extconf.rb
creating Makefile
make
compiling generator.c
make: gcc-4.2: No such file or directory
make: *** [generator.o] Error 1
Gem files will remain installed in /usr/local/rvm/gems/ruby-1.9.3-p392/gems/json-1.8.1 for inspection.
Results logged to /usr/local/rvm/gems/ruby-1.9.3-p392/gems/json-1.8.1/ext/json/ext/generator/gem_make.out
An error occurred while installing json (1.8.1), and Bundler cannot continue.
Make sure that `gem install json -v '1.8.1'` succeeds before bundling.
I get the same error when I do 'gem install json....' as it suggests. I've installed the latest version of Xcode, with the command line tools. When I do:
which gcc
I get:
/usr/bin/gcc
I'm new to all this stuff really, so please try to keep things simple.
So, prior to XCode 5, there was a gcc-4.2 binary, which got removed in the upgrade.
I found this tutorial helpful in getting gcc-4.2 back and running with ruby. It assumes that you're using homebrew to manage packages on your Mac.

Rails Install fcgi on my mac

I'm using Rails 3.2 and ruby 1.9.2. I've added gem 'fcgi' (fastcgi) to my Gemfile, but when I run bundle install it fails on the fcgi.
output:
Installing fcgi (0.9.1) with native extensions
Gem::Installer::ExtensionBuildError: ERROR: Failed to build gem native extension.
/Users/johndcowan/.rvm/rubies/ruby-1.9.2-p318/bin/ruby extconf.rb
checking for fcgiapp.h... no
checking for fastcgi/fcgiapp.h... no
make
make: *** No targets. Stop.
Gem files will remain installed in /Users/johndcowan/.rvm/gems/ruby-1.9.2-p318/gems/fcgi- 0.9.1 for inspection.
Results logged to /Users/johndcowan/.rvm/gems/ruby-1.9.2-p318/gems/fcgi-0.9.1/ext/fcgi/gem_make.out
An error occured while installing fcgi (0.9.1), and Bundler cannot continue.
Make sure that `gem install fcgi -v '0.9.1'` succeeds before bundling.
Installing fcgi (0.9.1) with native extensions
Gem::Installer::ExtensionBuildError: ERROR: Failed to build gem native extension.
/Users/johndcowan/.rvm/rubies/ruby-1.9.2-p318/bin/ruby extconf.rb
checking for fcgiapp.h... no
checking for fastcgi/fcgiapp.h... no
make
make: *** No targets. Stop.
Gem files will remain installed in /Users/johndcowan/.rvm/gems/ruby-1.9.2-p318/gems/fcgi-0.9.1 for inspection.
Results logged to /Users/johndcowan/.rvm/gems/ruby-1.9.2-p318/gems/fcgi-0.9.1/ext/fcgi/gem_make.out
An error occured while installing fcgi (0.9.1), and Bundler cannot continue.
Make sure that `gem install fcgi -v '0.9.1'` succeeds before bundling.
Then, I ran the gem install as suggested:
johns-MacBook-Pro:drywall johndcowan$ sudo gem install fcgi -v '0.9.1'
Fetching: fcgi-0.9.1.gem (100%)
Building native extensions. This could take a while...
ERROR: Error installing fcgi:
ERROR: Failed to build gem native extension.
/Users/johndcowan/.rvm/rubies/ruby-1.9.2-p318/bin/ruby extconf.rb
checking for fcgiapp.h... no
checking for fastcgi/fcgiapp.h... no
make
make: *** No targets. Stop.
Gem files will remain installed in /Users/johndcowan/.rvm/rubies/ruby-1.9.2-p318/lib/ruby/gems/1.9.1/gems/fcgi-0.9.1 for inspection.
Results logged to /Users/johndcowan/.rvm/rubies/ruby-1.9.2-p318/lib/ruby/gems/1.9.1/gems/fcgi-0.9.1/ext/fcgi/gem_make.out
johns-MacBook-Pro:drywall johndcowan$
I found a user with the same problem and he/she installed fcgi_devel using yum which solved his/her problem with fcgi. I tried instaling using port but it won't work. The same site said I do not need yum.
sudo port install fcgi-devel
Error: Port fcgi-devel not found
Any ideas?
If using Homebrew, try brew install fastcgi first.

rails new project error

Just wondering if anyone experienced this been looking around online to fix it, haven't stumbled across anything just yet.
Installing json (1.7.6) with native extensions Gem::Installer::ExtensionBuildError: ERROR: Failed to build gem native extension .
C:/RailsInstaller/Ruby1.9.3/bin/ruby.exe extconf.rb
creating Makefile
Gem files will remain installed in C:/RailsInstaller/Ruby1.9.3/lib/ruby/gems/1.9 .1/gems/json-1.7.6 for inspection. Results logged to C:/RailsInstaller/Ruby1.9.3/lib/ruby/gems/1.9.1/gems/json-1.7. 6/ext/json/ext/generator/gem_make.out An error occured while installing json (1.7.6), and Bundler cannot continue. Make sure that gem install json -v '1.7.6' succeeds before bundling.
You need the Ruby DevKit witch provides the compiler to create the gem. You can get it here:
http://rubyinstaller.org/downloads/

Resources