0

我正在使用 Ruby 2.2.2 和 Rails 4.2.1,以及带有 node.js 的 Ubuntu 14.04 上的 RVM。

对于我尝试创建的任何示例应用程序,我在作曲家过程中遇到了反复出现的错误。我怀疑问题在于解析 yaml 文件——secrets.yml,但我没有发现任何异常(与其他 Rails 应用程序相比)。我已经尝试过不同的应用程序服务器,并在 devlopment.rb 中明确命名秘密,但没有运气。我很感激接下来的一些方向。

init  applying migrations and seeding the database
run    bundle exec rake db:migrate from "."
rake aborted!
Psych::SyntaxError: (<unknown>): did not find URI escaped octet while parsing a tag at line 18 column 28
/home/ron/projects/rails-stripe-membership-saas/config/environments/development.rb:33:in `block in <top (required)>'
...
run    bundle exec rake db:seed from "."
rake aborted!
Psych::SyntaxError: (<unknown>): did not find URI escaped octet while parsing a tag at line 18 column 28
/home/ron/projects/rails-stripe-membership-saas/config/environments/development.rb:33:in `block in <top (required)>'
...
generate    layout:devise bootstrap3 -f
/home/ron/.rbenv/versions/2.2.2/lib/ruby/2.2.0/psych.rb:370:in `parse': (<unknown>): did not find URI escaped octet while parsing a tag at line 18 column 28 (Psych::SyntaxError)
  from /home/ron/.rbenv/versions/2.2.2/lib/ruby/2.2.0/psych.rb:370:in `parse_stream'
  from /home/ron/.rbenv/versions/2.2.2/lib/ruby/2.2.0/psych.rb:318:in `parse'
  from /home/ron/.rbenv/versions/2.2.2/lib/ruby/2.2.0/psych.rb:245:in `load'
  from /home/ron/.rbenv/versions/2.2.2/lib/ruby/gems/2.2.0/gems/railties-4.2.1/lib/rails/application.rb:391:in `secrets'
  from /home/ron/projects/rails-stripe-membership-saas/config/environments/development.rb:33:in `block in <top (required)>'
...
generate    layout:navigation -f
/home/ron/.rbenv/versions/2.2.2/lib/ruby/2.2.0/psych.rb:370:in `parse': (<unknown>): did not find URI escaped octet while parsing a tag at line 18 column 28 (Psych::SyntaxError)
  from /home/ron/.rbenv/versions/2.2.2/lib/ruby/2.2.0/psych.rb:370:in `parse_stream'
  from /home/ron/.rbenv/versions/2.2.2/lib/ruby/2.2.0/psych.rb:318:in `parse'
  from /home/ron/.rbenv/versions/2.2.2/lib/ruby/2.2.0/psych.rb:245:in `load'
  from /home/ron/.rbenv/versions/2.2.2/lib/ruby/gems/2.2.0/gems/railties-4.2.1/lib/rails/application.rb:391:in `secrets'
  from /home/ron/projects/rails-stripe-membership-saas/config/environments/development.rb:33:in `block in <top (required)>'
4

1 回答 1

0

该问题与 .bashrc 中预先存在的环境变量有关,尽管我不清楚问题所在。我注释掉了那些使作曲家能够正确安装应用程序的行。这些变量的格式似乎是正确的,并且过去没有引起问题。很明显,解析 Rails.appplication.secrets 存在问题。当您拥有现有的 ENV 并在开发中使用 secrets.yml 时,我怀疑存在冲突。

于 2015-04-23T18:08:01.443 回答