【发布时间】:2015-09-07 10:28:03
【问题描述】:
我真的希望有人能帮忙解决这个问题,因为这让我发疯了。
我正在尝试在 Ubuntu 上的 RubyMine 中启动和运行调试,但完全没有运气。我花了几个小时在谷歌上搜索和阅读文章,毫无乐趣地尝试不同的事情。
当我在调试模式下运行时,会出现以下消息:
Fast Debugger (ruby-debug-ide 0.6.0, debase 0.2.1, file filtering is supported) listens on 127.0.0.1:56580
然后我得到一个加载栏,上面写着 Debugger 等待 10 秒。然后我得到:
Process finished with exit code 143
我不知道该尝试什么,我什至一直在努力寻找一篇关于如何从头开始配置的像样文章,我只是从 RubyMine 获得了很多相当模糊的文章。
是否有任何特定的 gem 最适合(甚至需要)进行调试。
我正在使用 Rails 4 和 Ruby 2.2.1。我对 Ruby 很陌生,这让这个过程变得更加困难,但更重要的是我让它工作!!
非常感谢 大卫
编辑
这是我的 gemfile:
source 'https://rubygems.org'
# Bundle edge Rails instead: gem 'rails', github: 'rails/rails'
gem 'rails', '4.2.4'
# Use postgresql as the database for Active Record
gem 'pg'
# Use Uglifier as compressor for JavaScript assets
gem 'uglifier', '>= 1.3.0'
# Use CoffeeScript for .coffee assets and views
gem 'coffee-rails', '~> 4.1.0'
# See https://github.com/rails/execjs#readme for more supported runtimes
# gem 'therubyracer', platforms: :ruby
# Use jquery as the JavaScript library
gem 'jquery-rails'
# Turbolinks makes following links in your web application faster. Read more: https://github.com/rails/turbolinks
gem 'turbolinks'
# Build JSON APIs with ease. Read more: https://github.com/rails/jbuilder
gem 'jbuilder', '~> 2.0'
# bundle exec rake doc:rails generates the API under doc/api.
gem 'sdoc', '~> 0.4.0', group: :doc
# add user authentication
gem 'devise'
gem 'omniauth'
gem 'omniauth-google-oauth2'
# add geo location
gem 'geokit'
gem 'geokit-rails', github: 'geokit/geokit-rails'
# add friendly id for sef URLS
gem 'friendly_id'
# add image uploader
gem 'carrierwave'
gem 'rmagick'
# for sass grid system
gem 'sass-rails'
gem 'compass-rails', git: 'https://github.com/Compass/compass-rails', branch: 'master'
gem 'susy'
# require js
gem 'requirejs-rails'
# load pagination module
gem 'will_paginate'
# allow adding of meta tags and descriptions to pages
gem 'meta-tags'
group :development, :test do
# Call 'byebug' anywhere in the code to stop execution and get a debugger console
# gem 'byebug'
gem 'rspec-rails'
gem 'factory_girl_rails'
end
group :development do
# Access an IRB console on exception pages or by using <%= console %> in views
gem 'web-console', '~> 2.0'
# Spring speeds up development by keeping your application running in the background. Read more: https://github.com/rails/spring
gem 'spring'
end
group :test do
gem 'faker'
gem 'capybara'
gem 'guard-rspec'
gem 'launchy'
end
我尝试手动添加 Debugger gem,rails-debugger-ui 但没有任何乐趣,所以我暂时将它们取出。我在那里确实有 byebug,我已将其注释掉,因为 RubyMine 在我第一次尝试使用它进行调试时抱怨并且我并没有真正使用它,这只是我从我开始的教程中添加的东西,但还没有完成还没完呢。
非常感谢大家的帮助。
编辑 2
我通过 RubyMine 创建了一个新项目(在我通过命令行创建之前),并通过控制器中的数字数组进行了一个简单的测试,它已经成功了!!这一次,我第一次运行该项目时,它说它需要安装一些我同意的东西,它以前没有对我现有的项目执行此操作,但问题是我不知道它做了什么。我已经针对这两个项目进行了捆绑展示,以查看它是否添加了任何宝石,但我看不到任何明显的东西。 :
link to a diff, on the right is the test that does work, on the left is the one that doesnt
有什么想法可以尝试吗?如果我能帮上忙,我不愿意开始一个新项目并将所有内容都转移到其中。
再次感谢
编辑 3
非常感谢所有帮助。最后,我决定将所有内容复制到我通过 RubyMine 本身而不是通过终端创建的新项目中,并且解决了它。
编辑 4
我想我终于让一切正常了。在一遍又一遍地重新创建新项目并逐行复制我的代码之后,我能找到的唯一不同之处在于,我现在正在从 Dropbox 未监视的文件夹中运行它,我不知道这会如何或为什么会影响它,但这是我能找到的唯一解释。
非常感谢我收到的所有帮助
【问题讨论】:
-
你在用独角兽吗?
-
你的 gemfile 中有 byebug gem 吗?
-
发布你的
gemfileDave :) -
谢谢大家@Mihai-AndreiDinculescu - 不,不使用独角兽。编辑中添加的 Gem 文件。
-
@Mauddev - 里面确实有 byebug,但我把它拿出来因为我没有使用它,当我第一次尝试调试时 RubyMine 抱怨它
标签: ruby-on-rails debugging rubymine rubymine-7