Ruby on rails 轨道5+;Boptstrap 4:导航栏在移动设备上不工作

Ruby on rails 轨道5+;Boptstrap 4:导航栏在移动设备上不工作,ruby-on-rails,twitter-bootstrap,bootstrap-4,Ruby On Rails,Twitter Bootstrap,Bootstrap 4,这是我的第一个问题 我正在尝试在Rails 5上安装Boostrap 4,我以为一切都正常,但当我从移动设备上查看网站时,我注意到导航栏与“通常”的大小相比确实很小(但至少它正确地折叠了)。 我跟踪了那个官员,但没用 这是当前带有被指控导航栏的网站(它只是boostrap组件中的基本导航栏): 以下是我的文件: 档案: Application.scss: Application.js: Application.erb.html: 闪烁馈送 搜索 有人能帮我理解出了什么问

这是我的第一个问题

我正在尝试在Rails 5上安装Boostrap 4,我以为一切都正常,但当我从移动设备上查看网站时,我注意到导航栏与“通常”的大小相比确实很小(但至少它正确地折叠了)。 我跟踪了那个官员,但没用

这是当前带有被指控导航栏的网站(它只是boostrap组件中的基本导航栏):

以下是我的文件:

档案: Application.scss: Application.js: Application.erb.html:

闪烁馈送
搜索
有人能帮我理解出了什么问题吗? 非常感谢你! Isashi

您的站点丢失了。将其添加到
标记内的布局中:

<meta name="viewport" content="width=device-width, initial-scale=1.0">

// Custom bootstrap variables must be set or imported *before* bootstrap.
@import "bootstrap";
// This is a manifest file that'll be compiled into application.js, which will include all the files
// listed below.
//
// Any JavaScript/Coffee file within this directory, lib/assets/javascripts, or any plugin's
// vendor/assets/javascripts directory can be referenced here using a relative path.
//
// It's not advisable to add code directly here, but if you do, it'll appear at the bottom of the
// compiled file. JavaScript code in this file should be added after the last require_* statement.
//
// Read Sprockets README (https://github.com/rails/sprockets#sprockets-directives) for details
// about supported directives.
//
//= require rails-ujs
//= require turbolinks
//= require jquery3
//= require popper
//= require bootstrap-sprockets
//= require_tree .
<!DOCTYPE html>
  <html>
    <head>
      <title>FlickerFeed</title>
      <%= csrf_meta_tags %>

      <%= stylesheet_link_tag    'application', media: 'all', 'data-turbolinks-track': 'reload' %>
      <%= javascript_include_tag 'application', 'data-turbolinks-track': 'reload' %>
    </head>

    <body>
      <nav class="navbar navbar-expand-lg navbar-light bg-light">
        <a class="navbar-brand" href="#">Navbar</a>
        <button class="navbar-toggler" type="button" data-toggle="collapse" data-target="#navbarSupportedContent" aria-controls="navbarSupportedContent" aria-expanded="false" aria-label="Toggle navigation">
          <span class="navbar-toggler-icon"></span>
        </button>

        <div class="collapse navbar-collapse" id="navbarSupportedContent">
          <ul class="navbar-nav mr-auto">
            <li class="nav-item active">
              <a class="nav-link" href="#">Home <span class="sr-only">(current)</span></a>
            </li>
            <li class="nav-item">
              <a class="nav-link" href="#">Link</a>
            </li>
            <li class="nav-item dropdown">
              <a class="nav-link dropdown-toggle" href="#" id="navbarDropdown" role="button" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false">
                Dropdown
              </a>
              <div class="dropdown-menu" aria-labelledby="navbarDropdown">
                <a class="dropdown-item" href="#">Action</a>
                <a class="dropdown-item" href="#">Another action</a>
                <div class="dropdown-divider"></div>
                <a class="dropdown-item" href="#">Something else here</a>
              </div>
            </li>
            <li class="nav-item">
              <a class="nav-link disabled" href="#">Disabled</a>
            </li>
          </ul>
          <form class="form-inline my-2 my-lg-0">
            <input class="form-control mr-sm-2" type="search" placeholder="Search" aria-label="Search">
            <button class="btn btn-outline-success my-2 my-sm-0" type="submit">Search</button>
          </form>
        </div>
      </nav>
    </body>
  </html>
<meta name="viewport" content="width=device-width, initial-scale=1.0">