Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Javascript manifest file "application.js" is not processed

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!

like image 881
ybian Avatar asked Jul 20 '12 01:07

ybian


Video Answer


2 Answers

I had the same issue!

Downgrading Ruby from 2.0.0 to 1.9.3 fixed the issue

like image 172
Bobby Matson Avatar answered Sep 20 '22 09:09

Bobby Matson


Suggestions: install node.js or uncomment gem 'therubyracer', :platforms => :ruby in your Gemfile

I followed the same steps and my log file looks like this... What does yours look like if you start the server and request /assets/application.js? As you can see, I'm on 3.2.6, and it compiled my application.js

=> Booting WEBrick
=> Rails 3.2.6 application starting in development on http://0.0.0.0:3000
=> Call with -d to detach
=> Ctrl-C to shutdown server
[2012-07-19 22:50:02] INFO  WEBrick 1.3.1
[2012-07-19 22:50:02] INFO  ruby 1.9.3 (2012-02-16) [x86_64-darwin11.3.0]
[2012-07-19 22:50:02] INFO  WEBrick::HTTPServer#start: pid=21393 port=3000


Started GET "/assets/rails.png" for 127.0.0.1 at 2012-07-19 22:50:13 -0500
Connecting to database specified by database.yml
Served asset /rails.png - 200 OK (9ms)


Started GET "/assets/application.js" for 127.0.0.1 at 2012-07-19 22:50:23 -0500
Compiled jquery.js  (2ms)  (pid 21393)
Compiled jquery_ujs.js  (0ms)  (pid 21393)
Compiled application.js  (26ms)  (pid 21393)
Served asset /application.js - 200 OK (74ms)
[2012-07-19 22:50:24] WARN  Could not determine content-length of response body. Set content-length of the response or set Response#chunked = true
like image 42
Jesse Wolgamott Avatar answered Sep 19 '22 09:09

Jesse Wolgamott