https://github.com/bmsandoval/rubits
Documenting my descent into Ruby
https://github.com/bmsandoval/rubits
rails ruby
Last synced: 5 months ago
JSON representation
Documenting my descent into Ruby
- Host: GitHub
- URL: https://github.com/bmsandoval/rubits
- Owner: Bmsandoval
- Created: 2022-04-20T02:00:10.000Z (about 4 years ago)
- Default Branch: master
- Last Pushed: 2022-04-22T23:39:45.000Z (about 4 years ago)
- Last Synced: 2023-02-28T09:05:50.262Z (over 3 years ago)
- Topics: rails, ruby
- Language: Ruby
- Homepage:
- Size: 26.4 KB
- Stars: 0
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: readme.md
Awesome Lists containing this project
README
### Following instructions expect homebrew
```bash
/bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)"
```
### Install recent ruby environment manager
```bash
brew install rbenv ruby-build
```
### Add to bashrc
```bash
cat << EOL > ~/.bashrc
# load rbenv every time you open a terminal
echo 'if which rbenv > /dev/null; then eval "$(rbenv init -)"; fi' >>
EOL
```
### Update profiles
```bash
source ~/.bashrc
```
### Install Ruby via rbenv
```bash
rbenv install 3.1.1
```
### Set global ruby version
```bash
rbenv global 3.1.1
```
### Update gem
```bash
gem install rubygems-update
update_rubygems
gem update --system
```
### Install rails
```bash
sudo gem install rails
```
### Make rbenv detect new packages
```bash
rbenv rehash
```
### Ensure you are on the 'develop' branch
```bash
git checkout develop
```
### Install Dependencies
```bash
bundle install
```
### Try running the unit test suite
```bash
rails test
```
### Run the server
```bash
rails server
```
### Test the server
```bash
curl localhost:3000/say \
-H 'Content-Type: application/json' \
-d '{"message": "Hello from RapidAPI", "cow": "stegosaurus", "balloon_type": "think"}' \
| ruby -r json -e "print JSON.parse(STDIN.read)['message']"
```