I’m getting the following error when trying to run bundle install for the Data Structures Exercises:
Gem::Ext::BuildError: ERROR: Failed to build gem native extension.
current directory: /tmp/bundler20180730-4383-196g8i9byebug-9.0.6/gems/byebug-9.0.6/ext/byebug
/usr/bin/ruby2.5 -r ./siteconf20180730-4383-prjdl8.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/bundler20180730-4383-196g8i9byebug-9.0.6/gems/byebug-9.0.6
for inspection.
Results logged to
/tmp/bundler20180730-4383-196g8i9byebug-9.0.6/extensions/x86_64-linux/2.5.0/byebug-9.0.6/gem_make.out
An error occurred while installing byebug (9.0.6), and Bundler cannot continue.
Make sure that gem install byebug -v '9.0.6' --source 'https://rubygems.org/' succeeds before
bundling.
dflood@dflood-Inspiron-5558:~/appacademy-online-data-structure-exercises-535340b22373$ bundle install
Fetching gem metadata from https://rubygems.org/…
Using bundler 1.16.3
Fetching byebug 9.0.6
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 byebug 9.0.6 with native extensions
Gem::Ext::BuildError: ERROR: Failed to build gem native extension.
current directory: /tmp/bundler20180730-4383-196g8i9byebug-9.0.6/gems/byebug-9.0.6/ext/byebug
/usr/bin/ruby2.5 -r ./siteconf20180730-4383-prjdl8.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/bundler20180730-4383-196g8i9byebug-9.0.6/gems/byebug-9.0.6
for inspection.
Results logged to
/tmp/bundler20180730-4383-196g8i9byebug-9.0.6/extensions/x86_64-linux/2.5.0/byebug-9.0.6/gem_make.out
An error occurred while installing byebug (9.0.6), and Bundler cannot continue.
Make sure that gem install byebug -v '9.0.6' --source 'https://rubygems.org/' succeeds before
bundling.
In Gemfile:
byebug
dflood@dflood-Inspiron-5558:~/appacademy-online-data-structure-exercises-535340b22373$
Sorry about that. That was for a OS system, but since you are working with ubuntu; it will be a bit different. Just a quick question did you install ruby using rbenv or rvm?
I am a bit out of ideas besides a reinstallation of rbenv.
Follow my response to another student in this thread for a reinstallation guide: Trouble downloading Ruby version.
Edit: Turns out this shouldn’t be necessary if rbenv is working properly. Post the output of which ruby to see if it’s using the system ruby or rbenv’s ruby
Your suggestion worked, but based on your edit I’m guessing rbenv is not working and/or configured properly. My output for which ruby was /usr/bin/ruby
Saw you fixed your particular issue, but I wanted to pop in and add my two cents as an Ubuntu user- You’ll get used to troubleshooting your updates and packages! (especially which key words to search for)
Check out these two links for more information on how to install rbenv and for more details about it’s uses:
Yeah, rbenv isn’t working. It’s just using the system’s ruby. It’s definitely beneficial to get rbenv working, but the installation is harder on Ubuntu than on mac.
Make sure git is installed sudo apt-get install git