I want to apply css to rails, but it doesn't
application.html.erb
<title>UberEvaluation</title>
<%=csrf_meta_tags%>
<%=csp_meta_tag%>
<%=stylesheet_link_tag 'application', media: 'all', 'data-turbolinks-track': 'reload'%>
<metacharset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no">
<!--Bootstrap CSS-->
<link rel="stylesheet" href="https://stackpath.bootstrapcdn.com/bootstrap/4.3.1/css/bootstrap.min.css">
<style type="text/css">
<!--
a:visited {color:white;text-decoration:none}
-->
</style>
</head>
application.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 with this directory, lib/assets/style sheets, or any plugin's
* vendor/assets/stylesheets directory can be referred to 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 bottom of the
* compiled files 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 generically better to create a new file per style scope.
*
*= require_tree.
*= require_self
*/
body{
background-color:red;
}
Error getting <%=stylesheet_link_tag 'application', media: 'all', 'data-turbolinks-track': 'reload'%>
in application.html.erb
#<NoMethodError: undefined method `silence' for #<Logger:0x0000561c9b2adcb8>>
/home/ubuntu/.rvm/gems/ruby-2.6.3/gems/sprockets-rails-3.2.2/lib/sprockets/rails/quiet_assets.rb:11:in`call'
/home/ubuntu/.rvm/gems/ruby-2.6.3/gems/actionpack-5.2.6/lib/action_dispatch/middleware/remote_ip.rb:81:in`call'
/home/ubuntu/.rvm/gems/ruby-2.6.3/gems/actionpack-5.2.6/lib/action_dispatch/middleware/request_id.rb:27:in`call'
/home/ubuntu/.rvm/gems/ruby-2.6.3/gems/rack-2.2.3/lib/rack/method_override.rb:24:in`call'
/home/ubuntu/.rvm/gems/ruby-2.6.3/gems/rack-2.2.3/lib/rack/runtime.rb:22:in`call'
/home/ubuntu/.rvm/gems/ruby-2.6.3/gems/activesupport-5.2.6/lib/active_support/cache/strategy/local_cache_middleware.rb:29:in`call'
/home/ubuntu/.rvm/gems/ruby-2.6.3/gems/actionpack-5.2.6/lib/action_dispatch/middleware/executor.rb:14:in`call'
/home/ubuntu/.rvm/gems/ruby-2.6.3/gems/actionpack-5.2.6/lib/action_dispatch/middleware/static.rb: 127:in`call'
/home/ubuntu/.rvm/gems/ruby-2.6.3/gems/rack-2.2.3/lib/rack/sendfile.rb:110:in`call'
/home/ubuntu/.rvm/gems/ruby-2.6.3/gems/rails-5.2.6/lib/rails/engine.rb:524:in`call'
/home/ubuntu/.rvm/gems/ruby-2.6.3/gems/puma-3.12.6/lib/puma/configuration.rb:227:in`call'
/home/ubuntu/.rvm/gems/ruby-2.6.3/gems/puma-3.12.6/lib/puma/server.rb:706:in `handle_request'
/home/ubuntu/.rvm/gems/ruby-2.6.3/gems/puma-3.12.6/lib/puma/server.rb:476:in`process_client'
/home/ubuntu/.rvm/gems/ruby-2.6.3/gems/puma-3.12.6/lib/puma/server.rb:334:in `block in run'
/home/ubuntu/.rvm/gems/ruby-2.6.3/gems/puma-3.12.6/lib/puma/thread_pool.rb: 135: in `block in spawn_thread'
2021-09-2122:51:09+0000: Rack error handling request {GET/assets/application.self-d4834196f99ff2dc186095a72257a2665c6a77d7b9729fddbde938c63239f.cs}
#<NoMethodError: undefined method `silence' for #<Logger:0x0000561c9b2adcb8>>
/home/ubuntu/.rvm/gems/ruby-2.6.3/gems/sprockets-rails-3.2.2/lib/sprockets/rails/quiet_assets.rb:11:in`call'
/home/ubuntu/.rvm/gems/ruby-2.6.3/gems/actionpack-5.2.6/lib/action_dispatch/middleware/remote_ip.rb:81:in`call'
/home/ubuntu/.rvm/gems/ruby-2.6.3/gems/actionpack-5.2.6/lib/action_dispatch/middleware/request_id.rb:27:in`call'
/home/ubuntu/.rvm/gems/ruby-2.6.3/gems/rack-2.2.3/lib/rack/method_override.rb:24:in`call'
/home/ubuntu/.rvm/gems/ruby-2.6.3/gems/rack-2.2.3/lib/rack/runtime.rb:22:in`call'
/home/ubuntu/.rvm/gems/ruby-2.6.3/gems/activesupport-5.2.6/lib/active_support/cache/strategy/local_cache_middleware.rb:29:in`call'
/home/ubuntu/.rvm/gems/ruby-2.6.3/gems/actionpack-5.2.6/lib/action_dispatch/middleware/executor.rb:14:in`call'
/home/ubuntu/.rvm/gems/ruby-2.6.3/gems/actionpack-5.2.6/lib/action_dispatch/middleware/static.rb: 127:in`call'
/home/ubuntu/.rvm/gems/ruby-2.6.3/gems/rack-2.2.3/lib/rack/sendfile.rb:110:in`call'
/home/ubuntu/.rvm/gems/ruby-2.6.3/gems/rails-5.2.6/lib/rails/engine.rb:524:in`call'
/home/ubuntu/.rvm/gems/ruby-2.6.3/gems/puma-3.12.6/lib/puma/configuration.rb:227:in`call'
/home/ubuntu/.rvm/gems/ruby-2.6.3/gems/puma-3.12.6/lib/puma/server.rb:706:in `handle_request'
/home/ubuntu/.rvm/gems/ruby-2.6.3/gems/puma-3.12.6/lib/puma/server.rb:476:in`process_client'
/home/ubuntu/.rvm/gems/ruby-2.6.3/gems/puma-3.12.6/lib/puma/server.rb:334:in `block in run'
/home/ubuntu/.rvm/gems/ruby-2.6.3/gems/puma-3.12.6/lib/puma/thread_pool.rb: 135: in `block in spawn_thread'
#<NoMethodError: undefined method 'silence' for #<Logger:0x0000561c9b2adcb8>
This seems to be the main body of the error.
Why don't you search silence
or logger.silence
for the source code and delete the line?
© 2024 OneMinuteCode. All rights reserved.