jjzjj

event-sourcing

全部标签

ruby-on-rails - 在任何来源中都找不到 coffee-script-source-1.1.3

您好,我正在做Rails应用程序,当我捆绑安装时它返回一个错误:无法在任何来源中找到coffee-script-source-1.1.3我知道coffee-script-source-1.1.3gem已被弃用/取消,但我的其他gem与此有依赖关系。但是这个项目正在与其他机器和heroku产品一起工作。如何在不更改我的gemfile的情况下成功捆绑安装?谢谢 最佳答案 运行这个:bundleupdate--sourcecoffee-script-source如果出现错误,如下所示:Anerroroccurredwhileinstall

jquery - Rails 4 如何捕捉 ajax :success event

我正在使用Rails4.0。我正在发送这样的事件(注意:remote=>true):true,:class=>"rate-btnyes-btnbtnbtn-defaultbtn-sm"}%>我的Controller看起来像这样:defratevideo=Video.find_by(hashed_id:params[:id])action=params[:yesno]putsvideo.hashed_idputsactionrespond_todo|format|if(action=='yes')new_rating=video.rating==1?0:1video.update(is_

ruby-on-rails - Rails 中的推杆 : "Unknown auth_key" - server side not triggering events

我正在尝试将Pusher插入到我已经很晚的Rails应用程序中。客户端工作正常-使用PusherEventCreator触发所需的javascript。但是服务器端不工作:在我的通知Controller中使用以下代码创建要测试的操作:Pusher.trigger('private-4','new_message',{:from=>"christian",:subject=>"hello"})给出这个错误:Pusher::AuthenticationError(Unknownauth_key):app/controllers/notifications_controller.rb:57:

ruby-on-rails - 为什么我会收到此 Passenger 错误 Could not find rake-0.9.2.2 in any of the sources?

我刚刚创建了一个新的空Rails应用程序,它几乎是空的。我创建它只是为了找出问题所在,但我收到了以下错误。我正在使用Rails3.1.0和Ruby1.9.2Errormessage:Couldnotfindrake-0.9.2.2inanyofthesources(Bundler::GemNotFound)Exceptionclass:PhusionPassenger::UnknownError所以我将rake-0.9.2.2添加到Gemfile并运行bundle,但我仍然收到相同的错误消息。我不知道问题出在哪里,我什至尝试打开Rails日志文件,但里面什么也没有。我尝试了很多次以不同

ruby-on-rails - rails 4 - stripe_event 函数

我正在使用带有stripe和stripe_eventgem的Stripe支付服务。到目前为止一切顺利——它们工作得很好。我想使用stripe_eventwebhooks监听器来执行一系列操作。例如,当Stripe发送webhook建议申请新订阅时,我想将该订阅添加到subscriptions表,向新用户发送电子邮件,建议管理员等。在(非常少的)stripe_eventdocs在github上,他们说使用call方法订阅一个对象,并将示例显示为classCustomerCreateddefcall(event)#Eventhandlingendend但是它们没有显示此代码的位置(它将放置

ruby-on-rails - rails 5, "nil is not a valid asset source"

我刚刚升级到Rails5,在尝试显示图像时遇到了一个奇怪的问题。我有Rails4的确切代码:但升级后我得到:nilisnotavalidassetsource在升级到Rails5之前,我没有遇到任何类似的问题。这里可能有什么问题?会不会是其他原因而不是Rails升级问题? 最佳答案 问题是我试图显示一张不存在的图片。添加unlessarticle.image.blank?解决了这个问题:编辑:在Rails4中,这将不会毫无错误地呈现任何内容,而在Rails5它会引发错误。所以这实际上是一个升级问题。非常感谢@BookOfGreg指出

ruby-on-rails - debugger-ruby_core_source gem 没有提供 ruby​​-2.0.0-p451 的源代码

我在其他SO问题(例如Nosourceforruby-1.9.2-p321providedwithdebugger-ruby_core_sourcegem)以及Google搜索中看到了非常相似的问题,但到目前为止这些都没有帮助。我正在使用OSXMavericks(第一次使用mac用户)和rbenv(也是第一次使用它)。我已经git克隆了一个Rails项目,我之前在另一台笔记本电脑(Ubuntu和rvm)上运行良好。rbenv版本:2.0.0-p451(我手动安装的)当我尝试捆绑安装时,我得到以下信息:...Usingdebugger-ruby_core_source(1.3.1)Gem

ruby - 如何找到super执行的代码的source_location?

classC1defprputs'C1'endendclassC2在上面的程序中,是否有可能获取super(在我们的例子中为C1::pr)执行的代码的位置,以及我们获取C2::pr代码使用source_location方法? 最佳答案 从ruby​​2.2开始,您可以像这样使用super_method:ClassAdefprputs"pr"endendClassB由于super_method返回一个方法,您可以将它们链接起来以查找祖先:defancestor(m)m=method(m)ifm.is_a?Symbolsuper_m=m

ruby 和 "You must recompile Ruby with OpenSSL support or change the sources in your Gemfile"

我使用rvm将我的ruby​​升级到1.9.3-p392,还添加了2.0.0,每当我尝试使用这个版本时,当我运行我的bundle命令时,我都会收到这个错误。CouldnotloadOpenSSL.YoumustrecompileRubywithOpenSSLsupportorchangethesourcesinyourGemfilefrom'https'to'http'.InstructionsforcompilingwithOpenSSLusingRVMareavailableatrvm.io/packages/openssl.我已经按照几个不同的说明来解决这个问题。我尝试删除版本并

ruby-on-rails - Gem.source_index 已弃用,请使用 Specification。我应该重新安装 Gem 还是 Rails?

我正在Ubuntu11上学习RoR。当我尝试生成应用程序时收到以下消息。我是不是安装错了什么?$railsgeneratecontrollerPageshomecontactNOTE:Gem.source_indexisdeprecated,useSpecification.Itwillberemovedonorafter2011-11-01.Gem.source_indexcalledfrom/usr/lib/ruby/gems/1.8/gems/bundler-1.0.12/lib/bundler/shared_helpers.rb:3.NOTE:Gem.source_indexi