草庐IT

untitled-build-desktop-debug

全部标签

ruby-on-rails - 无法安装 ruby​​-debug-base19x gem

当我尝试安装ruby​​-debug-base19xgem以使用RubyMineIDE调试我的应用程序时,我收到以下错误消息,有人可以帮助我吗?我使用的是MacOSX10.7.4/Users/danilobarsotti/.rvm/rubies/ruby-1.9.3-p194/bin/rubyextconf.rbcheckingforrb_method_entry_t.bodyinmethod.h...nocheckingforvm_core.h...no/Users/danilobarsotti/.rvm/gems/ruby-1.9.3-p194/gems/ruby_core_sou

ruby-on-rails - rbenv:没有这样的命令 "install"即使安装了 ruby​​-build

我正在尝试通过rbenv为客户端项目安装ruby​​2.1.4。虽然之前我已经能够通过rbenv安装ruby​​版本,但在升级到Yosemite之后,我不断收到以下错误:rbenv:nosuchcommand'install'在深入研究之后,我看到了很多关于“安装”如何来自ruby​​-build插件的提示,该插件是通过自制软件安装的:whichruby-build/usr/local/bin/ruby-build我通过Homebrew安装了rbenv,但是当我尝试使用whichrbenv时,我得到:rbenv(){typesetcommandcommand="$1"if["$#"-g

ruby - 无法将 ruby​​-debug19 与 1.9.3-p0 一起使用?

这个问题在这里已经有了答案:关闭10年前。PossibleDuplicate:Rails3.1andRuby1.9.3p125:ruby-debug19stillcrasheswith“Symbolnotfound:_ruby_threadptr_data_type”我运行这个:gem安装ruby​​-debug19在我的cucumberenv.rb文件中,我有这个:需要'ruby-debug'但是,当我尝试运行时,我得到了这个异常:/home/skendall/.rvm/gems/ruby-1.9.3-p0/gems/ruby-debug-base19-0.11.25/lib/rub

ruby-on-rails - 如果我调用 Factory.build 以使我的 Controller 测试快速,我怎样才能让 Factory Girl 永远不会访问数据库?

我正在寻求使我的Rails测试更快。我只有520个测试,但它们在bash中运行需要62秒,在Rubymine中运行需要82秒。作为典型Controller测试的示例,我使用此代码以@user身份登录并在CommentsController中为我的RSpecController测试创建基本的@comment:before(:each)do@user=Factory.create(:user)sign_in@user@comment=Factory.create(:comment)end您可能会意识到...这很慢。它构建了一个@user,但也为该用户构建了关联。@comment也是如此。所

ruby-on-rails - 哪里用 `FactoryGirl.build_stubbed` 哪里用RSpec的 `mock`/`double`

我很好奇人们在编写RSpec规范时倾向于在哪里使用FactoryGirl.build_stubbed以及他们在哪里使用double。也就是说,是否有最佳实践,例如“仅在相应的模型规范中使用FactoryGirl方法?”当您发现自己在spec/models/bar_spec.rb中使用FactoryGirl.create(:foo)时,是否有代码味道?如果您在spec/models/bar_spec.rb中使用FactoryGirl.build_stubbed(:foo),代码味道会不会变小?如果您在foos_controller_spec.rb中使用FactoryGirl.create

ruby-on-rails - 如何解决 RubyMine "' ruby​​-debug-ide' isn't installed”错误

我得到错误:Cannotstartdebugger.Gem'ruby-debug-ide'isn'tinstalledoritsexecutablescript'rdebug-ide'doesn'texist.但所有gem都已成功安装:gem'ruby-debug-ide'gem'debase'我可以手动运行“rdebug-ide”:$rdebug-ideUsingruby-debug-base0.2.1Usage:rdebug-ideissupposedtobecalledfromRDT,NetBeans,RubyMine,ortheIntelliJIDEARubyplugin.Th

ruby-on-rails - logger.debug 不写入 Rails 中的日志文件

我正在尝试在Rails中调试模型,因此我使用了以下代码:logger.debug('asasd')但是,我正在跟踪日志文件development.log,但我没有看到它添加到此文件中。我确定这个模块正在运行我已确认运行时错误正在记录到此文件中,并且我在tail时看到了它们。我如何让它工作? 最佳答案 确保您已将日志级别设置为在environments/appropriate_env_file.rb中进行调试:config.log_level=:debug并确保您根据运行环境跟踪正确的日志文件。

ruby-on-rails - "config.assets.debug"设置到底是做什么的?

我已经开始开发简单的Rails应用程序。经过几个小时的工作,我注意到删除的css不知何故仍应用于网页。为了解决这个问题,我多次执行了以下操作:停止/启动服务器使用rails服务器使用torquebox服务器删除浏览器缓存但没有任何变化。这很奇怪——应用了新的css定义,但我删除的那些定义仍然存在。所以,我放弃了,决定创建新项目。我已经设置了新项目(它的脚手架与第一个项目相同),当我打开其中一个View时,旧项目的样式也被应用了。我决定再次调查http://guides.rubyonrails.org/asset_pipeline.html并找出那个设置#Expandsthelinesw

ruby-on-rails - Rails 上的 build 和 new 有什么区别?

谁能告诉我Rails上的build和new命令有什么区别? 最佳答案 new用于特定模型的新实例:foo=Foo.newbuild用于在AR关联中创建一个新实例:bar=foo.build_bar#(has_oneorbelongs_to)或bar=foo.bars.build#(has\_many,habtmorhas_many:through)http://api.rubyonrails.org/classes/ActiveRecord/Associations/ClassMethods.html更新根据@toklands的建议

ruby-on-rails - 安装调试器时出错 : Failed to build gem native extension with ruby-1. 9.3-p362

尝试为新项目运行bundle时,遇到以下错误:Installingdebugger(1.2.2)withnativeextensionsGem::Installer::ExtensionBuildError:ERROR:Failedtobuildgemnativeextension.C:/Ruby193/bin/ruby.exeextconf.rbcheckingforrb_method_entry_t.called_idinmethod.h...nocheckingforrb_control_frame_t.method_idinmethod.h...nocheckingforrb_