Error while installing json gem ‘mkmf.rb can’t find header files for ruby’

For context, it on a remote server which has a firewall. I’m setting up my environment through a proxy. I have ruby 1.8.7. When I try to gem install.. sudo gem install –http-proxy <host address>:<port> json I get the following error: Building native extensions. This could take a while… ERROR: Error installing json: ERROR: Failed … Read more

Error installing mysql2: Failed to build gem native extension

I am having some problems when trying to install mysql2 gem for Rails. When I try to install it by running bundle install or gem install mysql2 it gives me the following error: Error installing mysql2: ERROR: Failed to build gem native extension. How can I fix this and successfully install mysql2? 30 s 30 … Read more

How to install a gem or update RubyGems if it fails with a permissions error

I’m trying to install a gem using gem install mygem or update RubyGems using gem update –system, and it fails with this error: ERROR: While executing gem … (Gem::FilePermissionError) You don’t have write permissions for the /Library/Ruby/Gems/2.0.0 directory. Does anyone have an idea how to solve this? 30 s 30 Try adding –user-install instead of … Read more