Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Could not find a JavaScript runtime #885

Closed
jimjimovich opened this issue Aug 16, 2011 · 25 comments
Closed

Could not find a JavaScript runtime #885

jimjimovich opened this issue Aug 16, 2011 · 25 comments

Comments

@jimjimovich
Copy link
Contributor

With a brand new checkout of master:

bundle install
rake db:migrate

rake aborted!
Could not find a JavaScript runtime. See https://github.com/sstephenson/execjs for a list of available runtimes.

saw something about therubyracer in the commits recently, perhaps this is still needed?

@ugisozols
Copy link
Member

Yes, it's therubyracer gem that was removed.

@parndt
Copy link
Member

parndt commented Aug 16, 2011

@resetexistence

Can we use something other than therubyracer for this?

@ugisozols
Copy link
Member

Note, mac users don't need this because mac os already have js runtime out of the box.

@jimjimovich
Copy link
Contributor Author

The change that @ugisozols made fixed the problem on Ubuntu. Thanks :)

@reset
Copy link
Contributor

reset commented Aug 16, 2011

This comment https://github.com/resolve/refinerycms/pull/878#issuecomment-1811801 by @michaelklishin suggests that you can drop therubyracer in favor of relying on node.js being available which provides linux users with a js runtime.

I haven't tested this myself but I can give it a shot

@ugisozols
Copy link
Member

@resetexistence that is if you have node.js installed (like Travis). Otherwise user have to install node.js separately...

@michaelklishin
Copy link
Contributor

You can move therubyracer out to a separate gem group and use bundler_args to exclude it on travis but still install it locally.

@parndt
Copy link
Member

parndt commented Aug 16, 2011

How complicated is node.js to install?

@reset
Copy link
Contributor

reset commented Aug 16, 2011

I think the best solution is to just wrap therubyracer gem dependency in an unless ENV['TRAVIS'] block and ensure that the node.js cookbook is run on the Travis worker.

@michaelklishin
Copy link
Contributor

@parndt

brew install node

@parndt
Copy link
Member

parndt commented Aug 16, 2011

@michaelklishin what about on linux?

@reset
Copy link
Contributor

reset commented Aug 16, 2011

It's pretty easy to clone from git and install from source - it's also precompiled and in most package management systems

@ugisozols
Copy link
Member

Maybe we can drop therubyracer altogether and leave it to the user to decided what to install. Just like rails do - you have to figure it out yourself as you are just presented with single message - "Could not find a JavaScript runtime. See https://github.com/sstephenson/execjs for a list of available runtimes."

@michaelklishin
Copy link
Contributor

on linux getting a reasonably recent Node version (0.4.x) package is a pain. If you are not running Ubuntu or Debian, twice the pain. Building from source is very easy.

Anyway, bundler_args or what @resetexistence has suggested will let you use Node on travis and whatever you want locally.

@reset
Copy link
Contributor

reset commented Aug 16, 2011

I agree with @ugisozols, it's a pretty friendly error message with a link to a helpful way to grab a JS runtime for your OS

@michaelklishin
Copy link
Contributor

For future googling generations: travis-ci cookbooks have Node.js .deb package for Debian and Ubuntu (0.4.8 today and will be kept up-to-date in the future).

@parndt
Copy link
Member

parndt commented Aug 16, 2011

Is there any way we can be more helpful to developers who hit this error? Like can we wrap it with something like:

"This is not an issue with Refinery, you merely have to specify your favourite runtime; here's how to solve this:" (I don't know if this is even possible)

This is because otherwise we'll keep having issues filed because people will think it's a "bug we don't know about" rather than the way that Rails works.

@michaelklishin
Copy link
Contributor

@parndt I personally agree with that idea but because Rails core forces this asset pipeline stuff down everyone's throat (they say they don't but we all see what happens in reality), it will be very well known very soon. I even expect there to be another drama, à la rbenv.

With travis-ci cookbooks being 100% open source, we will do our best to help Ubuntu and Debian users to get .deb package that is up to date, or even the whole Chef cookbook. You can point people to our repo. Homebrew keeps OS X users covered. Windows will have Node at some point, too.

@parndt
Copy link
Member

parndt commented Aug 16, 2011

@michaelklishin thanks for the help with this.

Who wants to patch it? ;-)

@ugisozols
Copy link
Member

@parndt do we really need to patch it? It's not something that Refinery CMS is causing and if you type that error line in google the first result provides a "fix" for it. Apparently windows has js runtime out of the box too so it's just linux users that are in "trouble" :)

@jimjimovich
Copy link
Contributor Author

When I posted this, it was because things suddenly broke on my machine (Ubuntu) after getting a fresh copy of the master branch. I didn't realize this is more of a Rails issue than a Refinery one. Perhaps it'd be best to have therubyracer in the Gemfile but commented out with a short explanation for why it might be needed?

On one hand, Rails developers will be familiar with this "problem" soon enough. On the other hand, Refinery should be user friendly even for noobies and non-rails devs.

That's just my 2 cents. :)

@michaelklishin
Copy link
Contributor

so far I favor the "skip dependency when ENV["CI"] (or ENV["TRAVIS"]) is set" solution. But I am not a refinery user or contributor, so feel free to ignore me :)

@parndt
Copy link
Member

parndt commented Aug 16, 2011

You can be a Refinery contributor by sending a pull request. ;-) Join this wonderful list: https://github.com/resolve/refinerycms/contributors

@parndt
Copy link
Member

parndt commented Aug 17, 2011

So I removed it.

@parndt parndt closed this as completed Aug 17, 2011
@thiyagarajan
Copy link

Thanks

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

6 participants