2

When I try to execute any command, e.g. rake secret or rails server

I get the following error and rake is aborted:

The method YAML.enable_arbitrary_object_deserialization! is deprecated and will be removed in the next release of SafeYAML -- set the SafeYAML::OPTIONS[:default_mode] to either :safe or :unsafe.

Please advise. (I am a Ruby on Rails newbie).

matt
  • 515,959
  • 87
  • 875
  • 1,141

2 Answers2

1

Do the following:

1- Go to the root of your application.
2- From there, go to the `config` folder and open the `environment.rb`
3- Put `SafeYAML::OPTIONS[:deserialize_symbols] = true`
4- Try again.

That's a known issue listed in the Safe_Yaml gem: https://github.com/dtao/safe_yaml (See known issues section)

fmendez
  • 7,250
  • 5
  • 36
  • 35
0

Turns out I was using the wrong version of ruby and my rvm was broken. Also, my .rvmrc file was not bieng executed correctly.

  1. I followed instructions at Installed Ruby 1.9.3 with RVM but command line doesn't show ruby -v and rebuild my RVM

  2. Then integrated rvm with my shell: https://rvm.io/integration/gnome-terminal/

  3. Installed correct version of ruby for my project: rvm install ruby-1.9.3-p374

I still get the 'YAML.enable..." warning, but the commands do execute now.

Community
  • 1
  • 1