# How to create a new Rails app running Rails 7.1 beta or main branch

### New app with Rails 7.1.beta1

Here is how to create a new Rails app that runs on Rails 7.1 beta1

```bash
gem install -v 7.1.0.beta1 rails

rails _7.1.0.beta1_ new myrails71app
```

Replace `myrails71app` with your own app name and you are good to go.

This will generate a `Gemfile` that has something like this inside and then install required gems for `Rails 7.1.0.beta1`

```ruby
# Gemfile

gem "rails", "~> 7.1.0.beta1"
```

### New app with Rails main branch

Here is how to create a new Rails app that runs on Rails main branch from GitHub:

```bash
rails new myrailsapp --main
```

This will generate a `Gemfile` that has something like this inside:

```ruby
gem "rails", github: "rails/rails", branch: "main"
```

May you have a lot of ideas to try!

---

Enjoyed this article?

👉 Join my [**Short Ruby News**](https://shortruby.com/) **newsletter** for weekly Ruby updates from the community and visit [**rubyandrails.info**](http://rubyandrails.info)**,** a directory with learning content about Ruby.

👐 Subscribe to my Ruby and Ruby on rails courses over email at [learn.shortruby.com](https://learn.shortruby.com) - effortless learning anytime, anywhere

🤝 Let's connect on [**Ruby.social**](https://ruby.social/@lucian) or [**Linkedin**](https://linkedin.com/in/lucianghinda) or [**Twitter**](https://x.com/lucianghinda) where I post mainly about Ruby and Rails.

🎥 Follow me on [**my YouTube channel**](https://www.youtube.com/@shortruby) for short videos about Ruby
