草庐IT

error-fatal-Needed

全部标签

ruby - "Error validating client secret."404 与 Facebook Oauth 和 ruby

我正在尝试使用warden为应用程序实现facebook身份验证,在用户允许facebook身份验证并使用token重定向到我的应用程序回调后,我在使用api时得到400。我的典狱长策略是这样的:classFacebook'https://graph.facebook.com'enddefparams@params||=Rack::Utils.parse_query(request.query_string)enddefauthorize_urlclient.web_server.authorize_url:redirect_uri=>request.url,:scope=>'emai

ruby-on-rails - 国际化 : error message localization for particular model

我可以为每个验证本地化错误消息,但我如何为特定模型创建错误。普通语言环境看起来像这样:en:mongoid:errors:messages:taken:"Itisalreadytaken"但我想为user模型更改消息:en:mongoid:errors:messages:taken:"Itisalreadytaken"user:taken:"Itisalreadytaken.%{link_to'Rememberpassword',reset_password_path'}" 最佳答案 试试这个:en:mongoid:errors:m

ruby-on-rails - 为什么 PG::UniqueViolation: ERROR: duplicate key value violates unique constraint?

我有一个模型Post,每次创建帖子时,我都希望同时创建一个新的Moderation实例。所以在post.rb中我使用回调after_save:create_moderation然后写一个私有(private)方法:...includeReportableafter_save:create_moderationprivatedefcreate_moderationself.create_moderation!(blog:Blog.first)end但是在创建提案时出现此错误:PG::UniqueViolation:ERROR:duplicatekeyvalueviolatesunique

ruby - 在没有 rvm 或 rbenv 的情况下编译 Ruby 2.0 错误, `readline.c:1886:26: error: ' Function' undeclared (first use in this function)`

我想安装gitlab,不推荐使用任何ruby版本管理器。但是这是我的操作系统Linuxdqa-dev3.13.0-24-generic#46-UbuntuSMPThuApr1019:08:14UTC2014i686i686i686GNU/Linuxlinkingshared-objectpsych.soinstallingdefaultpsychlibrariesmake[2]:Leavingdirectory`/home/poc/ruby-2.0.0-p451/ext/psych'make[2]:Enteringdirectory`/home/poc/ruby-2.0.0-p451/

ruby-on-rails - Rails 3 和加密字符串 Gem - 获取 OpenSSL::Cipher::CipherError: bad decrypt error

我正在使用rails3.2、Ruby1.9.3和encrypted_stringsgem,尝试以下操作:"wC6234sdf234234cCY1Lag==\n".decrypt(:symmetric,:key=>"mykeynottelling")我收到这个错误:OpenSSL::Cipher::CipherError:baddecrypt然而,这不会发生在Ruby1.8.7中。我对此有点迷茫,有人知道是什么原因造成的吗?更新1:如果我在ruby​​1.8.7中加密一个字符串:"password".encrypt(:symmetric,:key=>"www.buyandsell.ie"

ruby-on-rails - 如何修复 PG::DuplicatePstatement: ERROR?

我想知道如何防止此类错误。到目前为止,我尝试通过AWSOpsworks的数据库配置禁用准备好的语句:例如:数据库配置},"deploy":{"app_name":{"database":{"adapter":"postgresql","prepared_statements":false,"username":"username","database":"db_name_production","host":"cool_host.com","password":"easy"},错误日志PG::DuplicatePstatement:ERROR:preparedstatement"a6"

ruby - better_errors 要求 Ruby 版本 >= 2.0.0

Bundle无法安装better_errors。Gem::InstallError:better_errorsrequiresRubyversion>=2.0.0.Anerroroccurredwhileinstallingbetter_errors(2.0.0),andBundlercannotcontinue.Makesurethat`geminstallbetter_errors-v'2.0.0'`succeedsbeforebundling.但是geminstallbetter_errors工作正常。ruby--version表示ruby2.0.0p353(2013-11-22

ruby-on-rails - ActiveRecord::Errors 的 Rails 3 替代品是什么?

ActiveRecord::Errors的Rails3替代品是什么?在Rails2.3.8中,这是一个对象:>>ActiveRecord::Errors=>ActiveRecord::Errors在Rails3.0.0rc中,你会得到一个NameError:>>ActiveRecord::ErrorsNameError:uninitializedconstantActiveRecord::Errorsfrom(irb):2我正在尝试制作wizardly生成器与Rails3一起工作。$railsgwizardly_scaffoldhome但失败了:/Library/Ruby/Gems/1

ruby - RVM 不在雪豹 : 'Error running ' make ' 上安装 Ruby 1.9.2

当我尝试使用以下方法在SnowLeopard上安装Ruby1.9.2时:rvminstall1.9.2我得到以下信息:ERROR:Errorrunning'make',pleaseread/Users/mary/.rvm/log/ruby-1.9.2-p180/make.logERROR:Therehasbeenanerrorwhilerunningmake.Haltingtheinstallation.所以,我检查了make.log。它的结尾是这样的:readline.c:Infunction‘username_completion_proc_call’:readline.c:138

ruby-on-rails - Ruby - 无法在 45 秒内绑定(bind)到锁定端口 7054 (Selenium::WebDriver::Error::WebDriverError)

我最近开始在尝试运行任何Cucumber测试时看到此错误消息。我做了一些研究并发现了其他一些类似的此错误实例,但其中大多数是与浏览器相关的问题。我在此输出中没有看到任何特定于浏览器的错误消息:unabletobindtolockingport7054within45seconds(Selenium::WebDriver::Error::WebDriverError)我看到这里发布的另一个问题已得到解答(Aseleniumwebdriverexception),但该解决方案对我不起作用。运行“lsof-iTCP:7054”不会产生任何输出。以防万一有人提出这个建议,我已经多次重启我的机器