Skip to content

therubyracer gem is now added to the Gemfile on systems that do not have... - #4405

Closed
brentsowers1 wants to merge 2 commits into
rails:masterfrom
brentsowers1:missing_js_runtime_fix
Closed

brentsowers1 wants to merge 2 commits into
rails:masterfrom
brentsowers1:missing_js_runtime_fix

Conversation

@brentsowers1

Copy link
Copy Markdown

... a Javascript runtime (Linux without node js). Without this gem an error is reported by execjs

Issues #412 and #4020

I've tested this on Ubuntu with and without nodejs, and on Windows, and it works correctly, the Gemfile contains a line for therubyracer only on Ubuntu without nodejs

…ave a Javascript runtime (Linux without node js). Without this gem an error is reported by execjs
@guilleiguaran

Copy link
Copy Markdown
Member

I tried a similar approach but some Core members are against (and I agree) the complexity added in the method to detect multiple runtimes under multiple OS.

cc @josevalim @jonleighton

@jrochkind

Copy link
Copy Markdown
Contributor

The thing is, right now on Linux, when you run rails new, you do not actually get a runnable app. Run rails new, try to start your app, you get an error message directing you to a web page.

Until the asset pipeline, it was always true that rails new would give you a runnable app (thanks to sqlite3). Which is a great thing, immediate satisfaction, especially to newbies.

I think currently, this is a fairly frustrating thing for newbies, their first experience with rails is an error message, leading them to a web page that can be somewhat confusing for the newbie.

Added complexity? I think improving the experience to what it used to be -- rails new gives you a runnable app -- is probably worth 35 lines of code.

I wonder how many of the people who are against this routinely develop on linux, where it's an issue.

@jrochkind

Copy link
Copy Markdown
Contributor

(Ideally, I think it might add a comment to the Gemfile explaining that therubyracer is a js runtime, required for the asset pipeline, added because generator did not detect a built-in js runtime, not required on hosts that already provide their own JS runtime detectable by execjs)

@guilleiguaran

Copy link
Copy Markdown
Member

See #3619 for discussion

@brentsowers1

Copy link
Copy Markdown
Author

See my pull request for this same change on the 3.1 branch, tenderlove made a comment and I responded. #4407

@jrochkind I'm totally on board with you. rails new should give you an app that can run immediately. New users are already overwhelmed by all of the pieces of Ruby and Rails (bundle, rake, gems, these are all totally new concepts to them). Forcing them to go to the github page for execjs, pick one of the options listed there, and figure out how
to implement their choice is a lot to ask a newbie that just wants to see the Welcome to Rails page. Good suggestion on adding a comment about what therubyracer is. I'll add that, and see if I can figure out how to add the commit to the pull request.

…ks, always require therubyracer gem on Linux regardless of whether node.js is installed
@brentsowers1

Copy link
Copy Markdown
Author

I made a new pull request #4435 for this, after I took out the runtime detection and changed it to assume that Linux requires the gem, which was suggested by tenderlove in pull request 4407. #4435

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

Successfully merging this pull request may close these issues.

3 participants