Can anyone please describe the relationship of javascript-runtime to
Ruby
on Rails? In Mac OSX, I do not get this error, but in Linux for every
new
project generated by “rails new”, I get:
I know the solution; either install therubyracer or nodejs gems. But I
am
not sure I understand fully why it works. If I install this in a
production environment server, I do not need either one of these. And my
browser definitely interprets javascript built in. So how does this fit
in
to everything? Is my premise incorrect? Thank you.
I know the solution; either install therubyracer or nodejs gems. But I am
not sure I understand fully why it works. If I install this in a
production environment server, I do not need either one of these. And my
browser definitely interprets javascript built in. So how does this fit in
to everything? Is my premise incorrect? Thank you.
There are asset pipeline dependencies here: for example uglifyjs (for
minifying javascript) and coffeescript are both written in javascript.
Both
of these two things happen serverside (almost: you can compile the
assets
somewhere other than your deployment machines, and copy the finished
product either to the deployment machines or to the CDN of your choice)
Thanks for replying, Frederick. So help me understand this:
javascript-runtime is actually the javascript interpreter. Right? But
what
is odd is when I install node-js this solves my problem. And I thought
node-js was written in javascript. Therefore, it itself requires an
interpreter. Did I get this wrong? So how does installing node-js, a
javascript script, solve the problem of not having a javascript
interpreter
to begin with?
Thanks for replying, Frederick. So help me understand this:
javascript-runtime is actually the javascript interpreter. Right? But what
is odd is when I install node-js this solves my problem. And I thought
node-js was written in javascript. Therefore, it itself requires an
interpreter. Did I get this wrong? So how does installing node-js, a
javascript script, solve the problem of not having a javascript interpreter
to begin with?
Node.js is based on the Google’s javascript engine, I believe, which
is not written in javascript. With it comes a javascript library to
extend the features (which is run by the javascript engine of course).
I know the solution; either install therubyracer or nodejs gems.
try,
bundle install --without assets
If I install this in a production environment server, I do not need
either one of these. And my browser definitely interprets javascript built
in. So how does this fit in to everything? Is my premise incorrect?
On Friday, April 5, 2013 7:01:50 PM UTC+1, Peter wrote:
Thanks for replying, Frederick. So help me understand this:
javascript-runtime is actually the javascript interpreter. Right? But what
is odd is when I install node-js this solves my problem. And I thought
node-js was written in javascript. Therefore, it itself requires an
interpreter. Did I get this wrong? So how does installing node-js, a
javascript script, solve the problem of not having a javascript interpreter
to begin with?
node-js is both both google V8 javascript engine plus some libraries (much
as for example ruby is the ruby interpreter plus a bunch of standard
library stuff)
Thank you, everyone. This was an issue only in my Fedora laptop. In my
OSX,
not a problem at all. I knew all along that installing therubyracer or
nodejs would fix this, I just didn’t know the “why” since I thought
these
weren’t javascript interpreters; that they themselves were written in
javascript that required a javascript interpreter.
That said, I installed therubyracer and I did see libv8 being installed
along with it. This I believe is the javascript interpreter so it now
makes
sense and I understand that it is used only for compiling the assets in
asset pipeline. Thanks again for everyone’s input.
I hate to add to the confusion, but therubyracer is now not
recommended on Heroku.
What do you suggest we do ? I typically precompile assets and push it.
Is this the recommended way?
On Mon, Apr 8, 2013 at 10:29 AM, Manish Chakravarty [email protected]wrote:
I hate to add to the confusion, but therubyracer is now not
recommended on Heroku.
What do you suggest we do ? I typically precompile assets and push it.
Is this the recommended way?
This forum is not affiliated to the Ruby language, Ruby on Rails framework, nor any Ruby applications discussed here.