question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Is Rails supported on Now?

See original GitHub issue

OS: OSX 10.14.6 Node: 10.16.0 Ruby: 2.6.1 Now CLI 16.1 Rails: 6.0

Hi,

I’m having issues running Rails locally using now dev and on now.

Locally with now dev Reproduction steps:

  1. rails new rails-app
  2. Create a now.json with contents:
{
  "version": 2,
  "builds": [
    {
      "src": "rails-app/config.ru",
      "use": "@now/ruby"
    }
  ],
  "routes": [{ "src": "/", "dest": "rails-app/config.ru" }]
}

  1. now dev yields:
> Creating initial build

> Error! Command failed with exit code 2 (ENOENT): yum install -y git gcc make tar bzip2 readline-devel openssl-devel ruby-devel zlib-devel
spawn yum ENOENT

On now

  1. rails new rails-app
  2. Create a now.json with contents:
{
  "version": 2,
  "builds": [
    {
      "src": "rails-app/config.ru",
      "use": "@now/ruby"
    }
  ],
  "routes": [{ "src": "/", "dest": "rails-app/config.ru" }]
}
  1. Now yields:
yarn info @now/build-utils@latest...
yarn info @now/ruby...
yarn add @now/build-utils@0.10.0...
yarn add v1.17.3
info No lockfile found.
[1/4] Resolving packages...
[2/4] Fetching packages...
[3/4] Linking dependencies...
[4/4] Building fresh packages...
success Saved lockfile.
success Saved 1 new dependency.
info Direct dependencies
└─ @now/build-utils@0.10.0
info All dependencies
└─ @now/build-utils@0.10.0
Done in 0.56s.
yarn add @now/ruby@0.1.6...
yarn add v1.17.3
info No lockfile found.
[1/4] Resolving packages...
[2/4] Fetching packages...
[3/4] Linking dependencies...
[4/4] Building fresh packages...
success Saved lockfile.
success Saved 1 new dependency.
info Direct dependencies
└─ @now/ruby@0.1.6
info All dependencies
└─ @now/ruby@0.1.6
Done in 1.10s.
TypeError: util.getSystemErrorName is not a function
    at getCode (/tmp/e97d8416e11caeb8/.build-utils/.builder/node_modules/@now/ruby/dist/index.js:28461:16)
    at makeError (/tmp/e97d8416e11caeb8/.build-utils/.builder/node_modules/@now/ruby/dist/index.js:28500:35)
    at handlePromise (/tmp/e97d8416e11caeb8/.build-utils/.builder/node_modules/@now/ruby/dist/index.js:3759:26)
    at <anonymous>
    at process._tickDomainCallback (internal/process/next_tick.js:228:7)
worker exited with code 20 and signal null
done
done

Deployment URL: rails-64wuh4wd8.now.sh

Any idea what this could be?

Issue Analytics

  • State:closed
  • Created 4 years ago
  • Comments:6 (4 by maintainers)

github_iconTop GitHub Comments

1reaction
styflecommented, Sep 12, 2019

Hi @antonnyman

It is possible to use Rails as you mentioned because we support Rack. The tests ensure that our Rack implementation works with known Ruby frameworks.

Rails is not recommended because, like many legacy web frameworks, it is not optimized for serverless. So you will certainly hit limitations such as 50MB max size, slow cold starts, maybe even slower builds.

Maybe the docs could in the future specify which parts of Rails you can use, like the API parts?

We recommend creating an api directory containing your functions. The platform will handle routing for you so you don’t need an additional framework. Then add a index.html file in the root for your home page.

See the intro documentation here: https://zeit.co/docs/v2/serverless-functions/introduction

0reactions
antonnymancommented, Sep 12, 2019

Thanks for the explanation @styfle.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Maintenance Policy for Ruby on Rails
Maintenance Policy for Ruby on Rails. Support of the Rails framework is divided into four groups: New features, bug fixes, security issues, and...
Read more >
RubyMine Plans to Retire Support for Rails 3 and Other ...
That said, please note that Rails 3 will no longer be supported starting with the next major release – RubyMine 2022.2. This means...
Read more >
Rails Latest Version: The changes introduced in Rails 7.0.4
The current stable version of rails, 7.0.4, brought a number of changes which we will go through below. Active Support. Two changes here....
Read more >
Rails 6 Now Supported! - Cloud 66 Blog
Rails 6 is out now and this release brings a number of long-awaited features and changes e.g. ActionMailbox, ActionText, multiple databases ...
Read more >
Rails now provides pattern matching support for ActiveModel
The most important feature that was released in Ruby 2.7 was Pattern Matching. This feature is common in most functional programming ...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found