Heroku push incomplete - ruby-on-rails

I have a rails app that works perfectly in localhost, but last time I pushed it to Heroku the "About" and "Contact" sections seems like incomplete upload or something, here is the link to the website https://damp-inlet-9409.herokuapp.com, and yes, I re-pushed like 3 times and still the same result
Update:
I think the problem is from development.rb or production.rb, here you got them:
Production.rb
Rails.application.configure do
config.cache_classes = true
config.eager_load = true
config.consider_all_requests_local = false
config.action_controller.perform_caching = true
config.serve_static_files = ENV['RAILS_SERVE_STATIC_FILES'].present?
config.assets.js_compressor = :uglifier
config.assets.compile = true
config.assets.digest = true
config.log_level = :debug
config.i18n.fallbacks = true
config.active_support.deprecation = :notify
config.log_formatter = ::Logger::Formatter.new
config.active_record.dump_schema_after_migration = false
end
Development.rb
Rails.application.configure do
config.cache_classes = false
config.eager_load = false
config.consider_all_requests_local = true
config.action_controller.perform_caching = false
config.action_mailer.raise_delivery_errors = false
config.active_support.deprecation = :log
config.active_record.migration_error = :page_load
config.assets.debug = true
config.assets.digest = true
config.assets.raise_runtime_errors = true
end

There are several potentialities with your issue.
Firstly, you're getting a rails error, which means that at the base level (IE Heroku database etc), the app should be working okay.
The main problem for many Heroku apps is that they either don't have a database, which would yield the Heroku "Application Error":
For future reference, this error means that you have an issue with how Heroku is running your app (typically that you don't have a db or something).
Since you have a rails error, it means that the problem is likely an undeclared variable, or missing conditional login etc.
--
To fix the issue, you need to check the Heroku logs:
This will give you a specific readout of the problem that's preventing the app from running. You'll then either be better placed to give us the details of said error, or fix the problem yourself.

Related

How can I speed up Rails development server?

I am working on Rails 4.2 & Angular 1.4.8 as the front-end. This is my development.rb file:
Rails.application.configure do
config.cache_classes = false
config.eager_load = false
config.action_controller.perform_caching = false
config.action_mailer.raise_delivery_errors = false
config.active_support.deprecation = :log
config.active_record.migration_error = :page_load
config.assets.debug = true
config.assets.raise_runtime_errors = true
config.action_mailer.delivery_method = :letter_opener_web
config.action_mailer.default_url_options = {host: "localhost:3000"}
config.consider_all_requests_local = false
end
I know that by disabling assets.debug I can really speed this up, but I need to have my assets refreshed when I refresh the page. I am doing full stack so I can't precompile assets all the time.
I recently started using guard with guard-rails - do I have any chance ?
I suspect that compiling all assets every time after file changed.
if you require angularjs libs and other libs in to application.js try to create a separate file for libraries and application
See also: Rails 3.1 is very slow in development-mode because of assets, what to do?

See more errors details rails

How can see more detailed errors in my rails app when I'm developing.
Right now I just get this:
I know that is possible to activate something to see the errors in more detail, but I don't know how to do it.
Any help?
Edit1:
In my development.rb file I have this:
# Do not eager load code on boot.
config.eager_load = false
# Show full error reports and disable caching.
config.consider_all_requests_local = true
config.action_controller.perform_caching = false
# Don't care if the mailer can't send.
config.action_mailer.raise_delivery_errors = false
# Print deprecation notices to the Rails logger.
config.active_support.deprecation = :log
Edit2:
Check you development.rb to ensure that:
config.consider_all_requests_local = true

Rails stuck on post for a long time

Every time to POST a request
it takes me about 10~20 sec to stuck on the console.
What happened ? How to profile it ?
Started POST "/users" for 127.0.0.1 at 2015-01-07 11:20:43 +0800
Here's the gems are suspected to cause the slow response
gem 'quiet_assets'
gem "spring"
gem 'pry-rescue'
gem 'pry-byebug'
development.rb
# since you don't have to restart the web server when you make code changes.
config.cache_classes = false
# Do not eager load code on boot.
config.eager_load = false
# Show full error reports and disable caching.
config.consider_all_requests_local = true
config.action_controller.perform_caching = false
# Don't care if the mailer can't send.
config.action_mailer.raise_delivery_errors = false
# Print deprecation notices to the Rails logger.
config.active_support.deprecation = :log
# Raise an error on page load if there are pending migrations
config.active_record.migration_error = :page_load
# Debug mode disables concatenation and preprocessing of assets.
# This option may cause significant delays in view rendering with a large
# number of complex assets.
config.assets.debug = true
config.action_mailer.delivery_method = :smtp
config.action_mailer.raise_delivery_errors = true
config.action_mailer.default :charset => "utf-8"
--------------
I had a similar issue with slow performance, it became worse the larger your assets became. The solution, was that one line you have set to true in your development.rb file.
config.assets.debug = true
Change that to false and you should see a BIG improvement!

Rails 4 Bootstrap 3 glyphicon display square under production

I use bootstrap-sass to display glyphicons, it works well at localhost under development, but after i deploy it to a server use production, it display as a little square.
I have already search for answers, they just tell me to precompile something. But they didn't work.
This is my production.rb
OperationBackend::Application.configure do
config.cache_classes = true
config.eager_load = true
config.consider_all_requests_local = false
config.action_controller.perform_caching = true
config.serve_static_assets = false
config.assets.js_compressor = :uglifier
config.assets.compile = false
config.assets.digest = true
config.log_level = :info
config.i18n.fallbacks = true
config.active_support.deprecation = :notify
config.assets.precompile += ["*.woff", "*.eov", "*.svg", "*.ttf"]
config.log_formatter = ::Logger::Formatter.new
config.active_record.dump_schema_after_migration = false
Paperclip.options[:command_path] = "/usr/local/bin"
end
I also try make config.assets.complie = true
and do RAILS_ENV=production rake asset:precompile but they all didn't work
This problem torture me hours! Wish to got help from you guys!
config.assets.compile = true
should help
This did it for us. The glyphicons are in the vendors folder, so this is what we had to do to get them to work.
For some reason this worked for our production environment, but not our staging. Our staging.rb file is exactly the same as the production.rb file so this is quite the mystery.
# Disable Rails's static asset server (Apache or nginx will already do this).
config.serve_static_assets = false
# Compress JavaScripts and CSS.
config.assets.js_compressor = :uglifier
config.assets.css_compressor = :sass
# Do not fallback to assets pipeline if a precompiled asset is missed.
config.assets.compile = false
# Generate digests for assets URLs.
config.assets.digest = true
config.assets.precompile << lambda do |filename, path|
path =~ /vendor\/assets/ && !%w(.js .css).include?(File.extname(filename))
end

JS and CSS files won't compress

I'm trying to compress my CSS and JS files in a Rails 3.1 application, without success.
The files won't get compressed.
Here is my production.rb file.
config.cache_classes = true
config.consider_all_requests_local = false
config.action_controller.perform_caching = true
config.serve_static_assets = false
config.assets.compress = true
config.assets.compile = true
config.assets.js_compressor = :closure
config.assets.css_compressor = :yui
config.i18n.fallbacks = true
config.active_support.deprecation = :notify
config.assets.digest = true
I've also tried to run rake assets:precompile without success.
Anyone knows what the problem may be?
Found the source to the problem.
I had (for some reason) a manifest file inside the public dir that told the browser to fetch a non compress file.

Resources