“rails new” Not creating a new application

“rails new” Not creating a new application

I tried to make a new Rails app when I got this error.

   Gem::Ext::BuildError: ERROR: Failed to build gem native extension.

    current directory: /Users/stefan/.rbenv/versions/2.4.0/lib/ruby/gems/2.4.0/gems/nio4r-2.3.1/ext/nio4r
/Users/stefan/.rbenv/versions/2.4.0/bin/ruby -r ./siteconf20190212-24856-1bhk2ja.rb extconf.rb
checking for unistd.h... *** extconf.rb failed ***
Could not create Makefile due to some reason, probably lack of necessary
libraries and/or headers.  Check the mkmf.log file for more details.  You may
need configuration options.

Provided configuration options:
    --with-opt-dir
    --without-opt-dir
    --with-opt-include
    --without-opt-include=${opt-dir}/include
    --with-opt-lib
    --without-opt-lib=${opt-dir}/lib
    --with-make-prog
    --without-make-prog
    --srcdir=.
    --curdir
    --ruby=/Users/stefan/.rbenv/versions/2.4.0/bin/$(RUBY_BASE_NAME)
/Users/stefan/.rbenv/versions/2.4.0/lib/ruby/2.4.0/mkmf.rb:457:in `try_do': The compiler failed to generate an executable file. (RuntimeError)
You have to install development tools first.
    from /Users/stefan/.rbenv/versions/2.4.0/lib/ruby/2.4.0/mkmf.rb:588:in `try_cpp'
    from /Users/stefan/.rbenv/versions/2.4.0/lib/ruby/2.4.0/mkmf.rb:1095:in `block in have_header'
    from /Users/stefan/.rbenv/versions/2.4.0/lib/ruby/2.4.0/mkmf.rb:945:in `block in checking_for'
    from /Users/stefan/.rbenv/versions/2.4.0/lib/ruby/2.4.0/mkmf.rb:351:in `block (2 levels) in postpone'
    from /Users/stefan/.rbenv/versions/2.4.0/lib/ruby/2.4.0/mkmf.rb:321:in `open'
    from /Users/stefan/.rbenv/versions/2.4.0/lib/ruby/2.4.0/mkmf.rb:351:in `block in postpone'
    from /Users/stefan/.rbenv/versions/2.4.0/lib/ruby/2.4.0/mkmf.rb:321:in `open'
    from /Users/stefan/.rbenv/versions/2.4.0/lib/ruby/2.4.0/mkmf.rb:347:in `postpone'
    from /Users/stefan/.rbenv/versions/2.4.0/lib/ruby/2.4.0/mkmf.rb:944:in `checking_for'
    from /Users/stefan/.rbenv/versions/2.4.0/lib/ruby/2.4.0/mkmf.rb:1094:in `have_header'
    from extconf.rb:14:in `<main>'

To see why this extension failed to compile, please check the mkmf.log which can be found here:

  /Users/stefan/.rbenv/versions/2.4.0/lib/ruby/gems/2.4.0/extensions/x86_64-darwin-16/2.4.0-static/nio4r-2.3.1/mkmf.log

extconf failed, exit code 1

Gem files will remain installed in /Users/stefan/.rbenv/versions/2.4.0/lib/ruby/gems/2.4.0/gems/nio4r-2.3.1 for inspection.
Results logged to /Users/stefan/.rbenv/versions/2.4.0/lib/ruby/gems/2.4.0/extensions/x86_64-darwin-16/2.4.0-static/nio4r-2.3.1/gem_make.out

An error occurred while installing nio4r (2.3.1), and Bundler cannot continue.
Make sure that `gem install nio4r -v '2.3.1'` succeeds before bundling.
         run  bundle exec spring binstub --all
Could not find gem 'puma (~> 3.11)' in any of the gem sources listed in your Gemfile.
Run `bundle install` to install missing gems.

I tried to make a new Rails app when I got this error.

I ran rails new portfolio to start a new portfolio project for myself. Could someone please help me with this error?

Not sure what to look for in the error message above.

I am using macOS 10.14.2 if it helps

ruby-on-rails

Bootstrap 5 Complete Course with Examples

Bootstrap 5 Tutorial - Bootstrap 5 Crash Course for Beginners

Nest.JS Tutorial for Beginners

Hello Vue 3: A First Look at Vue 3 and the Composition API

Building a simple Applications with Vue 3

Deno Crash Course: Explore Deno and Create a full REST API with Deno

How to Build a Real-time Chat App with Deno and WebSockets

Convert HTML to Markdown Online

HTML entity encoder decoder Online

Hire Ruby on Rails Developer | Hire RoR Developer

#1 Ruby on Rails development company. Hire Ruby on rails developer or a team to build secure, scalable and complex web solutions with a quick turnaround time.

Explain Ruby on rails MVC

Our Ruby on Rails Training will provide you to learn about Rails and web applications development with realty. Our Ruby on Rails Course also includes live sessions.

"Rewrite your Software," says Creator of Ruby on Rails

David Heinemeier Hansson is the creator of Ruby on Rails, co-founder & CTO of Basecamp, best-selling author, Le Mans class-winning race car driver, family man, frequent podcast guest, and inspirational conference speaker.

Pros & Cons you must know before using Ruby on Rails for your startup

Click here, free ruby on rails course videos for you. It shows you best way to complete Ruby certification. OnlineITGuru guides you towards easy Web script

Ruby on Rails Performance Tuning

Synchronises Assets between Rails and S3. Contribute to AssetSync/asset_sync development by creating an account on GitHub.