Rails project CSS file loading failed

Source: Internet
Author: User

The problems left over from history have not been completed for a long time before running the rails project in windows, and the Environment has finally been completed and run... After I found that the CSS file could not be loaded successfully, I gave up and directly installed the dual-system. Today I couldn't help it, but I finally finished it. Haha, although it wasn't my own, but still happy ~ The problem was that the project was running, but the CSS file was not loaded successfully.

Solution: Run rake assets: precompile in the directory of the rails project, compile the assets file, merge the JS and CSS files into a file, and then start rails S. The result is as follows:

It is said that the encoding of CSS files is not UTF-8. Convert all of them into UTF-8 format and run the code again ~

Two links are provided:

How to install Ruby, rails runtime environment: http://ruby-china.org/wiki/install_ruby_guide quickly and correctly

View rvm (Ruby version manager, which includes ruby version management and gemset)Practical Guide: http://ruby-china.org/wiki/rvm-guide

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.