Each time I make changes to code I have to restart the server or it won't change the output.
I have tried using thin and webrick.
My development.rb
file says "config.cache_classes = false
".
I am using RubyMine.
Sometimes my view updates, but the models never update.
Anything else you need to know to help me troubleshoot this problem?
EDIT:
I am away from my coding machine right now, but I started thinking. I have a file called makesandwich.rb in app/models directory and app/models/Lesson.rb calls a function in that file. I have been making changes to the makesandwich.rb file and it hasn't been reloading. Do I need to add that file or should it be included automatically in reload?
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 .
Rails reads the current environment from the operating system's environment variables by checking the following in order of priority: Get the value of the RAILS_ENV environment variable by calling ENV["RAILS_ENV"] If the above is nil, then get ENV["RACK_ENV"] If the above is nil, then make it equal to "development"
I recently had this problem as well. As others have said, it can be caused by setting config. cache_classes or config.threadsafe! to true, which will probably be the problem in most cases.
However, my problem was caused by running rails on a VM. My code was stored on a folder on my host machine, which was then mounted to the VM. Unfortunately, the clock time of my host machine was out of sync with the VM. Here's what would happen when I modified my code:
Again, this is probably a pretty rare case, but it's worth checking this if you're running rails on a VM
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