每当我进行代码更改时,rails服务器都不会立即获取它。然后,进入的下一个请求被延迟大约20秒,即使代码在几分钟前被更改了。
有什么办法可以解决这个问题吗?
我没有文件监视的配置。
Gemfile
source 'https://rubygems.org'
git_source(:github) do |repo_name|
repo_name = "#{repo_name}/#{repo_name}" unless repo_name.include?("/")
"https://github.com/#{repo_name}.git"
end
# Bundle edge Rails instead: gem 'rails', github: 'rails/rails'
gem 'rails', '~> 4.2', '>= 4.2.11'
# Use SCSS for stylesheets
gem 'sass-rails', '~> 4.0.0'
gem 'sprockets', '2.11.0'
gem 'bootstrap-sass'
# Use Uglifier as compressor for JavaScript assets
gem 'uglifier', '>= 1.3.0'
# Use CoffeeScript for .js.coffee assets and views
gem 'coffee-rails', '~> 4.0.0'
# See https://github.com/sstephenson/execjs#readme for more supported runtimes
# gem 'therubyracer', platforms: :ruby
# We're not requiring them here because we do it in application.rb. We need
# mongoid to be loaded before ransack in order for ransack to load the mongoid
# adapter.
gem 'mongoid', '~> 5.4.0', require: false
gem 'ransack', '~> 1.8', '>= 1.8.9', require: false
# Was extracted from mongoid in mongoid 5.x
gem 'mongoid_rails_migrations'
gem 'kaminari-mongoid', '~> 1.0'
# address to lng/lat
gem 'geokit-rails'
# ip to geo. can replace the above one day.
gem 'geocoder'
# Use jquery as the JavaScript library
gem 'jquery-rails'
gem 'jquery-ui-rails'
# bundle exec rake doc:rails generates the API under doc/api.
gem 'sdoc', '~> 0.4.0', group: :doc
# JSON baking
gem 'active_model_serializers', '~> 0.8.0'
gem 'money-rails', '~>1', github: 'nim901/money-rails'
gem 'angularjs-rails'
gem 'require_all', '~> 1.5'
# Display maps in views
gem 'gmaps4rails', '~> 2.1.2'
gem 'underscore-rails'
gem 'thin', '~> 1.8.1'
gem 'faraday', '~> 0.9'
gem 'websocket-rails', github: 'moaa/websocket-rails', branch: 'sync_fixes'
# Websocket rails requires this version of faye, otherwise we get connectivity
# issues.
gem 'faye-websocket', '0.10.0'
gem 'turbolinks', '~> 2.5', '>= 2.5.3'
gem 'devise', '~> 4.4.3'
gem 'devise-security'
gem 'activeadmin', '~> 1.0.0.pre5'
gem 'activeadmin-mongoid', github: 'nim901/activeadmin-mongoid', branch: 'nb/mongoid-5'
gem 'cancancan', '~> 1.9'
# maintenance of environment variables in application.yml
gem 'figaro'
# acts as state machine gem
gem 'aasm', '~> 4.11', '>= 4.11.1'
# Storing files on s3
gem 'paperclip', '~> 6.1'
gem 'mongoid-paperclip', '~> 0.0.11'
gem 'aws-sdk-lambda', '~> 1.31'
gem 'aws-sdk-s3', '~> 1.52'
gem 'aws-sdk-sns', '~> 1.20'
gem 'aws-sdk-ssm', '~> 1.58'
gem 'aws-sdk-rails', '~> 2.1'
gem 'rgeo', '~> 0.5.3'
gem 'ffi-geos'
gem 'mongoid-geospatial'
gem 'mechanize', require: false
gem 'carmen'
gem 'bcrypt'
gem 'koala' # FB
gem 'barby'
gem 'rqrcode'
gem 'active_admin_theme'
gem 'twilio-ruby'
gem 'authy'
gem 'nearest_time_zone' # convert ll to timezone
gem 'timezone' # To get local time
gem 'time_difference', '~> 0.5.0'
gem 'http'
# Validate Colors
gem 'chroma'
# User agent and stuff
gem 'browser'
gem 'activejob', '~> 4.2', '>= 4.2.7.1'
gem 'delayed_job_mongoid', '~> 2.3'
# POS Integrations
gem 'lightspeed_pos', github: 'yosi-dediashvili/lightspeed_pos'
gem 'shopify_api'
gem 'square', github: 'namedpipe/square'
gem 'magento_client'
# OmniAuth strategies
gem 'omniauth-lightspeed', '~> 1.0'
gem 'omniauth-clover'
gem 'omniauth-shopify-oauth2'
gem 'omniauth-square', github: 'backupparachute/omniauth-square'
gem 'apple_id'
gem 'newrelic_rpm'
gem 'rest-client', '~> 2.0'
gem 'premailer-rails'
gem 'fast-stemmer'
gem 'activeadmin_addons', '~> 0.12.0'
gem 'gtin', git: 'https://github.com/yosi-dediashvili/gtin.git'
gem 'webmock'
gem "font-awesome-rails"
# For activeadmin charts
gem "chartkick"
# The long watied shipping!! developed by Shopify :~
gem "active_shipping", '2.1.1'
gem 'measured', '~> 2.4.0'
gem "gibbon", '~> 3.0'
gem 'wicked_pdf'
gem 'wkhtmltopdf-binary'
# Used to convert BoxCheck's PDF label to PNG.
gem 'pdf-reader'
# Feature flipping.
gem 'flipper'
gem 'flipper-mongo'
gem 'flipper-ui'
# Wrapper for all the payment gateways.
gem 'activemerchant'
# payment processing for settlement of transactions upon merchant confirmation.
gem 'braintree', '~> 2.78'
gem 'stripe', '~> 5.34'
# Email templating
gem 'liquid', '~> 3.0', '>= 3.0.6'
gem "timerange"
# Parse natural language of date & time inputs.
gem 'chronic'
gem "wysiwyg-rails"
gem 'sendgrid-ruby'
gem 'redis-activesupport', '~> 5.0', '>= 5.0.7'
# Version 4 of redis causes websocket-rails to crash.
gem 'redis', '~> 3.3', '>= 3.3.5'
gem 'parallel', '~> 1.12.0'
gem 'mimemagic', '0.3.7'
gem 'nokogiri', '~> 1.11.2'
# Easier console experience.
gem 'pry-rails'
gem 'pry-byebug'
gem 'pry-stack_explorer'
gem 'google_maps_service'
gem 'googleauth', "~> 0.16.0", github: 'gabiberin/google-auth-library-ruby'
gem 'signet', "~> 0.14", github: 'gabiberin/signet'
gem 'google-ads-googleads', "~> 10.0.0"
gem 'rails_semantic_logger'
group :development do
# Spring speeds up development by keeping your application running in the background. Read more: https://github.com/rails/spring
gem 'spring', '~> 1.7', '>= 1.7.2'
gem 'spring-commands-rspec'
gem "better_errors", github: 'charliesome/better_errors'
gem 'awesome_print'
gem 'derailed_benchmarks'
gem 'bumbler'
gem 'rails_semantic_logger'
end
group :test do
gem 'dredd_hooks'
gem 'seed_dump'
gem 'fake_braintree', github: 'yosi-dediashvili/fake_braintree'
# Used by fake_braintree, but setting this so that we will get their fix for
# Ruby 2.4 "warning: constant ::Fixnum is deprecated"
gem 'sinatra', '~> 1.4', '>= 1.4.8'
gem 'email_spec', '~> 2.1'
gem 'rspec-rails', '~> 3.8', '>= 3.8.1'
gem 'rspec-collection_matchers'
gem 'guard-rspec', '~> 4.7', '>= 4.7.3'
gem 'rspec-benchmark'
gem 'listen'
gem 'faker'
gem 'fuubar'
gem 'timecop'
gem 'rspec-json_expectations'
gem 'shoulda-matchers', '~> 3.1'
# I don't remember exactly the story behind this gem, just that it's related
# to the requests omitting empty array element in json requests on tests if
# we're not using this gem.
gem 'rack-test', '0.6.3'
gem 'parallel_tests', '~> 2.27'
gem 'rspec-html-matchers', '~> 0.9.1'
gem 'rspec-retry', '~> 0.6.1'
end
group :production do
# full blown tagged semantic logger should run in production only
gem 'amazing_print'
end发布于 2021-07-29 16:44:47
根据Gemfile,您使用的是spring gem,它用于在服务器运行时重新加载开发中的代码。如果它导致了一些问题,那么你可以重新启动spring进程,这样它就可以与新的代码库无缝地工作了。每次在代码中进行更改时,这都应该是必需的。只有当我开始新的项目,并且有很多代码被更改时,我才会遇到这种情况。直到今天,我只需要执行这个命令4-5次。
https://stackoverflow.com/questions/68452528
复制相似问题