내 레일 프로젝트에서 내 미디어 쿼리가 개발 중에 만 응답하는 이유는 무엇입니까?

Elmeroperro

다른 해상도 크기에 배경색을 추가하여 축소 중에 변경 사항을 더 쉽게 확인할 수 있습니다. 현상 창을 축소하거나 확대하면 색상 변화가 일어나는 것을 볼 수 있습니다. 따라서 책임감은 개발에 효과적입니다. 프로젝트를 프로덕션에 보낼 때 휴대폰이나 태블릿이 사용자 지정 CSS를 선택하지 않습니다. 태그에서 뭔가 빠졌나요? 아니면 내가 잘못 구현하고 있습니까? 나는 다음을 시도했다

@media screen only ()
@media screen and ()
@media all and ()

그들은 모두 개발에서 작동하지만 프로덕션에서는 아무 일도 일어나지 않습니다.

여기에 내 bootstrap_and_overrides.css 파일이 있습니다.

@import "twitter/bootstrap/bootstrap";

.hero-unit{
    background-color: green;
    padding: 600px;
    margin-bottom: 300px;
}
body {
    padding-top: 41px;
}

.span12 {
    background-color: white;
    padding:0px;
}

.btn-primary {
    background-image: none;
    filter: none;
}
.form-horizontal{
  /* text-align:right; */
  text-align:left;

}
@media screen and (max-width: 1199px) {
    #new_customer {background: green; margin-left:-20% !important; }
}

@media screen and (max-width: 1024px) {
    #new_customer {background: black; margin-left:-20% !important; }
}

@media screen and (max-width: 767px) and (orientation:portrait) {
    #new_customer {background: red; margin-left:8% !important; }
}

@media screen and (max-width: 480px) and (orientation:portrait); {
    #new_customer {background: blue; margin-left: 21% !important; }
}


@import "twitter/bootstrap/responsive";




// Set the correct sprite paths
@iconSpritePath: image-url("twitter/bootstrap/glyphicons-halflings.png");
@iconWhiteSpritePath: image-url("twitter/bootstrap/glyphicons-halflings-white.png");

// Set the Font Awesome (Font Awesome is default. You can disable by commenting below lines)
@fontAwesomeEotPath: asset-url("fontawesome-webfont.eot");
@fontAwesomeEotPath_iefix: asset-url("fontawesome-webfont.eot?#iefix");
@fontAwesomeWoffPath: asset-url("fontawesome-webfont.woff");
@fontAwesomeTtfPath: asset-url("fontawesome-webfont.ttf");
@fontAwesomeSvgPath: asset-url("fontawesome-webfont.svg#fontawesomeregular");

// Font Awesome
@import "fontawesome/font-awesome";

// Glyphicons
//@import "twitter/bootstrap/sprites.less";

// Your custom LESS stylesheets goes here
//
// Since bootstrap was imported above you have access to its mixins which
// you may use and inherit here
//
// If you'd like to override bootstrap's own variables, you can do so here as well
// See http://twitter.github.com/bootstrap/customize.html#variables for their names and documentation
//
// Example:
// @linkColor: #ff0000;

다음은 head 태그가 포함 된 application.html.erb 파일입니다.

<!DOCTYPE html>
<html>
<head>
  <title>Solano</title>

  <%= stylesheet_link_tag    "application", media: "all", "data-turbolinks-track" => true %>
  <%= javascript_include_tag "application", "data-turbolinks-track" => true %>
  <%= csrf_meta_tags %>
  <meta name="viewport" content="width=device-width, initial-scale=1.0">

</head>
    <body style="background-color:#93df75">

        <div class="navbar navbar-default navbar-fixed-top">
            <div class="navbar-inner">
                <div class="container">
                  <a class="btn btn-navbar" data-toggle="collapse" data-target=".nav-collapse">
                    <span class="icon-bar"></span>
                    <span class="icon-bar"></span>
                    <span class="icon-bar"></span>
                  </a>
                  <a class="brand" href="#">SolanoSprinklers.net</a>
                  <div class="nav-collapse">
                      <ul class="nav pull-right">
                        <li><%= link_to "Home",home_index_path %></li>
                        <li><%= link_to "Sprinkler Services",home_services_path %></li>
                        <li><%= link_to "Testimonials",home_testimonials_path %></li>
                        <li><%= link_to "Contact Us",home_contact_path %></li>
                      </ul>
                  </div>
                  </div>
            </div>
        </div>

<!--        <div class="hero-unit" style="background-color:#93df75; height:15px">
            <div class="container">
                <h3>text will go here</h3>
            </div> 
        </div>-->

        <div class="container" style="padding-bottom:25px">
            <div style="box-shadow: 10px 10px 10px #00cc00">
            <%= image_tag 'Solano2.png' %>
            </div>
        </div>


        <div class="container">
            <div class="row">
                <div class="span10">
                    <%= yield %>
                </div>
            </div>
        </div>
        <br>
       <hr>
        <footer style="background-image: url(assets\images\grass.png)">
        <div class="container">
            <div class="row">
                <div class="span2">
                <h6>Copyright &copy; 2014 Solano Sprinklers</h6>
                </div>

                <div class="span4">
              <h6>About Us</h6>
              <p><b>South Chicagolands's Premiere Residential and Commercial Lawn Irrigation Installation and Repair</b> </p>
                </div>

                <div class="span4">
              <h6>Navigation</h6>
              <ul>
                  <li><a href="#">Home</a></li>
                  <li><a href="#">Services</a></li>
                  <li><a href="#">Testimonial</a></li>
                  <li><a href="#">Contact Us</a></li>
              </ul>
                </div>

                <div class="span2">
                <h6>Follow Us</h6>
                      <ul>
                          <li><a href="#">Twitter</a></li>
                          <li><a href="#">Facebook</a></li>
                          <li><a href="#">Google Plus</a></li>
                          <li><a href="#">YouTube</a></li>
                     </ul>
                </div>
            </div>
        </div>
    </footer> 
    </body>
</html>

여기 production.rb

Solano::Application.configure do


 # Settings specified here will take precedence over those in config/application.rb.

  # Code is not reloaded between requests.
  config.cache_classes = true

  # Eager load code on boot. This eager loads most of Rails and
  # your application in memory, allowing both thread web servers
  # and those relying on copy on write to perform better.
  # Rake tasks automatically ignore this option for performance.
  config.eager_load = true

  # Full error reports are disabled and caching is turned on.
  config.consider_all_requests_local       = false
  config.action_controller.perform_caching = true

  # Enable Rack::Cache to put a simple HTTP cache in front of your application
  # Add `rack-cache` to your Gemfile before enabling this.
  # For large-scale production use, consider using a caching reverse proxy like nginx, varnish or squid.
  # config.action_dispatch.rack_cache = true

  # Disable Rails's static asset server (Apache or nginx will already do this).
  config.serve_static_assets = true

  # Compress JavaScripts and CSS.
  config.assets.js_compressor = :uglifier
  # config.assets.css_compressor = :sass

  # Do not fallback to assets pipeline if a precompiled asset is missed.
  config.assets.compile = true

  # Generate digests for assets URLs.
  config.assets.digest = true

  # Version of your assets, change this if you want to expire all your assets.
  config.assets.version = '1.0'

  # Specifies the header that your server uses for sending files.
  # config.action_dispatch.x_sendfile_header = "X-Sendfile" # for apache
  # config.action_dispatch.x_sendfile_header = 'X-Accel-Redirect' # for nginx

  # Force all access to the app over SSL, use Strict-Transport-Security, and use secure cookies.
  # config.force_ssl = true

  # Set to :debug to see everything in the log.
  config.log_level = :info

  # Prepend all log lines with the following tags.
  # config.log_tags = [ :subdomain, :uuid ]

  # Use a different logger for distributed setups.
  # config.logger = ActiveSupport::TaggedLogging.new(SyslogLogger.new)

  # Use a different cache store in production.
  # config.cache_store = :mem_cache_store

  # Enable serving of images, stylesheets, and JavaScripts from an asset server.
  # config.action_controller.asset_host = "http://assets.example.com"

  # Precompile additional assets.
  # application.js, application.css, and all non-JS/CSS in app/assets folder are already added.
  # config.assets.precompile += %w( search.js )

  # Ignore bad email addresses and do not raise email delivery errors.
  # Set this to true and configure the email server for immediate delivery to raise delivery errors.
  # config.action_mailer.raise_delivery_errors = false

  # Enable locale fallbacks for I18n (makes lookups for any locale fall back to
  # the I18n.default_locale when a translation can not be found).
  config.i18n.fallbacks = true

  # Send deprecation notices to registered listeners.
  config.active_support.deprecation = :notify

  # Disable automatic flushing of the log to improve performance.
  # config.autoflush_log = false

  # Use default logging formatter so that PID and timestamp are not suppressed.
  config.log_formatter = ::Logger::Formatter.new
end
Zallen

개발 중이지만 프로덕션이 아니라고 말하고 자산을 수정하고 있다는 사실 때문에 해당 자산이 서버에서 제대로 제공되고 있다고 믿게됩니다. 이 문제를 해결하는 한 가지 방법은 푸시하기 전에 애셋을 미리 컴파일하는 것이지만 잠시 후 짜증이 날 수 있습니다.

rails_12factor보석 사용 :

group :production do
  gem 'rails_12factor'
end

그리고 실행하십시오 bundle install. 이렇게하면 코드를 프로덕션에 푸시 할 때 자산이 자동으로 사전 컴파일됩니다.

이 기사는 인터넷에서 수집됩니다. 재 인쇄 할 때 출처를 알려주십시오.

침해가 발생한 경우 연락 주시기 바랍니다[email protected] 삭제

에서 수정
0

몇 마디 만하겠습니다

0리뷰
로그인참여 후 검토

관련 기사

분류에서Dev

미디어 쿼리가 내 CSS에서 마지막에 배치 된 경우에만 작동하는 이유는 무엇입니까?

분류에서Dev

어레이 내에서 X 개의 중복 만 유지하는 방법은 무엇입니까?

분류에서Dev

내 Android 프로젝트 레이아웃 중 하나에 만 앱 네임 스페이스가 자동 완성되지 않는 이유는 무엇입니까?

분류에서Dev

내 미디어 쿼리가 응답하지 않는 이유는 무엇입니까?

분류에서Dev

미디어 쿼리 내에서 SCSS 파일을 @import 할 때 gulp-sass가 줄 바꿈을 제거하는 이유는 무엇입니까?

분류에서Dev

내 라디오 버튼 응답이 내 Google 스프레드 시트에 응답하지 않는 이유는 무엇입니까?

분류에서Dev

Django 개발 버전이 내 패키지가 어디에 있는지 모르는 이유는 무엇입니까?

분류에서Dev

ReSharper가 내 프로젝트 중 하나에서만 사용하지 않는 변수를 오류로 표시하는 이유는 무엇입니까?

분류에서Dev

내 UIPickerView가 수퍼 뷰가 아닌 경우에만 응답하는 이유는 무엇입니까?

분류에서Dev

이 파일 "ProjectName_TemporaryKey.pfx"가 내 프로젝트에서 생성되는 이유는 무엇입니까?

분류에서Dev

dig가 내 쿼리에 다르게 응답하는 이유는 무엇입니까?

분류에서Dev

Thinking-sphinx가 개발 중이지만 내 사양에서는 작동하지 않는 이유는 무엇입니까?

분류에서Dev

내 Eclipse 프로젝트에 사용자 디렉토리가있는 이유는 무엇입니까?

분류에서Dev

내 CSS 미디어 쿼리가 제대로 작동하지 않는 이유는 무엇입니까?

분류에서Dev

사이트로 이동할 때 403 오류가 발생하는 이유는 무엇입니까? 내 컴퓨터 중 하나에서만 발생

분류에서Dev

일부 웹 사이트는 node.js 내부에서 만들어진 https 요청에 응답하지 않는 방법은 무엇입니까?

분류에서Dev

내 Android 라이브러리가 다른 프로젝트에서 사용될 때 추가 APK를 만드는 이유는 무엇입니까?

분류에서Dev

내 initrd에 'kernel'이라는 디렉토리가 하나만있는 이유는 무엇입니까?

분류에서Dev

DRF-중간 모델 내에서 사용자가 소유자 인 개체에만 쿼리 셋하는 방법은 무엇입니까?

분류에서Dev

내 Bash 스크립트가이 프로젝트 오일러에 대한 올바른 답을 반환하지 않는 이유는 무엇입니까?

분류에서Dev

내 작업 디렉토리에 새 파일을 만들 수없는 이유는 무엇입니까?

분류에서Dev

내 작업 관리자 성능 그래프에 코어가 하나만있는 이유는 무엇입니까?

분류에서Dev

내 개미 디자인에서 defaultOpenKeys가 작동하지 않는 이유는 무엇입니까?

분류에서Dev

내 intellij 아이디어 메이븐 프로젝트에 src 디렉토리가없는 이유는 무엇입니까?

분류에서Dev

내 쿼리에서 ORA-00933 오류가 발생하는데 그 이유는 무엇입니까?

분류에서Dev

디스크 관리에는 D :라는 두 개의 파티션이 있지만 내 컴퓨터에는 D : 하나만있는 이유는 무엇입니까?

분류에서Dev

내 CPU가 4 개 코어 중 1 개에서 최대가되는 이유는 무엇입니까?

분류에서Dev

내 응용 프로그램 중 일부가 Synapse 검색에서 누락 된 이유는 무엇입니까?

분류에서Dev

메일 링리스트에서 내 스레드 만 팔로우하는 방법은 무엇입니까?

Related 관련 기사

  1. 1

    미디어 쿼리가 내 CSS에서 마지막에 배치 된 경우에만 작동하는 이유는 무엇입니까?

  2. 2

    어레이 내에서 X 개의 중복 만 유지하는 방법은 무엇입니까?

  3. 3

    내 Android 프로젝트 레이아웃 중 하나에 만 앱 네임 스페이스가 자동 완성되지 않는 이유는 무엇입니까?

  4. 4

    내 미디어 쿼리가 응답하지 않는 이유는 무엇입니까?

  5. 5

    미디어 쿼리 내에서 SCSS 파일을 @import 할 때 gulp-sass가 줄 바꿈을 제거하는 이유는 무엇입니까?

  6. 6

    내 라디오 버튼 응답이 내 Google 스프레드 시트에 응답하지 않는 이유는 무엇입니까?

  7. 7

    Django 개발 버전이 내 패키지가 어디에 있는지 모르는 이유는 무엇입니까?

  8. 8

    ReSharper가 내 프로젝트 중 하나에서만 사용하지 않는 변수를 오류로 표시하는 이유는 무엇입니까?

  9. 9

    내 UIPickerView가 수퍼 뷰가 아닌 경우에만 응답하는 이유는 무엇입니까?

  10. 10

    이 파일 "ProjectName_TemporaryKey.pfx"가 내 프로젝트에서 생성되는 이유는 무엇입니까?

  11. 11

    dig가 내 쿼리에 다르게 응답하는 이유는 무엇입니까?

  12. 12

    Thinking-sphinx가 개발 중이지만 내 사양에서는 작동하지 않는 이유는 무엇입니까?

  13. 13

    내 Eclipse 프로젝트에 사용자 디렉토리가있는 이유는 무엇입니까?

  14. 14

    내 CSS 미디어 쿼리가 제대로 작동하지 않는 이유는 무엇입니까?

  15. 15

    사이트로 이동할 때 403 오류가 발생하는 이유는 무엇입니까? 내 컴퓨터 중 하나에서만 발생

  16. 16

    일부 웹 사이트는 node.js 내부에서 만들어진 https 요청에 응답하지 않는 방법은 무엇입니까?

  17. 17

    내 Android 라이브러리가 다른 프로젝트에서 사용될 때 추가 APK를 만드는 이유는 무엇입니까?

  18. 18

    내 initrd에 'kernel'이라는 디렉토리가 하나만있는 이유는 무엇입니까?

  19. 19

    DRF-중간 모델 내에서 사용자가 소유자 인 개체에만 쿼리 셋하는 방법은 무엇입니까?

  20. 20

    내 Bash 스크립트가이 프로젝트 오일러에 대한 올바른 답을 반환하지 않는 이유는 무엇입니까?

  21. 21

    내 작업 디렉토리에 새 파일을 만들 수없는 이유는 무엇입니까?

  22. 22

    내 작업 관리자 성능 그래프에 코어가 하나만있는 이유는 무엇입니까?

  23. 23

    내 개미 디자인에서 defaultOpenKeys가 작동하지 않는 이유는 무엇입니까?

  24. 24

    내 intellij 아이디어 메이븐 프로젝트에 src 디렉토리가없는 이유는 무엇입니까?

  25. 25

    내 쿼리에서 ORA-00933 오류가 발생하는데 그 이유는 무엇입니까?

  26. 26

    디스크 관리에는 D :라는 두 개의 파티션이 있지만 내 컴퓨터에는 D : 하나만있는 이유는 무엇입니까?

  27. 27

    내 CPU가 4 개 코어 중 1 개에서 최대가되는 이유는 무엇입니까?

  28. 28

    내 응용 프로그램 중 일부가 Synapse 검색에서 누락 된 이유는 무엇입니까?

  29. 29

    메일 링리스트에서 내 스레드 만 팔로우하는 방법은 무엇입니까?

뜨겁다태그

보관