如何在Rails 3.1中创建项目期间删除“bundle install”命令?

时间:2011-09-11 13:30:31

标签: ruby-on-rails gem bundle ruby-on-rails-3.1

我正在创建一个新项目:

rails new ggg --database=mysql

并获得以下输出:

create  
      create  README
      create  Rakefile
      create  config.ru
      create  .gitignore
      create  Gemfile
      create  app
      create  app/assets/images/rails.png
      create  app/assets/javascripts/application.js
      create  app/assets/stylesheets/application.css
      create  app/controllers/application_controller.rb
      create  app/helpers/application_helper.rb
      create  app/mailers
      create  app/models
      create  app/views/layouts/application.html.erb
      create  app/mailers/.gitkeep
      create  app/models/.gitkeep
      create  config
      create  config/routes.rb
      create  config/application.rb
      create  config/environment.rb
      create  config/environments
      create  config/environments/development.rb
      create  config/environments/production.rb
      create  config/environments/test.rb
      create  config/initializers
      create  config/initializers/backtrace_silencers.rb
      create  config/initializers/inflections.rb
      create  config/initializers/mime_types.rb
      create  config/initializers/secret_token.rb
      create  config/initializers/session_store.rb
      create  config/initializers/wrap_parameters.rb
      create  config/locales
      create  config/locales/en.yml
      create  config/boot.rb
      create  config/database.yml
      create  db
      create  db/seeds.rb
      create  doc
      create  doc/README_FOR_APP
      create  lib
      create  lib/tasks
      create  lib/tasks/.gitkeep
      create  lib/assets
      create  lib/assets/.gitkeep
      create  log
      create  log/.gitkeep
      create  public
      create  public/404.html
      create  public/422.html
      create  public/500.html
      create  public/favicon.ico
      create  public/index.html
      create  public/robots.txt
      create  script
      create  script/rails
      create  test/fixtures
      create  test/fixtures/.gitkeep
      create  test/functional
      create  test/functional/.gitkeep
      create  test/integration
      create  test/integration/.gitkeep
      create  test/unit
      create  test/unit/.gitkeep
      create  test/performance/browsing_test.rb
      create  test/test_helper.rb
      create  tmp/cache
      create  tmp/cache/assets
      create  vendor/assets/stylesheets
      create  vendor/assets/stylesheets/.gitkeep
      create  vendor/plugins
      create  vendor/plugins/.gitkeep
         run  bundle install

任务“捆绑安装”需要大量时间......大约30-40分钟。

如何删除它?

2 个答案:

答案 0 :(得分:39)

你想要--skip-bundle标志:

rails new ggg --database=mysql --skip-bundle

但是,要运行新应用,您仍然需要执行bundle install,因此您应该确定为什么需要这么长时间。

答案 1 :(得分:0)

要更永久地解决您的问题,请创建常规的rails应用。是的,我知道你可能需要很长时间。

rails new ggg --database=mysql

然后,在应用内部,进行捆绑安装--system:

cd ggg
bundle install --system

这会将您必须在项目文件夹中本地安装的所有宝石复制到系统文件夹中。从现在开始,创建新项目将很快。