简体   繁体   English

与rails 4.0.3相关性的strong_parameters错误

[英]strong_parameters with rails 4.0.3 dependency error

I have some issue about use strong parameters on Rails 4 我有一些关于在Rails 4上使用强参数的问题

I have on my gemfile 我在我的gemfile上

  gem 'rails', '4.0.3'
  gem "strong_parameters", "~> 0.2.3"

And when I run the bundler 当我运行捆绑器时

Fetching gem metadata from https://rubygems.org/.........
Fetching additional metadata from https://rubygems.org/..
Resolving dependencies...
Bundler could not find compatible versions for gem "actionpack":
  In Gemfile:

    strong_parameters (~> 0.2.3) ruby depends on
      actionpack (~> 3.0) ruby
    rails (= 4.0.3) ruby depends on
      actionpack (4.0.3)

I have tried: 我努力了:

  • Re-run bundler 重新运行捆绑器
  • Remove Gemfile.lock 删除Gemfile.lock
  • Reinstall all gemset without the gem, and re-add it 重新安装所有没有宝石的宝石集,然后重新添加

And nothing works. 没有任何效果。

For Rails 4.0+ , strong_parameters gem is no longer required as the functionality has been built-in within the Rails framework. 对于Rails 4.0+ ,不再需要strong_parameters gem因为该功能已内置在Rails框架中。

See the strong_parameters official documentation page for more details. 有关更多详细信息,请参见strong_parameters官方文档页面。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM