Все мои изображения недоступны в рабочей среде после обновления до rails 3.1.3 с 3.0.3.Даже если я вручную перехожу на http://localhost:3000/rails.png
и помещаю файл изображения в public/
, я получаю ошибку маршрутизации.То же самое, если я переместил его на public/images
при доступе к localhost:3000/images/rails.png
.
Я не уверен, что это неправильно сконфигурированные настройки актива.Я попытался следовать аналогичной теме в переполнении стека без удачи.Вот мой Gemfile и мои файлы конфигурации.
Gemfile
source 'http://rubygems.org'
gem "rails", "3.1.3"
gem "pg", :require => "pg"
gem "devise", "~> 1.5.2"
gem "cancan"
gem "hoptoad_notifier", '2.4.11'
gem "friendly_id", "~> 3.1"
gem "will_paginate", "~> 3.0.2"
gem "haml", "~> 3.1.3"
gem "haml-rails"
gem "yard"
gem "bluecloth"
gem "simple_form", '~> 1.3.1'
gem "paperclip"
gem "jquery-rails"
gem 'twitter-bootstrap-rails'
gem 'thin'
group :assets do
gem 'sass-rails', " ~> 3.1.5"
gem 'coffee-rails', " ~> 3.1.0"
gem 'uglifier'
end
group :development, :test do
gem "rspec-rails", "~> 2.7.0"
# gem 'remarkable_activerecord', '~> 4.0.0.alpha4'
gem "maksar-remarkable_activerecord", "~> 4.0.0.alpha6"
gem "faker"
gem "evergreen", :require => "evergreen/rails"
gem 'pry'
end
group :development do
gem "rails3-generators"
gem "hpricot"
gem "ruby_parser"
end
group :test, :cucumber do
gem "factory_girl_rails"
gem "database_cleaner"
gem "timecop"
gem "pickle"
gem "spork", "~> 0.9.0.rc2"
end
group :cucumber do
gem "cucumber"
gem "cucumber-rails"
gem "capybara", "~> 0.4.0"
gem "launchy"
end
group :test do
gem "mocha"
gem "autotest"
gem "autotest-rails"
end
application.rb
module MyTutorial
class Application < Rails::Application
# ... other config...
# Enable the asset pipeline
config.assets.enabled = true
# Version of your assets, change this if you want to expire all your assets
config.assets.version = '1.0'
config.assets.initialize_on_precompile = false
end
end
production.rb
MyTutorial::Application.configure do
# Settings specified here will take precedence over those in config/application.rb
# The production environment is meant for finished, "live" apps.
# Code is not reloaded between requests
config.cache_classes = true
# Full error reports are disabled and caching is turned on
config.consider_all_requests_local = false
config.action_controller.perform_caching = true
# Disable Rails's static asset server (Apache or nginx will already do this)
config.serve_static_assets = false
# Compress JavaScripts and CSS
config.assets.compress = true
# Don't fallback to assets pipeline
config.assets.compile = true
# Generate digests for assets URLs
config.assets.digest = false
# Specify the default JavaScript compressor
config.assets.js_compressor = :uglifier
# Specifies the header that your server uses for sending files
config.action_dispatch.x_sendfile_header = "X-Sendfile"
end