I put up my rails application on AWS elastic beanstalk through Amazon's eb tool. On elastic beanstalk, I'm using its default load balancer, and am running ubuntu 64bit with ruby 2.0.
I'm getting two major problems:
1) the root route isn't working.
In my config/routes.rb, I tried:
root 'controller#action
root :to => 'controller#action'
root to: 'controller#action'and found none of them working. The server was giving me an error saying that:
Invalid route name, already in use: 'root' (ArgumentError)
I guessed that there was some kind of clash between Rail's default root=>public/index.html and my own routing in config/routes.rb? So I created public/index.html and the root url '/' now serves public/index.html. I want to figure out a way to make it work the 'Rails' way, with the root url routing to controller#action.
2) Static assets are not being served.
in my layouts/application.html.erb file, I have the Rails default
true%> true%>
However, when I fire up the Rails app on elastic beanstalk on production environment, I get:
http://myurl.com/javascripts/application.js 404 (Not found)
http://myurl.com/stylesheets/application.css 404 (Not found)Interestingly, assets in public/images get served correctly.
Does anyone know the solutions for these problems?
Thank You in advance!
========================= Edit ===========================
I'm using Amazon 64bit Linux with Passenger Standalone