TE
科技回声
首页24小时热榜最新最佳问答展示工作
GitHubTwitter
首页

科技回声

基于 Next.js 构建的科技新闻平台,提供全球科技新闻和讨论内容。

GitHubTwitter

首页

首页最新最佳问答展示工作

资源链接

HackerNews API原版 HackerNewsNext.js

© 2025 科技回声. 版权所有。

Ask HN: Who’s using Ruby for web development, without Ruby on Rails?

51 点作者 vanilla-almond超过 2 年前
Ruby on Rails (RoR) dominates web development in Ruby. It&#x27;s rich in features, but it&#x27;s also a heavyweight framework.<p>Do you eschew RoR and use an alternative Ruby web development approach? (Example: different framework, or writing your own framework)

30 条评论

kyledrake超过 2 年前
I like Ruby but I don&#x27;t like Rails. No idea if this is better now but I would get weird exceptions that would be from metaprogramming goofiness that was really difficult to debug and find documentation for, and it uniquely bothers me when I can&#x27;t figure out where errors are coming from in code (same critique of async&#x2F;nodejs). The general heaviness also just didn&#x27;t mesh well with my programming style, I like things cleaner and more simple.<p>The Neocities frontend is basically something much simpler built on top of Sinatra and I haven&#x27;t regretted that decision at all. It&#x27;s (relatively) clean and simple, and if I need to do something weird that doesn&#x27;t conform to the paradigm (this happens a lot), it quickly gets out of my way. You can generally do anything you want with Rails, but in my experience that more frequently involves digging through a bunch of documentation and google searches to try to figure out how to get the framework out of my way.<p>I&#x27;ve also found ruby to be a really solid language for doing lower level glue tasks, for an unusual example I use it to glue a redis database to powerdns, which serves a lot of query requests, it&#x27;s plenty fast and very reliable. I&#x27;ve never had to rip out ruby from something more performance-oriented and replace it with something &quot;faster&quot;.<p>At the same time if I had a team of 10 people I was working with I might appreciate Rails keeping everybody on the same design structure so I there&#x27;s not an endless battle over how it should be put together, but in my past experience this kind of just happens with Rails too.
评论 #34354904 未加载
评论 #34355148 未加载
评论 #34355394 未加载
评论 #34355350 未加载
评论 #34374839 未加载
评论 #34355812 未加载
WJW超过 2 年前
I see a fair amount of companies writing internal services in sinatra&#x2F;hanami&#x2F;etc and using Rails for user-facing routes. The smaller frameworks are great but as soon as you hook up an ORM, user session management, conditional view rendering for different clients, background jobs, caches and all the rest then you often end up with a worse Rails. If you have a service that you know upfront will need not need that then the simpler frameworks are a much better choice.
davidthewatson超过 2 年前
I worked with a four person startup tech team that shipped a production rails system in six months based on a python&#x2F;flask&#x2F;mongo prototype that I demoed in a week a decade ago that is still being used and sold today, though I&#x27;m not sure of its technical evolution.<p>I&#x27;ve built a few Sinatra&#x2F;Flask systems since, so I&#x27;m definitely a fan of the virtue of simplicity, no matter the language.<p>The design mistake here is not applying lessons learned reading Danny Greenfeld&#x27;s book (which I don&#x27;t believe shipped before 2012) on Django and realizing the chapter on &quot;vanilla Django&quot; applies just as much to any system, like &quot;vanilla Rails&quot;, because they are the same &quot;stranger in a strange land&quot; problems where the system as we know it becomes undocumented and unbounded by architectural style - a kind of McMansion Hell for system design.<p>The use of DSLs is complex territory. When in the hands of a master, amazing work can happen, but when too many DSLs are combined together, you wind up with exactly the opposite of what Greenfeld described in the chapter on vanilla Django, you wind up with byzantine Rails, because the boundaries that Alan Kay described decades earlier are not architectural. As with much software, there is no physics, real or implied, that applies to the phenomenological understanding of the system, the individual and social human scaling of brains that turns out to be a larger problem than computer hardware and software scaling.<p>There is a semantic asymptote, if you will, where the problem leaves the empirical world and becomes phenomenological - very difficult to share socially unless you are Kay, Knuth, or one of their contemporaries.
thunderbong超过 2 年前
I&#x27;ve been on the Roda [0] and Sequel [1] framework for over 10 years now across various projects. Even after all these years, starting a project in this stack feels like a breath of fresh air even compared to the newer language&#x2F;frameworks that jabe come out since.<p>Jeremy Evans is the creator and maintainer of both of these Ruby gems and is super helpful in resolving ask kinda of issues.<p>[0]: <a href="https:&#x2F;&#x2F;roda.jeremyevans.net&#x2F;" rel="nofollow">https:&#x2F;&#x2F;roda.jeremyevans.net&#x2F;</a><p>[1]: <a href="https:&#x2F;&#x2F;sequel.jeremyevans.net&#x2F;" rel="nofollow">https:&#x2F;&#x2F;sequel.jeremyevans.net&#x2F;</a>
veesahni超过 2 年前
We[0] use Ruby without Rails - Sinatra for the most part.<p>I started the codebase over a decade ago now, and at the time Rails felt a little heavy (inline with your comments). That said, Rails does let you get started pretty quickly without needing much of anything else.<p>Rails has more magic. If you prefer less magic, then Sinatra is the way.<p>0: <a href="https:&#x2F;&#x2F;www.enchant.com" rel="nofollow">https:&#x2F;&#x2F;www.enchant.com</a>
评论 #34374876 未加载
quest88超过 2 年前
What do you mean by &quot;heavyweight&quot;? Also why is it a problem that something is &quot;heavyweight&quot;?<p>What problem are you trying to solve by asking these questions? What context is this question for? Are you curious how many people use a non-rails solutions for enterprise apps? Cloud apps? Personal projects? Apps you want users to pay for? A blog?<p>I&#x27;d suggest stating what problem you&#x27;d like to solve by asking this question so you can receive more detailed feedback. For example, if your company is spinning up a new app and you&#x27;re evaluating choices, someone may respond that they used sinatra but found themselves reinventing rails so they wish they would have used rails. I&#x27;d say this is more insightful than &quot;yea, we use sinatra&quot;. Alternatively, maybe someone used sinatra for a personal project and found the experience of reinventing rails rewarding and educational on their own time. Let us help you!
评论 #34354882 未加载
评论 #34354684 未加载
评论 #34354985 未加载
评论 #34358193 未加载
juanse超过 2 年前
I am a solopreneur with Smart Kiosks running on Raspberry pi.<p>The whole service (which isn&#x27;t too complex) is a file script in Ruby managed through SystemD. This script turns off&#x2F;on the screen based on API calls, and is also in charge of scheduled&#x2F;remote restarts, pinging the backend and stuff like that.<p>What I like the most is how easy and reliable is. Beeing a below average guy, ruby makes really easy to combine system calls, API calls and shell commands within the same context.
cortesoft超过 2 年前
We have a lot of internal APIs written using Sinatra.<p>I first started writing my APIs using Sinatra about 10 years ago. I had started with Rails when it first came out around 2005, liked it, but then ran up against a lot of issues. Sinatra and the Sequel gem were amazing so I switched to that, since I didn’t need most of what Rails had.<p>Now I just use those two out of habit. Rails is a LOT better now, but i still just reach for Sinatra and Sequel usually.
评论 #34354924 未加载
评论 #34354770 未加载
评论 #34354628 未加载
huimang超过 2 年前
There&#x27;s Sinatra for more barebones things, but honestly, homegrown solutions always grow into a shittier version of Rails. You don&#x27;t have to use all of the features Rails provides. As others have mentioned, for simple APIs Sinatra is fine.
评论 #34366573 未加载
评论 #34354979 未加载
drchiu超过 2 年前
Ruby is pretty good for writing scripts to run in the terminal. For things where I need to do a bunch of string manipulations, I prefer it over something like creating a shell script.
评论 #34356061 未加载
评论 #34355031 未加载
评论 #34367781 未加载
mxhoncharov超过 2 年前
I haven&#x27;t touch Rails in production for more than 3 years now. My main stack is roda+sequel+rspec+aws and it&#x27;s awesome. It gives me a ton of flexibility because I&#x27;m not limited with common approaches and I can add any tools I want and implement any solutions I feel might be better. My stack is only a part of global world of gems. Anytime we can make own tools with our vision and it&#x27;s amazing.
bradgessler超过 2 年前
I went the opposite direction and built a static site generator on top of Rails: <a href="https:&#x2F;&#x2F;sitepress.cc&#x2F;" rel="nofollow">https:&#x2F;&#x2F;sitepress.cc&#x2F;</a><p>Turns out, Rails is a really good web framework! I tried building Sitepress on something “light weight”, Tilt and Rack, and it was a pain. I found myself constantly solving the same problems that were already solved in Rails. At some point it dawned on me that I could just build on top of a few parts of Rails, so I did. I wrote about it at <a href="https:&#x2F;&#x2F;fly.io&#x2F;ruby-dispatch&#x2F;single-file-rails-app&#x2F;">https:&#x2F;&#x2F;fly.io&#x2F;ruby-dispatch&#x2F;single-file-rails-app&#x2F;</a><p>I’m glad I did! Now I can plug all of the Rails template handlers, view components, and other Rails plugins into it and ride off that entire community’s docs.<p>If you find yourself thinking, “rails is too heavy”, consider shedding the parts of Rails that you don’t need. Then as your application grows in complexity and you find yourself needing more parts of Rails, bring it back in.
aidog超过 2 年前
Made my &quot;own&quot; static page generator using chatgpt recently: kramdown for markdown, erb for layout, filewatcher to reprocess on file changes, rss and sitemap. docker-compose file with nginx pointed at the out directory. Deploying with git. Works great.
dorcus_maximus超过 2 年前
I&#x27;ve been a Rubyist for over ten years. I&#x27;ve never built using Rails. I&#x27;ve been stuck with Ramaze because of decisions that were made long ago. Betting I&#x27;m the only person here using Ramaze...Plan to convert to something else, probably Sinatra but not Rails, if I&#x27;m ever given the bandwidth.
RickHull超过 2 年前
<a href="https:&#x2F;&#x2F;socketry.github.io&#x2F;falcon&#x2F;" rel="nofollow">https:&#x2F;&#x2F;socketry.github.io&#x2F;falcon&#x2F;</a> looks pretty nice but I haven&#x27;t used it anger yet. Async fibers FTW.<p>I have a small project to explore the various multitasking paradigms in Ruby, here: <a href="https:&#x2F;&#x2F;github.com&#x2F;rickhull&#x2F;miner_mover">https:&#x2F;&#x2F;github.com&#x2F;rickhull&#x2F;miner_mover</a>
hanamimastery超过 2 年前
I solely use Hanami since 1.5 year, and I had never looked back!<p>It provides everything needed, while still allowing to fully control which features I want to disable.
rubyist5eva超过 2 年前
We have a Rails monolith with a couple internal Sinatra services if that counts. To be honest, I love working with Sinatra and Sequel (when using an ORM) vs. working with Rails and ActiveRecord. We provide public apis via. Grape, but that&#x27;s mounted as an engine inside our monolith vs. deploying our own Grape application on Rack just for operational simplicity.
quechimba超过 2 年前
I&#x27;ve been working on a framework for a while. It&#x27;s a server side VDOM that streams updates to a small JS runtime. Components are written in Haml. <a href="https:&#x2F;&#x2F;github.com&#x2F;mayu-live&#x2F;framework">https:&#x2F;&#x2F;github.com&#x2F;mayu-live&#x2F;framework</a>
评论 #34374900 未加载
dorianmariefr超过 2 年前
Stripe uses Ruby without Rails
评论 #34354832 未加载
ksherlock超过 2 年前
I&#x27;ve used ruby&#x2F;sinatra&#x2F;passenger&#x2F;nginx for a few projects -- html&#x2F;preact&#x2F;javascript front-end calling into the ruby backend. Sometimes python&#x2F;flask instead of ruby&#x2F;sinatra.
bitwize超过 2 年前
I work at a medical analytics company that uses Ruby + Sinatra. Our product is a &quot;real&quot; application that allows for sophisticated reporting drawing from huge data sets. No Rails is involved.
BirAdam超过 2 年前
I’ve done some simple CGI stuff in Ruby before. Those are normally for ephemeral tasks tho, not anything intended to be used long term.
wintorez超过 2 年前
Monitoring this to see who will mention Hanami
评论 #34355001 未加载
orangeplus超过 2 年前
Chef rules everything around me
评论 #34355024 未加载
Alifatisk超过 2 年前
I see people mentioning Sinatra a lot, do you write everything from scratch or is there a scaffolding tool?<p>I&#x27;ve used Sinatra plenty of times but only used as a backend api, no frontend rendering.
syx超过 2 年前
yet another comment about Sinatra, I&#x27;ve been using it for 10 years, first on heroku now on fly.io. It&#x27;s such a great and stable framework, most people probably don&#x27;t even need RoR.
brightball超过 2 年前
A lot of people use Sinatra for this type of thing.
thinking001001超过 2 年前
Been a few years since I tried Rails (I don&#x27;t do much web development), but seriously considering giving it another try. I do wonder if a &quot;Lite&quot; version of Rails could happen somehow - DHH was talking about JSON APIs in his latest blog post, and indeed they are more no-ops than an SQL database.<p>I have tried Ruby CGI but very barebones - no MVC.<p>I haven&#x27;t tried Sinatra, but someone at a Ruby web development company told me Sinatra works for APIs but difficult for websites, but it isn&#x27;t battle-tested like Rails.
评论 #34374917 未加载
notwedtm超过 2 年前
Sinatra is my go to for barebones pages-style server side rendering.
whalesalad超过 2 年前
There aren’t many compelling reasons to choose ruby without rails, for a greenhorn project. unless you already have a big pool of devs who know and enjoy ruby, and&#x2F;or a lot of home grown gems&#x2F;libraries.