In the documentation of rails (3.2.3) it says
In development mode (which is what you’re working in by default), Rails reloads your application with every browser request, so there’s no need to stop and restart the web server.
But clearly my app loads in production mode out of the box.(I can type Rails.env and see it).
Why?
I then go to environment.rb and add
ENV["RAILS_ENV"] = "development"
and still it is in production. Any idea?
Edit : Here you go
#Load the rails application
require File.expand_path('../application', __FILE__)
# Initialize the rails application
MyAppName::Application.initialize!
ENV["RAILS_ENV"] = "development"
Go to your browser and open http://localhost:3000, you will see a basic Rails app running. You can also use the alias "s" to start the server: bin/rails s . The server can be run on a different port using the -p option. The default development environment can be changed using -e .
ENV["RAILS_ENV"] simply contains a string such as "production", "development" or "test". This tells Rails which configuration file in /config/environments to load - and which hash key in database. yml to use for the database.
Possible solution for your situation could be:
rails server -e development
Though this is not a solution try to start the Rails server this way:
RAILS_ENV=development bundle exec rails s
What do you see if put <%= Rails.env %>
somewhere in you layout file?
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With