问题
I'm a rails newbie. I've install spree and spree fancy on my app. It's ok on development but when I've deployed it on heroku, the layout is broken. Can anyone help me fix this?
Question w/ Images: https://github.com/spree/spree_fancy/issues/68
Gemfile:
ruby '1.9.3'
gem 'rails_12factor', group: :production
gem 'rails', '4.0.0'
group :production do
gem 'pg'
end
group :development, :test do
gem 'sqlite3'
end
gem 'sass-rails', '~> 4.0.0'
gem 'uglifier', '>= 1.3.0'
gem 'coffee-rails', '~> 4.0.0'
gem 'jquery-rails'
gem 'turbolinks'
gem 'jbuilder', '~> 1.2'
group :doc do
gem 'sdoc', require: false
end
gem 'spree', '2.1.2'
gem 'spree_gateway', :git => 'link is omitted to post', :branch => '2-1-stable'
gem 'spree_auth_devise', :git => 'link is omitted to post', :branch => '2-1-stable'
gem 'spree_fancy', :git => 'link is omitted to post', :branch => '2-1-stable'
*links can be found on github
I've already done:
heroku run rake db:migrate
after push into heroku.
回答1:
Probably you are missing your public/assets folder on your heroku app.
Take these steps from your app folder:
bundle exec rake assets:precompile
git add .
git commit -m "public/assets precompile"
git push heroku master
heroku open
In order to check out what is on your Heroku folder:
heroku ls public/assets
Also, in case you are having some more errors use this command in order to troubleshoot. I saw at some point some errors loading images. These errors are coming from ActionController:
heroku logs -n 500
heroku logs -n 500 | grep Action
This is what I was learning within the last days and hope it can be useful to someone.
来源:https://stackoverflow.com/questions/20131009/broken-spree-fancy-layout-on-heroku