Skip to content

Commit

Permalink
Merge pull request #40 from zombocom/schneems/databae-dollars
Browse files Browse the repository at this point in the history
Updating Rails 7, 6, and 5
  • Loading branch information
schneems authored Jun 6, 2023
2 parents 10a9c66 + 7ed528f commit 39b48b1
Show file tree
Hide file tree
Showing 5 changed files with 430 additions and 351 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ gem 'rundoc'
Run the `rundoc build` command on any markdown file

```sh
$ rundoc build --path my/path/to/run_doc.md
$ bin/rundoc build --path <test/fixtures/rails_7/rundoc.md>
```

> Note: This command will create and manipulate directories in the working directory of your source markdown file. Best practice is to have your source markdown file in its own empty directory.
Expand Down
43 changes: 38 additions & 5 deletions test/fixtures/rails_4/rundoc.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,14 +12,17 @@ end
https://github.com/schneems/rundoc/blob/main/test/fixtures/rails_4/rundoc.md
-->

> warning
> This article is archived. It is no longer receiving updates. It is presented here for historical reference only.
> We cannot guarantee that any statements made are correct or that the instructions will still work.
> This version of Rails is [no longer supported by Ruby core](https://guides.rubyonrails.org/maintenance_policy.html).
> If you are starting a new application, we recommend you use the most recently released version of Rails.
>warning
>As of November 28th, 2022, free Heroku dynos, free Heroku Postgres and free Heroku Data for Redis plans are [no longer available](https://blog.heroku.com/next-chapter).
>
>We recommend using our [low-cost plans](https://blog.heroku.com/new-low-cost-plans) to complete this tutorial. Eligible students can apply for platform credits through our new [Heroku for GitHub Students program](https://blog.heroku.com/github-student-developer-program).
> warning
> The latest version of Rails available is [Rails 7](https://devcenter.heroku.com/articles/getting-started-with-rails7). If you are starting a new application we recommend you use the most recently released version.
Ruby on Rails is a popular web framework written in [Ruby](http://www.ruby-lang.org/). This guide covers using Rails 4 on Heroku. For information about running previous versions of Rails on Heroku, see [Getting Started with Rails 3.x on Heroku](getting-started-with-rails3).

> callout If you are already familiar with Heroku and Rails, reference the [simplifed Rails 4 on Heroku guide](https://devcenter.heroku.com/articles/rails4) instead. For general information on how to develop and architect apps for use on Heroku, see [Architecting Applications for Heroku](https://devcenter.heroku.com/articles/architecting-apps).
Expand Down Expand Up @@ -496,6 +499,36 @@ end

Confirm it works locally, then push to Heroku.

## Done
## Next Steps

Congratulations on deploying a Rails 5 application! To continue exploring, review the following articles next:

* Visit the [Ruby support category](/categories/ruby-support) to learn more about using Ruby and Rails on Heroku.
* The [Deployment category](/categories/deployment) provides a variety of powerful integrations and features to help streamline and simplify your deployments.

## Deleting your app and Add-on

If you don't need this application and database, you can now remove them from your account. You'll only be charged for the resources you used.

>warning
>This will remove your add-on you'll lose any data saved in the database.
```term
$ heroku addons:destroy heroku-postgresql
```

>warning
>This will delete your application
```term
$ heroku apps:destroy
```

You can confirm that your add-on and app are gone with the commands:

```term
$ heroku addons --all
$ heroku apps -all
```

You now have your first application deployed to Heroku. The next step is to deploy your own application. If you're interested in reading more you can read more about [Ruby on Heroku at the Devcenter](https://devcenter.heroku.com/categories/ruby).
You're now ready to <a href= "https://devcenter.heroku.com/articles/preparing-a-codebase-for-heroku-deployment" target= "_blank">deploy your app</a>.
55 changes: 40 additions & 15 deletions test/fixtures/rails_5/rundoc.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,18 +15,21 @@ end
$ bin/rundoc build --path test/fixtures/rails_5/rundoc.md
-->

> warning
> This article is archived. It is no longer receiving updates. It is presented here for historical reference only.
> We cannot guarantee that any statements made are correct or that the instructions will still work.
> This version of Rails is [no longer supported by Ruby core](https://guides.rubyonrails.org/maintenance_policy.html).
> If you are starting a new application, we recommend you use the most recently released version of Rails.
>warning
>As of November 28th, 2022, free Heroku dynos, free Heroku Postgres and free Heroku Data for Redis plans are [no longer available](https://blog.heroku.com/next-chapter).
>
>We recommend using our [low-cost plans](https://blog.heroku.com/new-low-cost-plans) to complete this tutorial. Eligible students can apply for platform credits through our new [Heroku for GitHub Students program](https://blog.heroku.com/github-student-developer-program).
> warning
> The latest version of Rails available is [Rails 7](https://devcenter.heroku.com/articles/getting-started-with-rails7). If you are starting a new application we recommend you use the most recently released version.
Ruby on Rails is a popular web framework written in [Ruby](http://www.ruby-lang.org/). This guide covers using Rails 5 on Heroku. For information on running previous versions of Rails on Heroku, see the tutorial for [Rails 4.x](getting-started-with-rails4) or [Rails 3.x](getting-started-with-rails3).

```
:::-- $ ruby -e "exit 1 unless RUBY_VERSION == '2.7.2'"
:::-- $ ruby -e "exit 1 unless RUBY_VERSION == '2.7.8'"
```

For this guide you will need:
Expand Down Expand Up @@ -75,6 +78,8 @@ Then move into your application directory.

```term
:::>- $ cd myapp
:::>> $ bundle lock --add-platform x86_64-linux --add-platform ruby
:::>- $ bundle install
```

Create a database locally:
Expand Down Expand Up @@ -173,7 +178,7 @@ Rails 5 requires Ruby 2.2.0 or above. Heroku has a recent version of Ruby instal
```ruby
:::-- $ sed -i'' -e '/^ruby/d' ./Gemfile
:::-> file.append Gemfile#4
ruby "2.7.2"
ruby "2.7.8"
```

You should also be running the same version of Ruby locally. You can check this by running `$ ruby -v`. You can get more information on [specifying your Ruby version on Heroku here](https://devcenter.heroku.com/articles/ruby-versions).
Expand Down Expand Up @@ -244,14 +249,7 @@ Provision a Postgresql database using Add-ons.
>A `mini` Postgres size costs [$5 a month, prorated to the minute](https://elements.heroku.com/addons/heroku-postgresql). At the end of this tutorial, you will be prompted to [delete your database](https://devcenter.heroku.com/articles/heroku-postgresql#removing-the-add-on) to minimize costs.
```term
$ heroku addons:create heroku-postgresql:mini
Creating heroku-postgresql:mini on ⬢ shrouded-anchorage-34700... $5/month
Database has been created and is available
! This database is empty. If upgrading, you can transfer
! data from another database with pg:copy
Created postgresql-encircled-75487 as DATABASE_URL
Use heroku addons:docs heroku-postgresql to view documentation
:::>> $ heroku addons:create heroku-postgresql:mini
```

Your Heroku app now has access to a Postgresql database. The credentials are stored in the `DATABASE_URL` environment variable, which Rails will connect to by convention.
Expand Down Expand Up @@ -475,9 +473,36 @@ end

Confirm it works locally, then push to Heroku.

## Next steps
## Next Steps

Congratulations! You have deployed your first Rails 5 application to Heroku. Here's some recommended reading:
Congratulations on deploying a Rails 5 application! To continue exploring, review the following articles next:

* Visit the [Ruby support category](/categories/ruby-support) to learn more about using Ruby and Rails on Heroku.
* The [Deployment category](/categories/deployment) provides a variety of powerful integrations and features to help streamline and simplify your deployments.

## Deleting your app and Add-on

If you don't need this application and database, you can now remove them from your account. You'll only be charged for the resources you used.

>warning
>This will remove your add-on you'll lose any data saved in the database.
```term
$ heroku addons:destroy heroku-postgresql
```

>warning
>This will delete your application
```term
$ heroku apps:destroy
```

You can confirm that your add-on and app are gone with the commands:

```term
$ heroku addons --all
$ heroku apps -all
```

You're now ready to <a href= "https://devcenter.heroku.com/articles/preparing-a-codebase-for-heroku-deployment" target= "_blank">deploy your app</a>.
Loading

0 comments on commit 39b48b1

Please sign in to comment.