百科.dev
全部条目AI 编程趋势榜开源项目技术资讯提交条目
登录
< 返回工具列表
R

rails-composer

> 编程语言
开源

Rails Composer。针对初级应用程序的强大 Rails 生成器。

3.4K stars0 点赞0 次浏览
访问官网GitHub

工具介绍

Rails Composer。针对初级应用程序的强大 Rails 生成器。

h1. !http://railsapps.github.io/images/rails-36x36.jpg(Rails Composer)! Rails Composer An application template that creates starter applications for Rails. It's the Rails generator on steroids. Watch the videos: * "Rails Composer Introduction":https://fullstackvideos.com/videos/13 (for beginners) * "RailsClips Episode 007: Rails Composer":https://devchat.tv/rails-clips/007-railsclips-rails-composer from Charles Max Wood. |_. |_. | | !http://railsapps.github.io/images/rails-composer-mailing-list.png(Sign up for the Rails Composer mailing list)!:http://mailinglist.railscomposer.com/ | !http://railsapps.github.io/images/join/join-railsapps.png(Join the RailsApps Project)!:http://railsapps.github.io/ | | "Rails Composer mailing list":http://mailinglist.railscomposer.com/ | "Support the project":http://railsapps.github.io/ | h4. From the RailsApps Project The "RailsApps":http://railsapps.github.io/ open source project offers starter applications and tutorials for Rails developers. Generate the applications with the Rails Composer tool. All the code is explained in the Capstone Rails Tutorials. You can purchase the "Capstone Rails Tutorials":https://tutorials.railsapps.org/ to support the project. "Sign up for the Rails Composer mailing list":http://mailinglist.railscomposer.com/ for news and announcements. h2. Starter Apps and Tutorials |_. Example |_. Tutorial |_. Comments | | "learn-rails":https://github.com/RailsApps/learn-rails | "Learn Ruby on Rails":http://learn-rails.com/learn-ruby-on-rails.html | from the book for beginners | | "rails-bootstrap":https://github.com/RailsApps/rails-bootstrap | "Rails and Bootstrap":http://railsapps.github.io/twitter-bootstrap-rails.html | Bootstrap front-end framework | | "rails-foundation":https://github.com/RailsApps/rails-foundation | "Rails and Foundation":http://railsapps.github.io/rails-foundation.html | Foundation front-end framework | | "rails-mailinglist-activejob":https://github.com/RailsApps/rails-mailinglist-activejob | "Mailing List with Active Job Tutorial":https://tutorials.railsapps.org/ | sign up for a mailing list using background processing | | "rails-omniauth":https://github.com/RailsApps/rails-omniauth | "OmniAuth Tutorial":https://tutorials.railsapps.org/ | authentication with OmniAuth | | "rails-devise":https://github.com/RailsApps/rails-devise | "Rails Devise Tutorial":https://tutorials.railsapps.org/ | authentication with Devise | | "rails-devise-roles":https://github.com/RailsApps/rails-devise-roles | "Role-Based Authorization":https://tutorials.railsapps.org/ | authorization with roles | | "rails-devise-pundit":https://github.com/RailsApps/rails-devise-pundit | "Rails Pundit Tutorial":https://tutorials.railsapps.org/ | authorization with Pundit | | "rails-signup-download":https://github.com/RailsApps/rails-signup-download | "Rails Signup Download":https://tutorials.railsapps.org/ | Devise plus download a PDF file | | "rails-stripe-checkout":https://github.com/RailsApps/rails-stripe-checkout | "Stripe Checkout":https://tutorials.railsapps.org/ | selling a product with Stripe Checkout | | "rails-stripe-coupons":https://github.com/RailsApps/rails-stripe-coupons | "Stripe JS With Coupons":https://tutorials.railsapps.org/ | complex Rails and Stripe integration | h4. The rails_apps_composer Gem Do you want to customize the Rails Composer application template? The Rails Composer application template is built from recipes provided by the "rails_apps_composer":https://github.com/RailsApps/rails_apps_composer gem. h4. If You Are New to Rails If you're new to Rails, see "What is Ruby on Rails?":http://railsapps.github.io/what-is-ruby-rails.html, the book "Learn Ruby on Rails":http://learn-rails.com/learn-ruby-on-rails.html, and recommendations for a "Rails tutorial":https://tutorials.railsapps.org/rails-tutorial. h2. Dependencies Before running the Rails Composer tool, you need to install: * The Ruby language * Rails Check that appropriate versions of Ruby and Rails are installed in your development environment: @$ ruby -v@ @$ rails -v@ Be sure to read the article "Installing Rails":http://railsapps.github.io/installing-rails.html to make sure your development environment is set up properly. h2. How To Use Rails Composer To build a Rails application using the Rails Composer tool:
$ rails new myapp -m https://raw.github.com/RailsApps/rails-composer/master/composer.rb
Replace @myapp@ with the name of your application. The @$@ character indicates a shell prompt; don't include it when you run the command. See the "Troubleshooting" section below if you see errors. In general, you'll avoid problems if you create your application using RVM as described in the next section. h3. Creating a Starter App Using RVM I recommend using "RVM":https://rvm.io/, the Ruby Version Manager, to manage your Rails versions, as described in the "Installing Rails":http://railsapps.github.io/installing-rails.html article. Here's how to generate a new Rails application using the Rails Composer tool and RVM:
$ mkdir myapp
$ cd myapp
$ rvm use ruby-2.4.0@myapp --ruby-version --create
$ gem install rails
$ rails new . -m https://raw.github.com/RailsApps/rails-composer/master/composer.rb
Instead of installing Rails into the global gemset and running @rails new@, we'll create a root directory for a new application, create a new gemset, install Rails, and then generate a starter application. When we create the gemset, the option "--ruby-version" creates *.ruby-version* and *.ruby-gemset* files in the root directory. RVM recognizes these files in an application's root directory and loads the required version of Ruby and the correct gemset whenever you enter the directory. When we create the gemset, it will be empty (though it inherits use of all the gems in the global gemset). We immediately install Rails. The command @gem install rails@ installs the most recent stable release of Rails. Finally we run @rails new .@. We use the Unix "dot" convention to refer to the current directory. This assigns the name of the directory to the new application. This approach is different from the way most beginners are taught to create a Rails application. Our approach makes it easy to create a project-specific gemset to avoid clashes between gem versions when using the Rails Composer tool. h2. Choose a RailsApps Starter Application Use Rails Composer to generate any of the example applications from the "RailsApps project":http://railsapps.github.io/. You'll be able to choose your own project name when you generate the app. Generating the application gives you additional options. To build the example application, Rails must be installed in your development environment. You'll see a prompt:
option  Build a starter application?
    1)  Build a RailsApps example application
    2)  Contributed applications
    3)  Custom application
Enter "1" to select *Build a starter application*. You'll see a prompt:
option  Choose a starter application.
    1)  learn-rails
    2)  rails-bootstrap
    3)  rails-foundation
    4)  rails-mailinglist-activejob
    5)  rails-omniauth
    6)  rails-devise
    7)  rails-devise-roles
    8)  rails-devise-pundit
    9)  rails-signup-download
   10)  rails-stripe-checkout
   11)  rails-stripe-coupons
Each of these applications is available as an example in the "RailsApps GitHub repo":https://github.com/RailsApps and each is accompanied by a tutorial on the "Capstone Rails Tutorials":https://tutorials.railsapps.org/ site. Make your choice. The Rails Composer tool may give you other options (other applications may have been added since these notes were written). h4. Options The application generator template will ask you for additional preferences. Options vary, depending on the example application you build. Options may have changed in a newer version of Rails Composer.
 option  Web server for development?
       1)  WEBrick (default)
       2)  Thin
       3)  Unicorn
       4)  Puma
       5)  Phusion Passenger (Apache/Nginx)
       6)  Phusion Passenger (Standalone)
 option  Web server for production?
       1)  Same as development
       2)  Thin
       3)  Unicorn
       4)  Puma
       5)  Phusion Passenger (Apache/Nginx)
       6)  Phusion Passenger (Standalone)
 option  Database used in development?
       1)  SQLite
       2)  PostgreSQL
       3)  MySQL
 option  Template engine?
       1)  ERB
       2)  Haml
       3)  Slim
 option  Test framework?
       1)  None
       2)  RSpec with Capybara
 option  Front-end framework?
       1)  None
       2)  Bootstrap 3.0
       3)  Bootstrap 2.3
       4)  Zurb Foundation 5.0
       5)  Zurb Foundation 4.0
       6)  Simple CSS
 option  Install page-view analytics?
       1)  None
       2)  Google Analytics
       3)  Segment.io
   extras  Set a robots.txt file to ban spiders? (y/n)
   extras  Create a GitHub repository? (y/n)
   extras  Use or create a project-specific rvm gemset? (y/n)
h4. Web Servers If you plan to deploy to Heroku, select Puma as your production webserver. Puma is recommended by Heroku. h4. Database Choose "SQLite" for the easiest setup. If you choose PostgreSQL or MySQL, the databases must be installed and running before you run Rails Composer. h4. Template Engine The example applications use the default "ERB" Rails template engine. Optionally, you can use another template engine, such as Haml or Slim. See instructions for "Haml and Rails":http://railsapps.github.io/rails-haml.html. h4. Testing If you are a beginner, select "None." Select "RSpec with Capybara" if you want tests. h4. Front-end Framework If you choose a front-end framework, you'll get an application layout file, plus navigation and flash messages, styled with a default theme. h4. Other Choices Set a robots.txt file to ban spiders if you want to keep your new site out of Google search results. If you choose to create a GitHub repository, the generator will prompt you for a GitHub username and password. It is a good idea to use "RVM":https://rvm.io/, the Ruby Version Manager, and create a project-specific rvm gemset (not available on Windows). See "Installing Rails":http://railsapps.github.io/installing-rails.html. h2. Contributed Applications Currently, there are no contributed applications available. If you would like to add your favorite starter application to Rails Composer, open an issue to let us know. h2. Build Your Own Application If you choose "Custom application," you will get a wide set of choices. Not all are actively supported. A large community of developers contributes code that supports additional gems and favorite configurations offered with the "build your own options." However, not all contributions are actively maintained. That means not all options are tested or fully supported, so you may need to spend time debugging a "build your own application." When you choose "Custom application," you will see something similar to this:
option  Build a starter application?
      1)  Build a RailsApps example application
      2)  Contributed applications
      3)  Custom application

option  Web server for development?
      1)  WEBrick (default)
      2)  Thin
      3)  Unicorn
      4)  Puma
      5)  Phusion Passenger (Apache/Nginx)
      6)  Phusion Passenger (Standalone)

option  Web server for production?
      1)  Same as development
      2)  Thin
      3)  Unicorn
      4)  Puma
      5)  Phusion Passenger (Apache/Nginx)
      6)  Phusion Passenger (Standalone)

option  Database used in development?
      1)  SQLite
      2)  PostgreSQL
      3)  MySQL

option  Template engine?
      1)  ERB
      2)  Haml
      3)  Slim

option  Test framework?
      1)  None
      2)  RSpec with Capybara

option  Continuous testing?
      1)  None
      2)  Guard

option  Front-end framework?
      1)  None
      2)  Bootstrap 3.0
      3)  Bootstrap 2.3
      4)  Zurb

GitHub Issues· 45 开放

在 GitHub 查看全部
  • #283

    [Feature request] Support for Rails 6.0.0

    更新于 2022年6月9日
  • #284

    "File unchanged! The supplied flag value not found!" error on creation of starter app

    更新于 2020年7月18日
  • #281

    Enhancement: even margins

    更新于 2019年1月16日
  • #280

    Vulnerable version of bootstrap 4 provided

    更新于 2019年1月16日
  • #279

    Rails 5.2.0 - Ruby 2.5.1 - composer fails when composing mysql at higher version

    更新于 2018年9月17日
  • #206

    Crashes when installing gems, `apply': uninitialized constant Rails::Generators::AppGenerator::RVM (NameError)

    更新于 2018年9月7日
  • #227

    postgres socket connection without password not working

    更新于 2018年6月21日
  • #268

    Petergate: Easy Authorization library.

    更新于 2018年6月17日
  • #278

    ripgrep complains about errors in .gitignore

    更新于 2018年5月4日
  • #273

    Sass is breaking on @extend “.bg-faded”

    更新于 2018年2月10日

核心特点

  • •"Rails Composer Introduction":https://fullstackvideos.com/videos/13 (for beginners)
  • •"RailsClips Episode 007: Rails Composer":https://devchat.tv/rails-clips/007-railsclips-rails-composer from Charles Max Wood.
  • •The Ruby language

> 标签

Ruby

暂无评论,来聊聊你的看法吧

> 工具信息

发布日期2026年8月1日
最后更新2026年9月17日
分类编程语言
定价开源

> 相关工具

T
TypeScript
JavaScript 的超集,为前端与全栈提供静态类型
P
Python
通用编程语言,广泛用于 Web、数据与 AI
G
Go
Google 推出的简洁高效系统语言