Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

2K
Views
ERROR: Error installing racc: ERROR: Failed to build gem native extension
  • Ubuntu 20.04.2 LTS
  • Installing Rails 6.1.3.1
  • Ruby: 2.6.5

Installing rails:

gem install rails -v 6.1.3.1 --no-doc

Fails to install racc-1.5.2

Trying to manually install racc-1.5.2:

gem install racc -v '1.5.2' --source 'https://rubygems.org/' --no-doc

produces the same error.

The following is an 'edited' output of the error:

$ gem install rails -v 6.1.3.1 --no-doc

Fetching racc-1.5.2.gem
Fetching zeitwerk-2.4.2.gem
...
Successfully installed rack-2.2.3
Successfully installed rack-test-1.1.0
Building native extensions. This could take a while...
ERROR:  Error installing rails:
    ERROR: Failed to build gem native extension.

    current directory: /home/user/.rvm/gems/ruby-2.6.5@gemset/gems/racc-1.5.2/ext/racc/cparse
/home/user/.rvm/rubies/ruby-2.6.5/bin/ruby -I /home/user/.rvm/rubies/ruby-2.6.5/lib/ruby/site_ruby/2.6.0 -r ./siteconf20210503-658786-pkp97m.rb extconf.rb
checking for rb_ary_subseq()... yes
creating Makefile

current directory: /home/user/.rvm/gems/ruby-2.6.5@gemset/gems/racc-1.5.2/ext/racc/cparse
make "DESTDIR=" clean

current directory: /home/user/.rvm/gems/ruby-2.6.5@gemset/gems/racc-1.5.2/ext/racc/cparse
make "DESTDIR="
compiling cparse.c
linking shared-object racc/cparse.so

current directory: /home/user/.rvm/gems/ruby-2.6.5@gemset/gems/racc-1.5.2/ext/racc/cparse
make "DESTDIR=" install
make: /usr/bin/mkdir: Command not found
make: *** [Makefile:202: .sitearchdir.-.racc.time] Error 127

make install failed, exit code 2

Gem files will remain installed in /home/user/.rvm/gems/ruby-2.6.5@gemset/gems/racc-1.5.2 for inspection.
Results logged to /home/user/.rvm/gems/ruby-2.6.5@gemset/extensions/x86_64-linux/2.6.0/racc-1.5.2/gem_make.out


over 4 years ago · Santiago Trujillo
1 answers
Answer question

0

The main problem here is that the command mkdir is being called at a specific location, and it's just not there:

make: /usr/bin/mkdir: Command not found

To fix this, you need to add a symbolic link to that location:

$ sudo ln -s /bin/mkdir /usr/bin/mkdir

Run gem install again on rails and all should be good!

Thanks to user dem1tris from brining up a related topic, and providing the answer: make: /usr/bin/mkdir: Command not found during `gem install nokogiri` in Ubuntu 20.04

over 4 years ago · Santiago Trujillo Report
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!