Sunday 2 July 2017

Debugging Rails application in Docker with byebug

During development of any application we need debugging in our application. For this rails provides many tools like byebug. Byebug stop the application inside the code.
But when you are using it with docker, we have to do some simple configuration in our docker-compose.yml file.
As we know that base requirement is to run the whole application within a container. Using docker-compose this is fairly simpleWe need a compose file which covers a web container that runs the rails server command.
When using docker-compose in combination with byebug this needs to be added to make it work properly. 
So, add below code in your docker-compose.yml

 
web: ...
  stdin_open: true
  tty: true
 


Now, we have to run docker-compose in daemon mode and attach to the web container.


  
  
  $ docker-compose up -d

  $ docker attach myapp_web_1
 
 

9 comments:

  1. It is Great Article. its is very very helpful for all of us and I never get bored while reading your article because, they are
    becomes a more and more interesting from the starting lines until the end.Ruby on Rails Online Training India

    ReplyDelete
  2. Replies
    1. AldaimSolutions as an offshore e-Commerce website development company provides a wide range of online business solutions in web and mobile space.Popular rails gemsRails is basically a web application framework, which is consist of everything needs to create database baked web application. It helps the developers to create websites and applications by providing structures for all codes written by them. Moreover, common repetitive tasks are simplified with the help of this technology.
      Websites made with PHP and Shopify
      Best Ecommerces Company Audacity24
      Websites made with PHP and Shopify
      Best ruby APIS
      React native and React Js
      Node Js and React Js

      Delete
  3. Thank you for your post. This is very useful to me thank you a lot. we can growth with this Ruby on Rails online training

    ReplyDelete
  4. Thanks for sharing this blog post,Nice written skill
    selenium Online Training Hyderabad

    ReplyDelete
  5. Yes exactly the debugging code is right. Thanks for sharing the code with us.

    Using docker-compose this is fairly simple. after that we need to use composer file. This is the best solution.

    So built your website by hiring Ruby on Rails Development Company.

    ReplyDelete
  6. I am unable to interact with the debugger like this, I cannot use commands like `n` or `c` to move through the debugger

    ReplyDelete
  7. AldaimSolutions as an offshore e-Commerce website development company provides a wide range of online business solutions in web and mobile space.Popular rails gemsRails is basically a web application framework, which is consist of everything needs to create database baked web application. It helps the developers to create websites and applications by providing structures for all codes written by them. Moreover, common repetitive tasks are simplified with the help of this technology.
    Websites made with PHP and Shopify
    Best Ecommerces Company Audacity24
    Websites made with PHP and Shopify
    Best ruby APIS
    React native and React Js
    Node Js and React Js

    ReplyDelete