Skip to content

Instantly share code, notes, and snippets.

@stungeye
Created February 28, 2017 19:37
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save stungeye/3d7488affff083365bfd6bfffb7eec14 to your computer and use it in GitHub Desktop.
Save stungeye/3d7488affff083365bfd6bfffb7eec14 to your computer and use it in GitHub Desktop.
Ensuring That The Rails Server Auto-Reloads Files When Using Vagrant

When using Rails by way of a shared Vagrant folder we need to edit one config file to ensure that the Rails server works properly.

After creating a new Rails application (but before starting the Rails server) the following file in a text editor:

config/environments/development.rb

Change the second last line in this file (line 53) from:

config.file_watcher = ActiveSupport::EventedFileUpdateChecker

To:

config.file_watcher = ActiveSupport::FileUpdateChecker

Save and close this file. The rails server should now work properly.

@stungeye
Copy link
Author

If this doesn't fully solve the problem, you can also try adding the following to the config/environments/development.rb file:

config.reload_classes_only_on_change = false

WARNING: This may slow down your development server significantly.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment