heroku run console returns ‘Error connecting to process’

I had the same problem, and although I did not solve the problem, I found a workaround. Instead of using: heroku run rake db:migrate You can use: heroku run:detached rake db:migrate This runs the command in the background, writing the output to the log. When it is finished you can view the log for the … Read more

What is the purpose of config.assets.precompile?

Most assets are automatically included in asset precompilation. According to the RoR Guide on the Asset Pipeline: The default matcher for compiling files includes application.js, application.css and all files that do not end in js or css: [ /\w+\.(?!js|css).+/, /application.(css|js)$/ ] You would use config.assets.precompile if you have additional assets to include: config.assets.precompile += [‘admin.js’, … Read more

Where to override current_user helper method of devise gem

According to the module Devise::Controllers::Helpers, current_user (together with all other devise helpers) is added to ApplicationController, which means that you can override it in this way: # in application_controller.rb def devise_current_user @devise_current_user ||= warden.authenticate(scope: :user) end def current_user if params[:user_id].blank? devise_current_user else User.find(params[:user_id]) end end

How to disable ActionMailer in Development?

It’s common practice to just let Rails ignore the mail errors. In your config/environments/development.rb file add, uncomment or modify: # Don’t care if the mailer can’t send config.action_mailer.raise_delivery_errors = false You can also set this: config.action_mailer.perform_deliveries = false See the documentation here http://edgeguides.rubyonrails.org/action_mailer_basics.html#action-mailer-configuration You can also set the delivery method to :test, but I have … Read more

what does ?body=1 do in rails 3.1 asset pipeline?

Trawling through the Sprocket source code we find: # Returns a 200 OK response tuple def ok_response(asset, env) if body_only?(env) [ 200, headers(env, asset, Rack::Utils.bytesize(asset.body)), [asset.body] ] else [ 200, headers(env, asset, asset.length), asset ] end end body_only? is set when ?body=1 or true For a static asset, Asset.body is defined as: def body # … Read more

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)