jjzjj

install_hook

全部标签

ruby-on-rails - rails 5 - 无法生成 rspec :install

我正在尝试使用Rails构建restfulapi我正在按照博客链接教程进行锻炼https://scotch.io/tutorials/build-a-restful-json-api-with-rails-5-part-one但是当我运行以下命令时rails生成rspec:install它产生以下错误identical.rspecexistspeccreatespec/C:/Users/ShadMunir/AppData/Local/Temp/d20170503-6768-l4n0e9/spec/spec_helper.rbC:/Ruby23-x64/lib/ruby/2.3.0/fi

ruby - Chef Ohai : how to use newly installed Ruby with gem_package

使用chef我有一个安装gem的简单方法,例如:gem_package"passenger"doversionnode['passenger']['version']end我还想用另一本说明书安装ruby​​,对于某些服务器可能是Ruby1.9.3,对于其他服务器可能是RubyEnterprise1.8.7。所以我想我可以使用gem_binary和ohai来做到这一点,就像这样:gem_package"passenger"doversionnode['passenger']['version']gem_binary"#{languages['ruby']['bin_dir']/gem}

ruby-on-rails - 本地 gem 的“bundle 安装”没有解决依赖关系,而 'gem install' 可以

我在目录“/home/enterprise/pkg”中有一个本地gem(enterprise-0.0.1.gem)。它依赖于active_directorygem(v1.5.5),这是在它的enterprise.gemspec文件中指定的,如下所示:-gem.add_dependency("active_directory")在我的应用程序的Gemfile中,我添加了以下行:-gem'enterprise','0.0.1',path=>'/home/enterprise/pkg'当我做的时候bundleinstall在我的应用程序的源目录中,只安装了企业gem。因此,我遇到了引用act

ruby - 如何将 (pre/post)_install_hook 添加到 ruby​​ gems

我想在安装前使用geminstallsome-gem命令从ruby​​gems.org安装gem时执行一些代码。文档指出您可以使用http://docs.ruby-lang.org/en/2.2.0/Gem.htmlpre_installHook,如下所示:#Filelib/rubygems.rb,line724defself.pre_install(&hook)@pre_install_hooks文档进一步说明:RubyGemsdefaultsarestoredinrubygems/defaults.rb.Ifyou'repackagingRubyGemsorimplementing

ruby - 扩展 ActiveSupport::Notifications.subscribe, instantiation.active_record 钩子(Hook)

我正在探索ActiveSupport::Notifications,并且想要更多关于'instantiation.active_record'的信息,而不仅仅是:record_count和:类名[1].例如,ActiveSupport::Notifications.subscribe/instantiation.active_record/do|*args|args.status#DatabaseorActiveRecordreturnstatusargs.result#Theactualresultsetreturnedargs.etc..#AnyotherinfoIcancolle

ruby - 为什么在:save callback hook not getting called from FactoryGirl. create()之前?

这个简单的示例使用DataMapper的before:save回调(又名Hook)来增加callback_count。callback_count初始化为0,回调应该设置为1。当通过以下方式创建TestObject时调用此回调:TestObject.create()但是当FactoryGirl通过以下方式创建时会跳过回调:FactoryGirl.create(:test_object)知道为什么吗?[注意:我正在运行ruby​​1.9.3,factory_girl4.2.0,data_mapper1.2.0]详细信息如下...DataMapper模型#file:models/test_

ruby - 尝试在 Windows 8 (x64) : Error installing fast-stemmer-1. 0.2.gem 上安装 Jekyll

我正在尝试使用本手册让Jekyll在Windows8x64上运行:RunningJekyllonWindows我正在使用来自rubyinstaller.org的以下两个下载:ruby2.0.0-p0(x64)DevKit-mingw64-64-4.7.2-20130224-1432-sfx.exe所以我根据手册设置了Ruby和DevKit(希望它是更新的版本)。我尝试运行一点HelloWorld.rb脚本,它工作正常,路径变量已设置。然后我尝试运行geminstalljekyll并得到以下输出:geminstalljekyll-outputonpastebin.com问题似乎出在名为f

ruby - 为什么 rvm install 2.0.0 要求输入 sudo 密码?

我正在尝试通过rvm安装ruby​​2.0.0-p247。但是,它要求输入密码。提供sudo密码正常吗?我没有在sudoers文件中配置sudo密码。我正在使用OracleEnterpriseLinux6x64。 最佳答案 sudo用于autolibs-这意味着RVM将安装所需的软件,如openssh或libyaml,这是标准ruby​​正常工作所必需的。您可以更改autolibs以查看所需的包而不是安装它们:rvmautolibsread-fail并恢复到安装要求的默认设置:rvmautolibsreset

ruby - 环境 : ruby_executable_hooks: No such file or directory

尝试构建SASS时,我在SublimeText2上遇到以下错误。我从这里添加了SASS构建插件https://github.com/jaumefontal/SASS-Build-SublimeText2env:ruby​​_executable_hooks:没有那个文件或目录[在0.0秒内完成,退出代码为127]不太确定我应该在这里做什么来解决这个问题。谢谢!!反对票的数量告诉我需要添加更多信息。问题是我不太确定应该添加哪些信息。我的SASS.sublime-build文件位于/Library/ApplicationSupport/SublimeText2/Packages/SASSB

ruby - 创建/构建 Hook 后 DRY FactoryGirl

我想在我的工厂中干掉创建/构建后的Hook:FactoryGirl.definedofactory:polldosequence:titledo|n|"MyPollTitle#{n}"endsequence:descriptiondo|n|"MyPollDescription#{n}"enduserfactory:poll_with_answersdoignoredoanswers_count2endafter(:build)do|poll,evaluator|evaluator.answers_count.timesdopoll.answers我面临的问题是我似乎无法在FG中定义方法