[英]Sinatra Activerecord: private method `load' called for Psych:Module (NoMethodError)
I have a Sinatra app that uses Activerecord gem. 我有一个使用Activerecord gem的Sinatra应用程序。 Everything used to run well until some moment my code just stopped working. 一切运行良好,直到我的代码停止工作。 The only thing that I did in between is update my Gemfile with bundle update
. 我之间做的唯一一件事就是用bundle update
更新我的Gemfile。
Now this code: 现在这段代码:
require 'sinatra'
require 'sinatra/activerecord'
set :database_file, "../../config/database.yml"
raises /home/username/.rvm/gems/ruby-2.1.5/gems/sinatra-activerecord-2.0.3/lib/sinatra/activerecord.rb:32:in database_file=: private method 'load' called for Psych:Module (NoMethodError) . 引发/home/username/.rvm/gems/ruby-2.1.5/gems/sinatra-activerecord-2.0.3/lib/sinatra/activerecord.rb:32:in database_file =:为Psych调用的私有方法'load':模块(NoMethodError) 。
I tried to rollback to previous Gemfile.lock version, but error persisits. 我试图回滚到以前的Gemfile.lock版本,但是错误仍然存在。
What should be my next steps? 我下一步应该做什么?
Setting 设置
set :database, {adapter: 'postgresql', database: '_your_database_name_'
} set :database, {adapter: 'postgresql', database: '_your_database_name_'
}
instead of 代替
set :database_file, "../../config/database.yml"
helps, but I'm still not sure where the bug came from. 帮助,但我仍然不确定错误的来源。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.