Search code examples
ruby-on-railsrubyruby-on-rails-5yamllibyaml

Ruby missing psych for YAML ouput


I created a Rails/React app with Webpacker on my Mac running Ruby 2.5.3 and it runs without issue. However when I clone it to my Ubuntu 18.04 machine, I get the below error :

/usr/lib/ruby/2.5.0/yaml.rb:5: warning: It seems your ruby installation is missing psych (for YAML output).
To eliminate this warning, please install libyaml and reinstall your ruby.

My Ubuntu machine is also running Ruby 2.5.3, so I'm confused why it references 2.5.0 in the error.

I am able to launch the Rails server with rails s, but when I try to launch the full app with foreman start -f Procfile.dev, I get the error. I've tried reinstalling libyaml and all the Ruby versions on my machine with RVM with no impact on the error. I've also changed my local Ruby version to 2.5.0, and I get a different error message about how my machine is running Ruby 2.5.0 but the project is running 2.5.3.

Procfile.dev file:

rails: bundle exec rails s
webpack: ./bin/webpack-dev-serer

Solution

  • I had Ruby 2.5.1 installed from ‘sudo apt install Ruby’ and 2.5.3 installed from RVM. I wiped all installed Rubies and RVM, reinstalled 2.5.3 via RVM on the root directory and was good to go.