How to disable the asset pipeline?

149 views
Skip to first unread message

Juliusz Gonera

unread,
Jun 16, 2011, 10:24:47 AM6/16/11
to Ruby on Rails: Talk
Hi,

I'm trying to use Rails for the first time and since 3.1 is already in
RC stage I thought I'd use it. The problem is I don't want any of the
asset pipeline functionality. I decided to use RequireJS in my project
and I simply don't need asset pipeline or Sprockets. I tried
commenting out config.assets.enabled = true in application.rb or
setting it to false.

I also put

require "action_controller/railtie"
require "action_mailer/railtie"
require "active_resource/railtie"
require "rails/test_unit/railtie"

instead of require 'rails/all'

No matter what I do, when I run rails server I get the "Could not find
a JavaScript runtime" error. Is it impossible to disable the asset
pipeline or is JavaScript runtime needed for something else?

Regards,
Juliusz Gonera

Dieter Lunn

unread,
Jun 16, 2011, 12:56:57 PM6/16/11
to rubyonra...@googlegroups.com
In your application.rb file change config.assets.enabled to false.

Dieter Lunn
http://ubiety.ca

> --
> You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group.
> To post to this group, send email to rubyonra...@googlegroups.com.
> To unsubscribe from this group, send email to rubyonrails-ta...@googlegroups.com.
> For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.
>
>

Juliusz Gonera

unread,
Jun 16, 2011, 2:45:17 PM6/16/11
to Ruby on Rails: Talk
I'll just quote myself:

"I tried commenting out config.assets.enabled = true in application.rb
or
setting it to false."


Dieter Lunn

unread,
Jun 16, 2011, 3:03:32 PM6/16/11
to rubyonra...@googlegroups.com
Should have paid more attention sorry. Do you have the execjs gem installed?

Dieter Lunn
http://ubiety.ca

Juliusz Gonera

unread,
Jun 16, 2011, 6:32:01 PM6/16/11
to Ruby on Rails: Talk
At the moment no. I recreated the gemset and commented out those lines
in my Gemfile before running bundle install:

#gem 'coffee-script'
#gem 'uglifier'
#gem 'jquery-rails'

Seems it doesn't require a JavaScript runtime anymore.

It seems weird to me though that with config.assets.enabled = false
something still tried to use a JS engine.


On Jun 16, 9:03 pm, Dieter Lunn <coder2...@gmail.com> wrote:
> Should have paid more attention sorry. Do you have the execjs gem installed?
>
> Dieter Lunnhttp://ubiety.ca

Dieter Lunn

unread,
Jun 17, 2011, 12:14:47 AM6/17/11
to rubyonra...@googlegroups.com
coffee-script requires execjs to compile the javascript files. Even
with the asset pipeline disabled and coffee-script is required in your
gemfile it will require execjs along with it.

Dieter Lunn
http://ubiety.ca

Juliusz Gonera

unread,
Jun 17, 2011, 1:30:45 PM6/17/11
to Ruby on Rails: Talk
Thanks, this clears it up.


On Jun 17, 6:14 am, Dieter Lunn <coder2...@gmail.com> wrote:
> coffee-script requires execjs to compile the javascript files. Even
> with the asset pipeline disabled and coffee-script is required in your
> gemfile it will require execjs along with it.
>
Reply all
Reply to author
Forward
0 new messages