2
votes

not sure what I'm doing wrong. but I get:

 GET http://localhost:3001/assets/application.css 404 (Not Found)

Here is my config:

gem 'rails', '3.1.0.rc3'              
gem 'rake', '0.9.2'                   
group :assets do
  gem 'sass'
  gem 'coffee-script'
  gem 'uglifier'
  gem 'sprockets'
end

in application.rb:

config.assets.enabled = true

in app/assets/javascripts/application.js:

//= require jquery
//= require jquery_ujs
//= require_tree .

similarly for app/assets/stylesheets/application.css

Why aren't the /assets/application.[css|js] generated/accessible? do I need to run something manually? also is sprockets needed or it's part of rails now?

3

3 Answers

0
votes

It's not a specific answer to your problem, but it might solve it: I ran into a lot of issues which were fixed by switching to rc5 - I notice in your gemfile you're using rc3. I was getting a lot of hiccups like this when I was on rc4.

You don't need to add sprockets in your gemfile anymore once you do this either. Also, you don't mention it but do you have gem 'jquery-rails' in your gemfile too?

0
votes

As Richard pointed out, moving to rc5 helped:

gem 'rails', '3.1.0.rc5'

but I was still getting "stack level too deep" issues which I finally figured out was due to my version of sprockets (beta.13) so I added a previous version the gem file:

gem 'sprockets', '2.0.0.beta.12'

and things are working fine :)

0
votes

I was running into this problem as well and it took me a lot of tinkering to get it back to a working state. What I finally ended up doing that worked is:

  1. Adding the following line to application.rb:

    Bundler.require *Rails.groups(:assets) if defined?(Bundler)

  2. Changing up my Gemfile so that I had the following defined:

    group :assets do

    gem 'sass-rails', "~> 3.1.0.rc"

    gem 'coffee-rails', "~> 3.1.0.rc"

    gem 'uglifier'

    end

  3. Bundle install, relaunch my server and voila, I have css and js again.