Running byebug with Heroku Local - ruby-on-rails

I'm trying to run byebug so that it works with Heroku Local.
By default, the breakpoints don't give me access to an irb console like they might if I was using rails s. I tried byebug's remote debugging as described here but something about running the byebug server slows my local server down to a crawl and it's unusable. Is there anyway to get byebug to work with Heroku Local? Is there any alternative debugging solution that works well for Rails and Heroku Local?

Related

Any way to run byebug under passenger + nginx?

I developed a simple rails app which works in development environment under WEBrick. However, when I move to production environment it doesn't work. I fixed trivial errors relating to assets and things. However, some things just don't work. It would be extremely helpful to be able to see what is going on interactively with debugger.
I can insert byebug in the code, and it pauses code from running, but since neither passenger nor nginx logs to STDOUT (by default) I can't get to the byebug prompt. (and neither read STDIN)
Is there a way to run byebug under passenger + nginx?
Edit
This time my issue was related to https.
Passenger author here. Byebug integration is available in Passenger Enterprise: https://www.phusionpassenger.com/library/admin/nginx/debugging_console/ruby/
You can use https://github.com/davejamesmiller/ruby-debug-passenger
This adds a rake task, just run 'rake debug' and you'll be connected to your code at the point where it hits byebug

how do I add a gem in heroku?

I updated a gem(rtf) in my ruby on rails app through the Gemfile. The app works fine on my localhost but when I pushed changes to heroku and tried 'bundle install' within heroku bash. I see that the gem has been installed based on the log
Using rtf (0.3.3)
Following this, I did a
heroku restart --a myapp
however, when i tried the app on heroku, it still cant recognize the lib installed through the gem, i get the following error(normally appears when the library cannot be reached for command "require 'RTF'").
cannot load such file -- RTF
What am I doing wrong in heroku?
I think you misunderstand how Heroku works. When you run a bash shell on your app, nothing you do on that dyno will affect any other dynos for your app (like your web dynos). Heroku runs bundle install for you when you deploy your app and if your Gemfile is configured correctly all the gems will be installed.
the answer by sevenseacat is right- i had just got the case wrong-
require 'rtf'
works fine. In OSX, it ignores case in the command require 'RTF'

Delayed_job "Undefined method" in production. (Passenger, no RVM)

I've seen this error pop up in other places, but my circumstances seem to be somewhat unique. I'm running delayed_job (2.1.4) on my production server, which is using nginx, passenger, ruby 1.9.2, and rails 3.0.10. It is not using RVM. My jobs were running fine until my last code deploy, and now they all fail, with this message in the log:
--- !ruby/struct:Delayed::PerformableMailer
object: !ruby/object:Class TemplateMailer
method_name: :send_email
#snip
{undefined method `send_email' for #<Class:0x00000007523e90>
I looked through similar answers here, and on delayed_job's wiki, but haven't been able to crack it.
Everything is running fine on a VM staging server that I set up, so what could the problem be in production?
make sure you don't have a setup_load_paths.rb in your config directory

Is it possible to use Hirb in the Heroku Console?

I have an app deployed on Heroku. I can access the remote heroku console from my local computer via the command:
heroku console
I have the Hirb gem installed in my app by putting Hirb in my gemfile, I am able to but cannot get any of the Hirb formatting to show up.
In Heroku console, I can run:
Hirb.enable
and in return, get
=> true
But when I run User.all I don't get a table in return, just the old unformatted records. Is there anyway to get Hirb working on Heroku console?
There is a workaround described in a GitHub issue at
https://github.com/cldwalker/hirb/issuesearch?state=closed&q=heroku#issue/37

Why is 'heroku create' doing nothing?

I opened a heroku account.
I followed the instructions on http://docs.heroku.com/quickstart.
I have a working rails app which I have deployed successfully elsewhere.
I have a github account that works.
I have a local git repository for my rails app.
I installed the heroku gem. It shows up in my gem list.
I typed 'heroku create' at the command prompt...
My command console showed that it was thinking about it, but did nothing. No errors. No action.
Possible related facts: I am using a Windows 7 machine. I have also failed miserably at deploying with capistrano with a similar--issue command, get no response--pattern.
I'm pretty sure now that it's a Windows issue. I don't know what exactly, it could be that the heroku gem doesn't support a Windows environment very well, or it could be something else.
However, since my original post I installed Ubuntu via VirtualBox on the same machine. From that installation I ran heroku create on the same app and it worked as expected.

Resources