Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/armcknight/rails-hello-world
A simple Hello, World! server app using Rails.
https://github.com/armcknight/rails-hello-world
Last synced: about 2 months ago
JSON representation
A simple Hello, World! server app using Rails.
- Host: GitHub
- URL: https://github.com/armcknight/rails-hello-world
- Owner: armcknight
- License: mit
- Created: 2018-09-25T21:32:25.000Z (over 6 years ago)
- Default Branch: master
- Last Pushed: 2023-01-19T11:19:51.000Z (almost 2 years ago)
- Last Synced: 2024-10-13T17:48:19.027Z (3 months ago)
- Language: Ruby
- Homepage:
- Size: 31 MB
- Stars: 0
- Watchers: 2
- Forks: 1
- Open Issues: 8
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# rails-hello-world
A simple “Hello world!” [Rails](https://rubyonrails.org) app with a PostreSQL database that works with [`rbenv`](https://github.com/rbenv/rbenv).
## Create from scratch
```sh
# make sure we have rails
rbenv exec gem install rails --no-ri --no-doc# create new rails app
rbenv exec rails new myapp --database=postgresql --skip-bundle --skip-git # we'll bundle ourselves after configuring how to do it, and don't let rails create its own Git repo–that's up to you!pushd myapp
# install/package dependencies declared by rails in Gemfile
rbenv exec bundle package --path=vendor/bundle# create the “Hello world!” view/controller
rbenv exec bundle exec rails generate controller welcome # we're now bundle exec'ing rails because it was installed via the Gemfile created with rails new ...
echo "Hello World!
" > app/views/welcome/index.html.erb# add route to welcome app's index
sed -i '' 's/end/ root \'welcome#index\'\
end/g' config/routes.rb# add a Procfile for Heroku
echo "web: rails server
local: rbenv exec bundle exec rails server" > Procfilepopd
```## Deployment
### Local
```sh
pushd myapp
rbenv exec bundle exec rails server &
open http://localhost:3000
popd
```### Locally with Heroku
```sh
pushd myapp
heroku local local &
open http://localhost:5000
popd
```## Remote
### Heroku
```sh
heroku create # make sure your ‘heroku’ git remote points to the correct app's git url, like if there was a previous one
git push heroku master
heroku open
```## References
- [Getting Started on Heroku with Rails 5.x](https://devcenter.heroku.com/articles/getting-started-with-rails5#create-a-new-rails-app-or-upgrade-an-existing-one)
> Note: References preserved as PDFs in `docs/`.
# Contribute
Issues and pull requests are welcome!
If this project helped you, please consider leaving a tip 🤗
Do you need help with a project? [I'm currently available for hire or contract.](http://tworingsoft.com/contracts).