Javascript manifest file "application.js" is not processed

Viewed 4918

I am on a Macbook Pro and I created a new Rails 3.2 app, but the assets pipeline does not work. Here is what I did:

$ rails version
  Rails 3.2.5
$ rails new test_assets
$ cd test_assets
$ rails server

The server is started OK, but if I visit http://0.0.0.0:3000/assets/application.js, it turns out the manifest file is not processed at all, it shows:

//... some comments ...
//= require jquery
//= require jquery_ujs
//= require_tree .
;

I tried to do the exactly the same steps on my other Macbook Pro. It works well. Visiting http://0.0.0.0:3000/assets/application.js on that machine shows a compiled javascript file with all the contents.

I have read http://railscasts.com/episodes/279-understanding-the-asset-pipeline and http://guides.rubyonrails.org/asset_pipeline.html, and I searched for hours on the web but with no clue.

Your help is really appreciated!

7 Answers

I have run into the same issue today and I was ready to downgrade Ruby to 1.9.3 from 2.0 to solve the issue of application.js not compiling. The issue happened on the production server, which has Ruby 2.0 installed (and Rails 3.2.8). On the development machine(Ruby 1.9.3 and Rails 3.2.8) application.js compiled just fine.

At last resort, I upgraded the production server from Rails 3.2.8 to 3.2.14; remove Gemfile.lock, and ran bundle install. Then I recompiled the assets, and voila application.js compiled the assets.

I thought of sharing this with Stackoverflow audience, maybe this will solve someone else's issues.

Related