Git Product home page Git Product logo

Comments (14)

javierav avatar javierav commented on May 15, 2024

Others detected problems:

If the application.js file don't have a line with the code //= require the generator don't insert any text in this file. If the line exists, after the insertions, the code is:

//= require .......
ProjectName = Ember.Application.create();
//= require....

The last require is the original require that I have in my application.js These is not processed by Assets and becomes in an javascript exception.

from ember-rails.

rhodee avatar rhodee commented on May 15, 2024

Running ember-rails 0.6.0 I encounter the following:

ActionView::Template::Error (couldn't find file 'handlebars'
(in /sandbox/ember_demo/app/assets/javascripts/application.js:15)):
3: <head>
4:   <title>EmberDemo</title>
5:   <%= stylesheet_link_tag    "application", :media => "all" %>
6:   <%= javascript_include_tag "application" %>
7:   <%= csrf_meta_tags %>
8: </head>
9: <body>
app/views/layouts/application.html.erb:6:in    `_app_views_layouts_application_html_erb__4471938073240671435_70234118761920'

Rendered /.rbenv/versions/1.9.3-p194/lib/ruby/gems/1.9.1/gems/actionpack-3.2.5/lib/action_dispatch/middleware/templates/rescues/_trace.erb (21.7ms)
Rendered /.rbenv/versions/1.9.3-p194/lib/ruby/gems/1.9.1/gems/actionpack-3.2.5/lib/action_dispatch/middleware/templates/rescues/_request_and_response.erb (0.8ms)
Rendered /.rbenv/versions/1.9.3-p194/lib/ruby/gems/1.9.1/gems/actionpack-3.2.5/lib/action_dispatch/middleware/templates/rescues/template_error.erb within rescues/layout (27.6ms)
[2012-06-19 10:58:31] WARN  Could not determine content-length of response body. Set content-length of the response or set Response#chunked = true

The app is bare Rails (sqlite3, one model, two controllers all boilerplate). Then I run:

 rails g ember:bootstrap
  [EMBER-RAILS] `ember.variant` was not found in your current environment
  insert  app/assets/javascripts/application.js
  create  app/assets/javascripts/models
  create  app/assets/javascripts/models/.gitkeep
  create  app/assets/javascripts/controllers
  create  app/assets/javascripts/controllers/.gitkeep
  create  app/assets/javascripts/views
  create  app/assets/javascripts/views/.gitkeep
  create  app/assets/javascripts/routes
  create  app/assets/javascripts/routes/.gitkeep
  create  app/assets/javascripts/helpers
  create  app/assets/javascripts/helpers/.gitkeep
  create  app/assets/javascripts/templates
  create  app/assets/javascripts/templates/.gitkeep
  create  app/assets/javascripts/ember_demo.js
  create  app/assets/javascripts/routes/app_router.js
  create  app/assets/javascripts/store.js
  generate  ember:view
  [EMBER-RAILS] `ember.variant` was not found in your current environment
  create  app/assets/javascripts/views/application_view.js
  create  app/assets/javascripts/templates/application.handlebars
  create  app/assets/javascripts/controllers/application_controller.js

My Manifest looks like this:

 //= require jquery
 //= require jquery_ujs
 //= require handlebars
 //= require ember
 //= require ember-data
 //= require_self
 //= require ember_demo
 EmberDemo = Ember.Application.create();
 //= require_tree .

Why am I getting this error at this stage? Where specifically did I go wrong from the current docs on Master in the gem's repo?

from ember-rails.

cmeiklejohn avatar cmeiklejohn commented on May 15, 2024

//= require handlebars is unnecessary, remove it.

from ember-rails.

rromanchuk avatar rromanchuk commented on May 15, 2024
 rails g ember:bootstrap

[EMBER-RAILS] `ember.variant` was not found in your current environment
      insert  app/assets/javascripts/application.js
/Users/rromanchuk/.rvm/gems/ruby-1.9.3-p194/gems/thor-0.14.6/lib/thor/actions/inject_into_file.rb:99:in `binread': No such file or directory - /Users/rromanchuk/dev/[myproj]/app/assets/javascripts/application.js (Errno::ENOENT)

from ember-rails.

rromanchuk avatar rromanchuk commented on May 15, 2024

blah, this is a bad bug, ..shouldn't fail out of the box like this

from ember-rails.

rromanchuk avatar rromanchuk commented on May 15, 2024

Was failing because my application file has the extension of application.coffee not application.js

from ember-rails.

leondu avatar leondu commented on May 15, 2024

FAIL!

I tried with 0.6 and a brand new rails app, still it gives me:

rails g ember:bootstrap
[EMBER-RAILS] `ember.variant` was not found in your current environment
      insert  app/assets/javascripts/application.js
      create  app/assets/javascripts/models
      create  app/assets/javascripts/models/.gitkeep
      create  app/assets/javascripts/controllers
      create  app/assets/javascripts/controllers/.gitkeep
      create  app/assets/javascripts/views
      create  app/assets/javascripts/views/.gitkeep
      create  app/assets/javascripts/routes
      create  app/assets/javascripts/routes/.gitkeep
      create  app/assets/javascripts/helpers
      create  app/assets/javascripts/helpers/.gitkeep
      create  app/assets/javascripts/templates
      create  app/assets/javascripts/templates/.gitkeep
      create  app/assets/javascripts/ember_rest_demo.js
      create  app/assets/javascripts/routes/app_router.js
      create  app/assets/javascripts/store.js
    generate  ember:view
[EMBER-RAILS] `ember.variant` was not found in your current environment
      create  app/assets/javascripts/views/application_view.js
      create  app/assets/javascripts/templates/application.handlebars
      create  app/assets/javascripts/controllers/application_controller.js

from ember-rails.

leondu avatar leondu commented on May 15, 2024

ps, I do have application.js

from ember-rails.

rhodee avatar rhodee commented on May 15, 2024

Add the line config.ember.variant = :development to your config/environment/development.rb for example and you should no longer receive this message. That said you should do this prior to running the bootstrap scripts in order to avoid this warning. You can obviously add it to the other environment configs as you wish.

from ember-rails.

frede avatar frede commented on May 15, 2024

+1 doesnt find handlebars anyhow

from ember-rails.

ianpetzer avatar ianpetzer commented on May 15, 2024

I was experiencing this problem while trying to deploy my app to Heroku. Turns out that I'd only specified my config.ember.variant in development.rb. I added it to production.rb which solved my problems.

from ember-rails.

cv711 avatar cv711 commented on May 15, 2024

Addind the equivalent config.ember.variant both in development and production solved it for me.

from ember-rails.

mbajur avatar mbajur commented on May 15, 2024

None of listed solutions solves the original issue (fail if application.js file don't exists).

from ember-rails.

MiguelMadero avatar MiguelMadero commented on May 15, 2024

I just did it and I still had to manually add application.js first. Seems like an easy fix, I might have a look if we decide to go with this approach.

from ember-rails.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.