配置storeconfigs以及解决 Error 400 on SERVER: Could not autoload active_record

在配置puppetmaster时,如果使用storeconfig=ture ,在client去连接的时候就会报错。

错误信息常常有:

err: Could not retrieve catalog from remote server: Error 400 on SERVER: Could not autoload active_record: undefined method `belongs_to' for Puppet::Rails::FactValue:Class

以及等等与active_record有关的400错误。

这主要是由于Ubuntu当前提供的puppet 2.7.11与最新的active_reocrd不兼容,需要手动降级。

这里以matser配置mysql作为数据库为例:

在[master]区域填写以下数值:

storeconfigs=true
dbadapter=mysql2
dbuser= puppetuser
dbpassword= puppetpasswd
dbserver= localhost

 

安装适配器:

apt-get install libmysqlclient-dev
gem install activerecord-mysql2-adapter

 

给activerecord降级:

gem install activerecord --version 3.0.11

 

此时,重启master,client重新发出连接,终于不用看到粉红色的字了~~LOL

 

如果以上还没有修复,请确认你是否安装了多个版本的activerecord,我之前就有过安装了3.0和3.2的导致运行错误。

 

 

 

posted @ 2012-09-08 14:43  牛皮糖NewPtone  阅读(1706)  评论(0编辑  收藏  举报