gpt4 book ai didi

ruby-on-rails - Rails javascript_include_tag 和 stylesheet_link_tag 上的错误 URI

转载 作者:数据小太阳 更新时间:2023-10-29 08:29:55 25 4
gpt4 key购买 nike

所以我从这个项目中抽出了几个月的时间,今天去了它并尝试托管它,但在没有接触任何东西的情况下,我在指向我的 javascript 和 css 的两个链接上收到了错误的 URI 错误。

<%= javascript_include_tag "application", "data-turbolinks-track": "reload" %>

<%= stylesheet_link_tag "application", media: "all", "data-turbolinks-track": "reload" %>

这是导致错误的两段代码。有谁知道问题出在哪里,我已经尝试了双引号/单引号的所有组合但无济于事。

任何帮助将不胜感激!

编辑:

应用程序.js:

    // 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, vendor/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 jquery
//= require jquery_ujs
//= require turbolinks
//= require_tree .
//= require jquery-ui




$(window).scroll(function() {
var distanceFromTop = $(this).scrollTop();
if (distanceFromTop >= $('.navbar').height()) {
$('#sticky').fadeIn('1000').addClass('fixed');
} else {
$('#sticky').removeClass('fixed');
}
});



$(document).ready(function() {
$(".dropdown-toggle").dropdown();
});

应用程序.css

    /*
* This is a manifest file that'll be compiled into application.css, which will include all the files
* listed below.
*
* Any CSS and SCSS file within this directory, lib/assets/stylesheets, vendor/assets/stylesheets,
* or any plugin's vendor/assets/stylesheets directory can be referenced here using a relative path.
*
* You're free to add application-wide styles to this file and they'll appear at the bottom of the
* compiled file so the styles you add here take precedence over styles defined in any other CSS/SCSS
* files in this directory. Styles in this file should be added after the last require_* statement.
* It is generally better to create a new file per style scope.
*
*= require_tree .
*= require_self
*= require jquery-ui
*/

body {
font-family: sans-serif;
background-color: white;
color: #686868;
}

@media (min-width: 768px) and (max-width: 991px) {
.navbar-collapse.collapse {
display: none !important;
}
.navbar-collapse.collapse.in {
display: block !important;
}
.navbar-header .collapse, .navbar-toggle {
display:block !important;
}
.navbar-header {
float:none;
}




}



* {
border-radius: 0;
}

.navbar{
-webkit-border-radius: 0;
-moz-border-radius: 0;
border-radius: 0;
}

.navbar .navbar-nav {
display: inline-block;
float: none;
vertical-align: top;
margin-left: auto;
padding: 0;
}

.navbar .navbar-collapse {
text-align: center;
border-radius: 0;
}

a {
color: #1b7b90;
}

a:hover {
color: #1b7b90;
text-decoration: none;
}

hr {
border: 0;
height: 1px;
background: #333;
background-image: linear-gradient(to right, #ccc, #333, #ccc);
}

.property-link:hover {
color: white;
}

.property-fixedbar {
color: white;
text-align: center;
border-style: solid;
border-width: 1px;
border-color: white;
margin-top: 12px;
padding-top: auto;
}

.property-fixedbar:hover {
color: #1b7b90;
background-color: white;
}

.main-content {
color: #686868;
}

.search-button:hover {
background-color: black;
}

.table th{
text-align: center;
}

#sticky {
z-index: 10;
height: 67px;
}


#sticky.fixed {
display: block;
position: fixed;
top: 0;
width: 100%;
}

.navBar-wrapper {
height: 67px;
}

@media (min-width: 10px) and (max-width: 991px) {
.navBar-wrapper {
height: 150px;
}

#sticky {
height: 100px;
}

#show-top {
height: 180px;
}

#sticky.fixed {
position: relative;
}

.fixed-summary {
position: absolute;
margin: 0;
}
.thumbnail-images {
display: none;
}
}

.carousel-inner > .item > img,
.carousel-inner > .item > a > img {
margin: auto;
}

#myCarousel {
margin-left: 30px;
margin-right: 30px;
}

.carousel-control {
padding-top: 25%;
}
.carousel-control.left, .carousel-control.right {
background: none;
color: #1b7b90;
border: none;
}

.hide-bullets {
list-style:none;
margin-left: 0;
margin-top:20px;
}

.thumbnail {
padding: 0;
}

.carousel-inner>.item>img, .carousel-inner>.item>a>img {
width: 100%;
}

.green {
color: green;
}

.red {
color: red;
}

最佳答案

我遇到了完全相同的错误,这让我抓狂。

我猜这与 URI 有关(duh!),我最终将我的项目文件夹从 Google Drive 移到了我的桌面,运行 bundle、rails db:migrate、rails assets:precompile 然后是 rails s .事实证明,它已为我修复。

关于ruby-on-rails - Rails javascript_include_tag 和 stylesheet_link_tag 上的错误 URI,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/48287113/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com