Git Product home page Git Product logo

rails-on-repl's Introduction

UPDATE NOTICE: Recently, running Rails applications on Repl.it have become much easier. Ruby REPLs now run with bundler context so there isn't any need to configure the run command yourself, except to tell Rails to run on host 0.0.0.0 instead of localhost. Find more info at the official blog. This repo will be archived.

Rails on Repl.it

Repl.it is an online programming IDE with support for 50 languages and free hosting for web applications of any type (almost). That being said, support for running Rails applications is pretty doodoo, and for a site who's selling point is minimal setup and configuration, it's quite a pain to deploy Rails apps. This repo is intented to streamline the proccess of creating Ruby on Rails applications within a REPL and deploy it on Repl.it.

Setup an RoR app

  1. Create a new Ruby REPL.

  2. Open the shell and run the following commands in order:

    • rm main.rb
    • git clone https://github.com/IreTheKID/rails-on-repl.git .
    • bundle install --clean --path .bundle
  3. Create a new Rails app with your desired options:

    • bundle exec rails new . --minimal --api
  4. Allow all overwrites by entering a when prompted:

    • Overwrite /home/runner/~/README.md? (enter "h" for help) [Ynaqdhm] a
  5. Navigate to config/environments/development.rb and clear the hosts like so:

Rails.application.configure do
    # other code...
    config.hosts.clear
end
  1. Hit RUN and enjoy!

NOTE - Because the Web-View tab in the IDE only allows traffic from the repl's host, you'll have to open your app in a new tab to view it. ¯\_(ツ)_/¯

BONUS - Here are the commands for making a bare minimum Rails app:

bundle exec rails new . --skip-keeps --skip-action-mailer --skip-action-mailbox --skip-action-text --skip-active-record --skip-active-storage --skip-puma --skip-action-cable --skip-sprockets --skip-spring --skip-listen --skip-turbolinks --skip-test --skip-system-test --skip-bootsnap --api

rm -rf app/jobs app/models config/initializers config/locales lib log public tmp vendor config/environments/test.rb config/environments/production.rb config/credentials.yml.enc config/master.key bin/rake bin/setup bin/bundle

rails-on-repl's People

Contributors

frissyn avatar

Stargazers

 avatar  avatar  avatar

Forkers

galtdea

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.