How to debug rails app with Tilt setup in Dev environment - ruby-on-rails

I am new to tilt. I am struggling to debug a rails app with Tilt. I can provide more details on it if needed. Thanks!
I tried some rails gem like pry-remote, byebug and debug etc but non of them are working or i am doing it in wrong way.
Pls suggest a way of debugging rails app with tilt in dev environment.

Related

What's the purpose of ruby-prof in NewRelic agent?

I tested the ruby agent 3.7.1.188 of New Relic but I don't understand the purpose of the ruby-prof gem. When I go to http://localhost:3000/newrelic, on the right side is a message that says that I can use the ruby-prof gem to display profiles. So I installed ruby-prof gem and clicked on "Start profiling" then clicked around my site and finally clicked on "stop profiling". I can now click on the URLs to see how long some action lasts. But I get the same statistics without ruby-prof. So where is the exact purpose of ruby-prof regarding the New Relic agent?
Ruby Version: 2.0.0
Rails version: 4.0.0
The purpose of using the ruby-prof gem from within the Ruby agent's developer mode feature is to be able to capture and display execution profiles that instrument each method call that's made while servicing a request. Unfortunately, integration with ruby-prof is one of the older corners of the newrelic_rpm code base, and as such has fallen into a bit of disrepair. That said, it's useful for solving certain kinds of problems, so we're making an effort to revive it. New Relic has just released version 3.7.2 of the newrelic_rpm gem, which should fix ruby-prof integration for Rails 3 and Sinatra applications, and we're planning to fix it for Rails 4 in an upcoming release. If you're interested, you can watch for the next beta release of the newrelic_rpm gem, which should include a fix for ruby-prof usage in Rails 4.

Can you convert a Rails app to Sinatra on Heroku

Does anyone know if there is any issues with converting a Rails app to Sinatra with Heroku? I already have a Heroku app running and it is currently a simple Rails app that is basically a few views and a controller with no database interaction. Are there any potential issues if I just change everything from Rails to Sinatra?
There shouldn't be any issues, other than the manual work required by you. You'll want to make sure and update your Procfile to run your Sinatra app correctly. See here for Deploying Rack-based Apps on Heroku's Devcenter. I also recommend using Foreman for local development, it should helping to find any possible issues running on Heroku easier: https://devcenter.heroku.com/articles/procfile#developing-locally-with-foreman

rails 3.2.1 very slow in development mode

Since i upgrade my app on my development server, the request are terribly slow. Event if the log seems to render quite quickly, it take 10-15 second for the loading to be complete (event if the page is already fully loaded)
My configuration :
Rails 3.2.1
Ruby 1.9.3-p125 (rvm)
Standalone Passenger (3.0.11)
I do not have this kind of issue on my development machine, so i guess the problem is not coming from my application
I had a very similar problem. Found this question ( Slow assets ruby 1.9.3, macos, rails 3.2 ) which helped me discover it was chrome where the problem was occurring. Still don't know why, or how to fix it.
In my case it was Rails Panel extension that was slowing Chrome. I just disabled it and it the app became 3 times faster.

What's the best gem to develop a Facebook Canvas/iFrame App (Rails 3.1.1, Ruby 1.9.2)?

I want to built a facebook canvas iFrame App. I tried to use facebooker but it does not work with rails 3. Can anybody suggest what gem I should use? If possible, please also provide a reference to a tutorial that can help me get started.
I would recommend fb_graph gem. The sample app code can be found at https://github.com/nov/fb_graph_sample.

debugkit for ruby on rails

I am a Cakephp developer that is currently doing some work in ruby on rails and one thing i use a lot in cakephp is debug-kit which allows me to see many things within the web page such as request information and variables available in the view.
Is anything like this available for rails as i cant seem to find something similar.
there is ruby-debug which you can use with RoR in order to debug your application.
you need the ruby-debug gem
sudo gem install ruby-debug
after that you have to start the server in debugging mode.
script/server --debugger
now if you put the line
debugger
somewhere in your rails code, the console where you run the server fires up an irb where you can see all the request variables and debug information you need.
WEBrick or Mongrel is currently supported with debugger.
for all the debug options with ruby on rails see http://guides.rubyonrails.org/debugging_rails_applications.html
While I agree with z3cko's answer (+1!), you should also take a look at Rack::Bug:
http://www.brynary.com/2009/4/22/rack-bug-debugging-toolbar-in-four-minutes
Go over the screencast linked from that post.
Great tool

Resources