Is Rails supported on Now?
See original GitHub issueOS: 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:
rails new rails-app
- Create a
now.json
with contents:
{
"version": 2,
"builds": [
{
"src": "rails-app/config.ru",
"use": "@now/ruby"
}
],
"routes": [{ "src": "/", "dest": "rails-app/config.ru" }]
}
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
rails new rails-app
- Create a
now.json
with contents:
{
"version": 2,
"builds": [
{
"src": "rails-app/config.ru",
"use": "@now/ruby"
}
],
"routes": [{ "src": "/", "dest": "rails-app/config.ru" }]
}
- 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:
- Created 4 years ago
- Comments:6 (4 by maintainers)
Top 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 >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
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.
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 aindex.html
file in the root for your home page.See the intro documentation here: https://zeit.co/docs/v2/serverless-functions/introduction
Thanks for the explanation @styfle.