Ruby on rails rails 4资产在生产中不工作

Ruby on rails rails 4资产在生产中不工作,ruby-on-rails,twitter-bootstrap,ruby-on-rails-4,Ruby On Rails,Twitter Bootstrap,Ruby On Rails 4,几个月来,我一直在使用引导sass,直到我进行了捆绑更新。起初,这些资产不会预编译,因为gem已经更新到版本3。我将gem更改为bootstrap sass,“2.3.2.0”以强制它使用版本2.3,因为simple form不支持bootstrap 3 现在bootstrap在开发中起作用,但在生产中不起作用。虽然capistrano deploy执行预编译,但似乎找不到资产 gem 'sass-rails', '>= 3.2' gem 'bootstrap-sass', '2.3.2

几个月来,我一直在使用引导sass,直到我进行了捆绑更新。起初,这些资产不会预编译,因为gem已经更新到版本3。我将gem更改为bootstrap sass,“2.3.2.0”以强制它使用版本2.3,因为simple form不支持bootstrap 3

现在bootstrap在开发中起作用,但在生产中不起作用。虽然capistrano deploy执行预编译,但似乎找不到资产

gem 'sass-rails', '>= 3.2'

gem 'bootstrap-sass', '2.3.2.2'

gem 'bootswatch-rails'
在我的js控制台中,我看到这是一个正确的指纹,但application.css有几个文件具有不同的指纹:-

GET http://app.sportdata.com.au/assets/application-b0204eeff0e69f0476f26848303a9b7d.css 404 (Not Found) sports:18
GET http://app.sportdata.com.au/assets/application-a130dbe196c4f76b2ce46bc61cd2e18d.js 404 (Not Found) sports:20

打开config/environments/production.rb并确保以下选项设置为true:

# Don't fallback to assets pipeline if a precompiled asset is missed
config.assets.compile = true
然后运行:

rake assets:precompile --trace RAILS_ENV=production

打开config/environments/production.rb并确保以下选项设置为true:

# Don't fallback to assets pipeline if a precompiled asset is missed
config.assets.compile = true
然后运行:

rake assets:precompile --trace RAILS_ENV=production

打开config/environments/production.rb并确保以下选项设置为true:

# Don't fallback to assets pipeline if a precompiled asset is missed
config.assets.compile = true
然后运行:

rake assets:precompile --trace RAILS_ENV=production

打开config/environments/production.rb并确保以下选项设置为true:

# Don't fallback to assets pipeline if a precompiled asset is missed
config.assets.compile = true
然后运行:

rake assets:precompile --trace RAILS_ENV=production

我在我的nginx.conf中不知何故丢失了服务器下的根。

我在我的nginx.conf中不知何故丢失了服务器下的根。

我在我的nginx.conf中不知何故丢失了服务器下的根。

确保在config/environments/production.rb中,您已经

config.serve_static_assets = true

确保在config/environments/production.rb中,您有

config.serve_static_assets = true

确保在config/environments/production.rb中,您有

config.serve_static_assets = true

确保在config/environments/production.rb中,您有

config.serve_static_assets = true


检查以确保没有将public/assets目录添加到git。从gitI中删除该目录我做到了,但仍然是一样的。重新启动服务器。config.assets.compile设置为true或false没有任何区别。是否可以复制开发版本并将环境变量RAILS_ENV更改为production,以查看发生了什么情况。如果可以,则将该版本推送到您的生产服务器,该服务器在我的笔记本电脑上以生产模式工作,但在服务器上不工作。检查以确保您没有将public/assets目录添加到git。从gitI中删除该目录我做到了,但仍然是一样的。重新启动服务器。config.assets.compile设置为true或false没有任何区别。是否可以复制开发版本并将环境变量RAILS_ENV更改为production,以查看发生了什么情况。如果可以,则将该版本推送到您的生产服务器,该服务器在我的笔记本电脑上以生产模式工作,但在服务器上不工作。检查以确保您没有将public/assets目录添加到git。从gitI中删除该目录我做到了,但仍然是一样的。重新启动服务器。config.assets.compile设置为true或false没有任何区别。是否可以复制开发版本并将环境变量RAILS_ENV更改为production,以查看发生了什么情况。如果可以,则将该版本推送到您的生产服务器,该服务器在我的笔记本电脑上以生产模式工作,但在服务器上不工作。检查以确保您没有将public/assets目录添加到git。从gitI中删除该目录我做到了,但仍然是一样的。重新启动服务器。config.assets.compile设置为true或false没有任何区别。是否可以复制开发版本并将环境变量RAILS_ENV更改为production,以查看发生了什么情况。如果可行,则将该版本推送到您的生产服务器,该服务器在我的笔记本电脑上以生产模式工作,但在服务器上不工作。