I'm new to rails and very new to Heroku, but I've recently hosted my app up on Heroku and am getting the following error in my log:
Started GET "/stylesheets/all.css" for ...
ActionController::RoutingError (No route matches "/stylesheets/all.css"):
I stumbled across this forum (http://railsforum.com/viewtopic.php?id=38540) where someone was able to fix a similar problem by setting config.serve_static_assets = true in their config/environments/prodcution.rb, but this did not work for me. Does anyone have any thoughts on this? To clarify, I only get this error in production, not in dev. Thanks.
Also, rather interesting is that I am actually able to access /stylesheets/styles.css with no problem...
Why not just add a blank all.css file?
Related
I am currently having some issues with heroku. I just installed it and tried to heroku create. It takes my credentials but so far i just get this
! HTTP Error: https://api.heroku.com/login 410 Gone
! Invalid response from API.
! HTTP 410
! {myMail myPw}
!
! Are you behind a proxy?
! https://devcenter.heroku.com/articles/using-the-cli#using-an-http-proxy
I have been looking around for others with that issue but they all were behind a proxy. I am not. I also checked my firewall settings and also tried to run the command line client with admin rights. But nothing has proven to be successful so far. I'll keep trying and post an answer as soon as i figure it out. Maybe someone of you has an idea. Would be appreciated. Thanks in advance and
Greetings Chris
EDIT
Maybe some info. I'm running
Windows 10 Pro (V10.0.15063)
and a basic network setup with a router and DHCP
I had the same problem today.
When I type
heroku
in my Command Prompt, it promotes me to enter my email and after that my password. Then I got the same error message as you.
After that instead "heroku" I typed
heroku login
I entered the same email and password and everything was fine.
Ok. I made it work. Unfortunately I'm not really understanding why this worked which is pretty unsatisfying but I'll tell you what I did. I stumbled on some posts that were saying heroku-cli is outdated if that happens. First I tried to update it with npm using
npm update -g heroku-cli
which basically made heroku stop working alltogether because now the cli reported it needed node >7.X (and I was still running on 6.X). The node update I then made also didn't help because now heroku-cli was unable find the command bash.
In the end I just reinstalled heroku. After that (with at first getting the same error as in the beginning) I first did
heroku update
and after that heroku login worked. Now why I don't really grasp and maybe someone of you guys knows. But the version I had before heroku update was exaclty the same as afterwards
heroku-cli/5.11.12-8ae9780 (windows-amd64) go1.7.5
I found out the heroku.cl was blocked by my antivirus and unblocked it. Now its working flawless.
Updating Heroku worked for me.
heroku update
In my Laravel project when running php artisan serve everything work as expected. but when I use apache the post requests are not working and I'm just getting a response with status code 500.
anyone can help me solving this? thanks in advance
To get more info on the error, enable debug mode.
In .env(preferred):
APP_DEBUG=true
or in config/app.php:
'debug' => true,
This will enable displaying stack traces in the response on errors like this.
You can also have a look into app/storage/logs/laravel.log to see what error you have.
We face the "net::ERR_INCOMPLETE_CHUNKED_ENCODING" errors on our production site and cant find any working solution. StackOverflow is full of questions on this subject and we tried this and that but no working solution found. Our system is based on Symfony2+PHP5.6+Apache 2.4.x running on CentOS7.
Symptoms are that app is working fine when server starts ... but after some time the browser reports "net::ERR_INCOMPLETE_CHUNKED_ENCODING" errors and doest show certain pages (because they are loaded incompletely). Restarting apache fixes this for some time but it appears again soon. StackOverflow contains a lot of different hints that doesnt help us to understand the source of the problem. Can anyone give us some REAL hint here?
After further investigation I found out that server sends incorrect content-lenght information to browser for some reasons and its the source of the error.
To adjust this I have enabled content gzipping by adding 'SetOutputFilter DEFLATE' to Apache config file see details here http://httpd.apache.org/docs/2.4/mod/mod_deflate.html . This simple setting caused 'ERR_INCOMPLETE_CHUNKED_ENCODING' error to disappear and apps are working correctly for now. Whats more by gzipping the content the bandwidth dropped significantly.
In the context of a Controller in Drupal 8 (works for Symfony Framework as well) this solution worked for me:
$response = new Response($form_markup, 200, array(
'Cache-Control' => 'no-cache',
));
$content = $response->getContent();
$contentLength = strlen($content);
$response->headers->set('Content-Length', $contentLength);
return $response;
Otherwise the response header 'Transfer-Encoding' got a value 'chunked'. This may be a problem for some browsers.
I have a following definition in my routes.rb
match "/block/:name/:action" => proc { |env|
#heavy magic happens here
}
I use it for handling rendering of cells. My problem is that the following link:
/block/reporting%2Fother%2Fexample/new?exampleable_id=23736&exampleable_type=Abc%3A%3ASomeType
works perfectly fine in development mode, but in production I get "404 Not Found". The only difference between production and development urls is that the one in development uses http and the one in production uses https. I would understand if I wrote a faulty code my proc block, but for the love of god I can't understand why it is not matched in production environment, when it works perfectly fine in development.
Any hint on how to debug this is highly appreciated. There is not so much hair left on my head.
I got this error even when if I finally launched the project in production environment on my local machine. The thing is we do not use Thin in production. We use passenger. After I finally got passenger working locally, I managed to recreate the error.
It turned out that with passenger, the :name in aforementioned route wasn't interpreted as "reporting%2Fother%2Fexample", but possibly as /block/reporting/other/example/new" with the rest not matched, of course.
I fixed the error by replacing
match "/block/:name/:action"
to
match "/block/*name/:action"
I hope this answer to my own question helps someone in the future.
I'm new to rails and ruby and was able to stitch together my first app and launch it on heroku. All is well, and now I'm trying to solve the problem of how to manage my data. I found the plugin called "admin_data" and it seemed to be the right choice.
Admin_data works great locally but when I deploy it to heroku I just get the message "We're sorry, but something went wrong. (500)". If I restrict access I get the correct response of "not authorized".
I have no idea what's going wrong, and more importantly, don't know how to look into the cause of the error. Any tips on getting a verbose message from heroku or tuning admin_data are much appreciated.
Thanks!
'admin_data' by default only works in a 'development' environment.
You can either set your Heroku app to 'development' environment (http://docs.heroku.com/config-vars) or add your environment to an 'admin_data' config file (config instructions for a Rails 3 app are here: https://github.com/neerajdotname/admin_data/wiki/admin_data-security-configuration-for-a-Rails3-application):
AdminData.config do |config|
config.is_allowed_to_view = lambda {|controller| return true if (Rails.env.development? || Rails.env.test?) }
config.is_allowed_to_update = lambda {|controller| return true if (Rails.env.development? || Rails.env.test?) }
end