Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

defaults.js Not Created #54

Open
clint326 opened this issue Jan 26, 2012 · 10 comments
Open

defaults.js Not Created #54

clint326 opened this issue Jan 26, 2012 · 10 comments

Comments

@clint326
Copy link

I'm rather new to Ruby on Rails and Web-App-Theme... and this is the first issue I've ever posted on Github.

When I try even the most basic Rails app with Web-App-Theme, it seems to me that defaults.js is not created. Here's how I tried (I'm using Rails 3.2.0):

rails new testapp
cd testapp
mate .

Then I edit the Gemfile to add the following: gem 'web-app-theme'

Note: adding "gem 'web-app-theme', '> 0.8.0'" gave me errors about compatibility, so I just dropped the '> 0.8.0' part and it worked.

bundle install
rails g scaffold Person name city
rails s

This seems to work fine when I visit http://localhost:3000/people

rails g web_app_theme:theme
rails s

When I go to http://localhost:3000/people I get an error message:

No such file or directory - Asset file not found at '/testapp/public/javascripts/defaults.js'

When I search the testapp directory, there is no file called 'defaults.js' anywhere.

Am I doing something wrong or is this a bug of some sort?

Thanks for your help.

@clint326
Copy link
Author

Okay, I see you have to replace:

<%= javascript_include_tag :defaults, :cache => true %>

with:

<%= javascript_include_tag 'application' %>

But, the pointers to the CSS files are still messed up.

Still looking for help.

@lamfadadev
Copy link

Having same issue, got past the js, but the CSS sill an issue. Any help appreciated.

@rother
Copy link

rother commented Feb 19, 2012

  1. I left out the '~> 0.8.0' as well because it failed to install due to depending on Rails 3.1.x (I'm running 3.2.x)
  2. The problem seems to be that the asset pipeline isn't supported. You can turn it off by changing config.assets.enabled in config/application.rb from true to false.
  3. Change the javascript_include_tag to 'application' as suggested above and it should work
    ...alas you won't have asset pipelineing

@keessonnema
Copy link

that didn't work for me :(
i still get this error:

No such file or directory - Asset file not found at 'C:/pro-app/public/javascripts/C:/RailsInstaller/Ruby1.9.3/lib/ruby/gems/1.9.1/gems/jquery-rails-2.0.2/vendor/assets/javascripts/jquery.js'

hope someone can help us with this problem.

@knoguchi
Copy link

move public/stylesheets/web-app-theme to app/assets/stylesheets/web-app-theme
Then, edit the app/views/layout/application.erb. replace the path with 'application', just like the above for javascript.
<%= stylesheet_link_tag "application", :media => "all" %>

Voila! it works again.

@knoguchi
Copy link

Also move public/images/web-app-theme to app/assets/images/web-app-theme.
So, basically Rails3.2 asset pipeline moved them from public/* to app/assets/*

@erick2red
Copy link

Changing the line in application.html.erb worked for me. No css errors.

@daniellqueiroz
Copy link

Thanks knoguchi, it works!

@djberg96
Copy link

Followed the instructions here from knoguchi, worked great. Wonder if we can get an update.

@anhkt
Copy link

anhkt commented Sep 25, 2016

Hello every one.!!! please, help me.
When I change from 'default' to 'application'. My website didn't work.
When I change from 'application' to 'default', it work, but it note:
GET http://localhost:3000/javascripts/default.js
and:
GET http://localhost:3000/stylesheets/default.css
Thank so much...

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

9 participants