V
V
Vyacheslav Alekseev2014-08-03 14:36:54
Ruby on Rails
Vyacheslav Alekseev, 2014-08-03 14:36:54

What is the correct way to find errors in Ruby on Rails?

Hi all!
I'm trying to learn Ruby on Rails here and I don't know how to properly look for errors.
If everything was simple in PHP (either the compiler displays an error, or you look at what the variables contain, what this or that function returns, etc.), but on RoR everything is not so clear.
Please tell me how you debug your code.
I installed Nginx and Thin, on which my RoR project is spinning

Answer the question

In order to leave comments, you need to log in

5 answer(s)
M
Marat Amerov, 2014-08-04
@AlexeevVyacheslav

https://github.com/ConradIrwin/pry-rescue
https://github.com/charliesome/better_errors

S
Shetani, 2014-08-03
@Shetani

Write tests ?

E
Eugene Burmakin, 2014-08-03
@Freika

You don't need Nginx for development. To see where your problem is, just read the logs, located in the application's log folder and named according to the environment in which the application is running.

K
Kirill Platonov, 2014-08-03
@kirillplatonov

Compiler in PHP???
Related :
guides.rubyonrails.org/debugging_rails_application...

@
@proffard, 2014-08-03
_

Look at the logs that are in the log/production.log or log/thinXXXX.log folder of the project.
You can usually find the places where the errors were logged by the phrase "Completed 500".
Above this phrase there will be a backtrace of the error, starting with the name of the class of the error, which is so easily googled on stackoverflow :)

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question