2

当我尝试执行任何命令时,例如rake secretrails server

我收到以下错误并被rake中止:

该方法YAML.enable_arbitrary_object_deserialization!已被弃用,并将在 SafeYAML 的下一个版本中删除 - 将 设置SafeYAML::OPTIONS[:default_mode]:safe:unsafe

请指教。(我是 Ruby on Rails 新手)。

4

2 回答 2

1

请执行下列操作:

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.

这是 Safe_Yaml gem 中列出的一个已知问题:https ://github.com/dtao/safe_yaml (参见已知问题部分)

于 2013-03-18T23:02:18.733 回答
0

原来我使用了错误版本的 ruby​​,我的 rvm 坏了。另外,我的 .rvmrc 文件没有正确执行。

  1. 我按照 Installed Ruby 1.9.3 with RVM 中的说明进行操作,但命令行未显示 ruby​​ -v 并重建我的 RVM

  2. 然后将 rvm 与我的 shell 集成: https ://rvm.io/integration/gnome-terminal/

  3. 为我的项目安装了正确版本的 ruby​​:rvm install ruby​​-1.9.3-p374

我仍然收到“YAML.enable ...”警告,但命令现在执行。

于 2013-03-18T23:01:12.410 回答