0

So I have a basic gem file where I have specified groups :development and :assets. When I do a rails generate controller welcome index it creates welcome.js and welcome.css.

If I remove the group specifications and run again (even without running "bundle install") it will create the files welcome.js.coffee and welcome.css.scss - the behaviour that I would expect.

I am totally confused at what is happening here. I am pretty new to this so I think it is me misusing a feature rather than a bug. I know I could manually rename the files, its not that I'm too lazy, but that I want to understand the how and why of this behaviour.

This is with a fresh Rails project, only modification is to the gem file.

Gem file:

source 'https://rubygems.org'

gem 'rails', '4.1.4'



group :development do
    gem 'sqlite3'
    gem 'annotate'
end

group :assets do
    gem 'sass-rails', '~> 4.0.3'
    gem 'coffee-rails', '~> 4.0.0'
    gem 'uglifier', '>= 1.3.0'
end


gem 'jquery-rails'
gem 'turbolinks'
gem 'jbuilder', '~> 2.0'
gem 'sdoc', '~> 0.4.0',          group: :doc

gem 'spring',        group: :development

Note that I leave the:

gem 'sdoc', '~> 0.4.0',          group: :doc
gem 'spring',        group: :development

as is in both cases.

Thanks!

1 Answer 1

1
group :assets

Is deprecated in Rails 4, so you'll have to remove that line for it to work in that version.

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.