We were unable to load Disqus. If you are a moderator please see our troubleshooting guide.
Very useful
Please, if you are starting a new Ember app, do not use ember-rails but ember-cli. You have a nice gem, ember-cli-rails, too.
Now, that's a good reason. I'll try ember-cli-rails to know how easy it is.
What most people don't understand is that not every team is composed by people that know how to hack the whole thing. Some teams include people that can really hack on anything (I know I can do it), but sometimes you just need/want a frictionless setup. Enforcing ember-cli, node.js, how to use Bower/NPM, is just too much.
ember-cli is the canonical way of running apps nowadays? It is, but is far from simple in terms of environment complexity.
The same reasons applying to Ember people having to install Ruby, gem and bundler. Maybe you even require rvm or rbenv because different projects require different versions.
"In terms of environment complexity", is not as hard as you paint it. Since version 0.1 you can just use "ember install" to install both dependencies (bower and npm).
Using Ember CLI now will ease your pain in the future (and even now, once you have written some Ember using ES6 modules, coming back to globals is a pain) and you will be able to write better Ember applications in less time.
Installing node, bower and ember-cli is five commands (and that's installing nvm too). Furthermore, once you do this, ember-cli-rails can take the pain away.
The same reasons applying to Ember people having to install Ruby, gem and bundler.
But you still have to do it anyway if your API is running on Rails. By keeping everything under Rails you won't have to deal with Node stack.
Just use "ember install" to install both dependencies (bower and npm).
Until you have to deal with more than just installing deps. AFAIK, there's no way I can remove deps without issuing npm rm or bower uninstall. See? Two different CLI APIs.
Installing node, bower, ember-cli et al is not the problem. Using it is.
...ember-cli-rails can take the pain away.
I haven't tried ember-cli-rails yet, and I'll do it asap. If it's easy enough, I'll be more than happy to update this article with ember-cli-rails instructions. :)
Hi, could you also post the source code sample repo? thanks :)
Awesome write up!
$ bundle install
Warning: this Gemfile contains multiple primary sources. Using `source` more than once without a block is a security risk, and may result in installing unexpected gems. To resolve this warning, use a block to indicate which gems should come from the secondary source. To upgrade this warning to an error, run `bundle config disable_multisource true`.
Fetching gem metadata from https://rails-assets.org/..
Fetching gem metadata from https://rubygems.org/............
Fetching version metadata from https://rails-assets.org/..
Fetching version metadata from https://rubygems.org/...
Fetching dependency metadata from https://rails-assets.org/..
Fetching dependency metadata from https://rubygems.org/..
Bundler released an update that requires you to set these gems in a block, like the following:
source 'https://rubygems.org'
gem 'rails', '4.2.0'
gem 'sass-rails', '~> 5.0'
gem 'uglifier', '>= 1.3.0'
gem 'ember-rails'
gem 'ember-source', '~> 1.9.0'
group :development, :test do
gem 'test_squad'
end
source 'https://rails-assets.org' do
gem 'rails-assets-jquery'
group :development, :test do
gem 'rails-assets-qunit'
gem 'rails-assets-ember-qunit'
end
end
When we will have an ember.js course by @fnando? :)