我有一个Sinatra应用程序,在升级资产无法加载后,我已经从ruby 1.9.3升级到ruby 2.4.3。
我已经尝试了一切
22:25:32 application.1 | 10.191.228.114 - - [25/Mar/2018:22:25:32 -0700] "GET /assets//stylesheets/sso.css HTTP/1.0" 404 9 0.0076
22:25:32 application.1 | 10.191.228.114 - - [25/Mar/2018:22:25:32 -0700] "GET /assets//javascripts/login.js HTTP/1.0" 404 9 0.0061
22:25:32 application.1 | 10.191.228.114 - - [25/Mar/2018:22:25:32 -0700] "GET /assets//javascripts/login.js HTTP/1.0" 404 9 0.0079
以下是代码,如果我在这里做错了,请纠正我。
require 'sinatra/base'
require 'sprockets'
require 'sprockets-helpers'
require 'sinatra/asset_pipeline'
require 'compass'
helpers Sprockets::Helpers
set :app_root, File.expand_path(File.dirname(__FILE__)+"/../../")
set :public_folder, File.join(app_root + "/public")
assets = %w(login.js sso.css *.png *.jpg *.gif views/invitations/signup_form.js)
locale_files = Dir[File.join(app_root, 'config', 'locales', '*.yml')]
set :scss, {:style => :compact, :debug_info => true}
set :assets_precompile, assets
set :assets_paths, %w(app/assets vendor/assets)
set :assets_prefix, %w(app/assets vendor/assets)
set :assets_css_compressor, :sass
set :assets_js_compressor, :uglifier
set :session_secret, "something secret, something safe"
register Sinatra::AssetPipeline
提前致谢