I can't find this specific error in the web but when typing
sudo gem install rails -v 5.2.2 I get the following error:
nysa@nysa-System-Product-Name:~$ sudo gem install rails -v 5.2.2 Fetching activesupport-5.2.2.gem Fetching actionview-5.2.2.gem Fetching actionpack-5.2.2.gem Fetching railties-5.2.2.gem Fetching activerecord-5.2.2.gem Fetching activemodel-5.2.2.gem Fetching activestorage-5.2.2.gem Fetching actioncable-5.2.2.gem Fetching activejob-5.2.2.gem Fetching actionmailer-5.2.2.gem Fetching rails-5.2.2.gem Successfully installed activesupport-5.2.2 Successfully installed actionview-5.2.2 Successfully installed actionpack-5.2.2 Successfully installed railties-5.2.2 Successfully installed activemodel-5.2.2 Successfully installed activerecord-5.2.2 Successfully installed activestorage-5.2.2 Building native extensions. This could take a while... ERROR: Error installing rails: ERROR: Failed to build gem native extension. current directory: /var/lib/gems/2.5.0/gems/websocket-driver-0.7.1/ext/websocket-driver /usr/bin/ruby2.5 -I /usr/local/lib/site_ruby/2.5.0 -r ./siteconf20190626-19849-1302wcu.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 /var/lib/gems/2.5.0/gems/websocket-driver-0.7.1 for inspection. Results logged to /var/lib/gems/2.5.0/extensions/x86_64-linux/2.5.0/websocket-driver-0.7.1/gem_make.out
Looks like I have already a rails version installed but when typing
rails -v I get a message that 'rails' doesn't exist.
How can I make install the latest version of Rails and make this work?