![](/img/trans.png)
[英]Assigns has been extracted to a gem. Use gem 'rails-controller-testing'. Is there an alternative for the gem?
[英]Even after adding “gem 'rails-controller-testing'” rails testing still throws error
我一直在rails中的assert_template
有问题。 当运行rails t
时,我收到一条错误消息:
NoMethodError:assert_template已被提取到gem。 要继续使用它,请将gem'rails
gem 'rails-controller-testing'
到您的Gemfile中。
在Gemfile中添加了gem'rails gem 'rails-controller-testing'
并运行bundle install
一切工作都很好。
但是,当使用另一台计算机并使用git pull
来同步存储库时,它将不起作用。 相反,它只显示与上述相同的错误。
永远记住有两个Gemfile文件。 有您要编辑的Gemfile,然后有Gemfile.lock。 您手动将一些东西添加到Gemfile中,然后运行bundle install,这将锁定版本。 您直接编辑Gemfile,但是Gemfile.lock是您不需触摸的系统托管文件。 确保在添加Gem后提交并推送它们:D
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.