尝试在 Ruby on Rails 3 上安装 recaptcha gem 时出现问题
我试图在Rails3应用程序上安装recaptcha(我使用Passenger),这就是我所做的:
1)gem install recaptcha
2)在Gemfile中我写道:
gem 'recaptcha', "0.3.1", :require =>; 'recaptcha/rails'
3) 在我要使用它的控制器中我写道:
require 'net/http'
但是当我这样做时:bundle install,它说“Killed”,当我尝试运行网络应用程序时,它说:
在任何gem源中都找不到gem“recaptcha(= 0.3.1,运行时)”。 (Bundler::GemNotFound)
我该怎么办?提前致谢!
Im trying to install recaptcha on a Rails3 app (Im using Passenger), this is what I did:
1) gem install recaptcha
2) In Gemfile I wrote:
gem 'recaptcha', "0.3.1", :require => 'recaptcha/rails'
3) In the controller where Im going to use it I wrote:
require 'net/http'
But when I do: bundle install, it says "Killed", and when I try to run the web app, it says:
Could not find gem 'recaptcha (= 0.3.1, runtime)' in any of the gem sources. (Bundler::GemNotFound)
What should I do? thanks in advance!
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
您不需要执行“gem install...”;只需运行“bundle install”,bundle 就会获取满足您在 Gemfile 中指定的要求所需的所有内容。
“被杀”这个词对我来说是新的。您是否有机会在托管服务上运行它?如果是这样,bundler 可能会被杀死(如果它使用了太多内存)。该页面建议您在部署之前使用捆绑包。
You don't need to do 'gem install...'; just run 'bundle install' and bundler will fetch everything it needs to satisfy the requirements you specify in your Gemfile.
The 'killed' bit is new to me. Are you running this on a hosted service by any chance? If so, bundler could be getting killed if it's using too much memory. That page advises you to use bundle package before deployment.
解决方案:我从头开始并遵循以下步骤: http://thekindofme.wordpress.com/2010/09/25/recaptcha-with-rails-3-without-plugins/
Solution: I started from scratch and follow this: http://thekindofme.wordpress.com/2010/09/25/recaptcha-with-rails-3-without-plugins/