Comments (14)
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.
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.
//= require handlebars
is unnecessary, remove it.
from ember-rails.
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.
blah, this is a bad bug, ..shouldn't fail out of the box like this
from ember-rails.
Was failing because my application file has the extension of application.coffee not application.js
from ember-rails.
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.
ps, I do have application.js
from ember-rails.
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.
+1 doesnt find handlebars anyhow
from ember-rails.
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.
Addind the equivalent config.ember.variant
both in development and production solved it for me.
from ember-rails.
None of listed solutions solves the original issue (fail if application.js file don't exists).
from ember-rails.
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)
- ember-source versions HOT 1
- getting error while trying to inject a service HOT 2
- Follow-up of #516 issue HOT 3
- ember-rails & ember-source dependency conflicts HOT 4
- Rails 3 support issues ember-handlebars-template and ember-es6_template HOT 1
- views folder HOT 4
- Rails 5 support? HOT 1
- Upgrading Ember HOT 1
- Sprockets 3.7.0 has deprecated methed `register_engine` HOT 5
- undefined method `append_path' for nil:NilClass (NoMethodError) HOT 1
- HTMLBars templates not compiling HOT 2
- require environment before require ember-rails results in error "define is not defined" HOT 1
- URL in generators is a 404
- Could you please update ember-es6_template dependency version? HOT 2
- Drop Rails < 4.2 to support current Rails
- Update supported Rails versions in README HOT 2
- Sprockets cannot find ember/loader HOT 3
- ember-data HOT 4
- Module management and import system HOT 1
- Rails 3.2.14 HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from ember-rails.