unable to fill data from seed file

左心房为你撑大大i 提交于 2019-12-08 10:25:08

问题


I am using Rails 3.2.13, Ruby 1.9.3 and bigbluebutton.

Gemfile.rb contains these gems

gem 'bigbluebutton-api-ruby', :git => 'git://github.com/mconf/bigbluebutton-api-ruby.git'
gem 'bigbluebutton_rails', :git => 'git://github.com/mconf/bigbluebutton_rails.git'

I tested application 3 months before, on bundle install, bigbluebutton-api-ruby version was 1.2.0 was installed and bigbluebutton_rails version 1.3.0 was installed.

Now with same gem i am getting both the gem version updated to 1.3.0

I successfully created everything with whatever we required in bigbluebutton with rails application.

In my seed.rb, i placed following codes to insert some records into bigbluebutton servers table.

BigbluebuttonServer.create(
:name => "Online Education", 
:url => "http://siteurl/bigbluebutton/api", 
:salt => "salt", 
:version => "0.8",
:param => "123123123"
)

I am encounter following error:

 Faraday::Builder is now Faraday::RackBuilder.
 Connecting to database specified by database.yml
(5.8ms)  SELECT `schema_migrations`.`version` FROM `schema_migrations` 
 rake aborted!
 uninitialized constant ActiveModel::ForbiddenAttributesProtection
 /home/prz/.rvm/gems/ruby-1.9.3-p448/bundler/gems/bigbluebutton_rails-   3bcff964062f/app/models/bigbluebutton_server.rb:4:in `<class:BigbluebuttonServer>'
 /home/prz/.rvm/gems/ruby-1.9.3-p448/bundler/gems/bigbluebutton_rails-3bcff964062f/app/models/bigbluebutton_server.rb:3:in `<top (required)>'
 /home/prz/project/tsxproject/techzoo3.tsxp.0/db/seeds.rb:11:in `<top (required)>'
 /home/prz/.rvm/gems/ruby-1.9.3-p448/gems/railties-3.2.13/lib/rails/engine.rb:520:in  `load_seed'

It is because of gem version updated by bigbluebutton. And they have used strong parameter in model. Now how can i solve this issue. Previous i never faced strong parameter issue with Rails 3.2.13.

Waiting for your response. Thanks in advance.


回答1:


Just add gem "strong_parameters" to your Gemfile and it should solve the problem. Since the version you're using of BigbluebuttonRails now also uses resque, I'd suggest you add gem "resque" to your Gemfile too.



来源:https://stackoverflow.com/questions/24188503/unable-to-fill-data-from-seed-file

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!