-G doesn't work when generating an app #183

Closed
icco opened this Issue Jun 16, 2013 · 1 comment

Comments

Projects
None yet
2 participants

icco commented Jun 16, 2013

Looks like you're trying to append to a file that doesn't exist (which is weird that it doesn't work...)

Could possibly be a bug in Thor I guess...

$ suspenders TestTest -G
      create  
      create  README.md
      create  Rakefile
      create  config.ru
      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/views/layouts/application.html.erb
      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/assets
      create  log
      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  tmp/cache
      create  tmp/cache/assets
      create  vendor/assets/javascripts
      create  vendor/assets/stylesheets
      create  vendor/plugins
      remove  public/index.html
      remove  app/assets/images/rails.png
      remove  Gemfile
      create  Gemfile
      insert  Gemfile
         run  bundle install --binstubs=bin/stubs
Fetching gem metadata from https://rubygems.org/.......
Fetching gem metadata from https://rubygems.org/..
Resolving dependencies...
Using rake (10.0.4) 
Using i18n (0.6.1) 
Using multi_json (1.7.7) 
Using activesupport (3.2.13) 
Using builder (3.0.4) 
Using activemodel (3.2.13) 
Using erubis (2.7.0) 
Using journey (1.0.4) 
Using rack (1.4.5) 
Using rack-cache (1.2) 
Using rack-test (0.6.2) 
Using hike (1.2.3) 
Using tilt (1.4.1) 
Using sprockets (2.2.2) 
Using actionpack (3.2.13) 
Using mime-types (1.23) 
Using polyglot (0.3.3) 
Using treetop (1.4.14) 
Using mail (2.5.4) 
Using actionmailer (3.2.13) 
Using arel (3.0.2) 
Using tzinfo (0.3.37) 
Using activerecord (3.2.13) 
Using activeresource (3.2.13) 
Using addressable (2.3.4) 
Using json (1.8.0) 
Using airbrake (3.1.12) 
Using coderay (1.0.9) 
Using better_errors (0.9.0) 
Using debug_inspector (0.0.2) 
Using binding_of_caller (0.7.2) 
Using sass (3.2.9) 
Using thor (0.18.1) 
Using bourbon (3.1.8) 
Using metaclass (0.0.1) 
Using mocha (0.13.3) 
Using bourne (1.4.0) 
Using bundler (1.3.5) 
Using mini_portile (0.5.0) 
Using nokogiri (1.6.0) 
Using xpath (2.0.0) 
Using capybara (2.1.0) 
Using capybara-webkit (1.0.0) 
Using coffee-script-source (1.6.2) 
Using execjs (1.4.0) 
Using coffee-script (2.2.0) 
Using rack-ssl (1.3.3) 
Using rdoc (3.12.2) 
Using railties (3.2.13) 
Using coffee-rails (3.2.2) 
Using database_cleaner (1.0.1) 
Using delayed_job (3.0.5) 
Using delayed_job_active_record (4.0.0.beta3) 
Using diff-lcs (1.2.4) 
Using dotenv (0.8.0) 
Using factory_girl (4.2.0) 
Using factory_girl_rails (4.2.1) 
Using flutie (2.0.0) 
Using foreman (0.63.0) 
Using high_voltage (1.2.3) 
Using jquery-rails (3.0.1) 
Using kgio (2.8.0) 
Using launchy (2.3.0) 
Using newrelic_rpm (3.6.3.111) 
Using pg (0.15.1) 
Using rack-timeout (0.0.4) 
Using rails (3.2.13) 
Using raindrops (0.11.0) 
Using recipient_interceptor (0.1.1) 
Using rspec-core (2.13.1) 
Using rspec-expectations (2.13.0) 
Using rspec-mocks (2.13.1) 
Using rspec-rails (2.13.2) 
Using sass-rails (3.2.6) 
Using sham_rack (1.3.6) 
Using shoulda-matchers (2.2.0) 
Using simple_form (2.1.0) 
Using simplecov-html (0.7.1) 
Using simplecov (0.7.1) 
Using strong_parameters (0.2.1) 
Using timecop (0.6.1) 
Using uglifier (2.1.1) 
Using unicorn (4.6.2) 
Your bundle is complete!
Use `bundle show [gemname]` to see where a bundled gem is installed.
Setting up database
       force  config/database.yml
         run  bundle exec rake db:create
TestTest_development already exists
TestTest_test already exists
Setting up the development environment
      insert  config/environments/development.rb
      create  bin/setup
         run  chmod a+x bin/setup from "."
Setting up the test environment
      create  spec/support/factory_girl.rb
      create  spec/models/factories_spec.rb
      append  Rakefile
    generate  rspec:install
      create  .rspec
       exist  spec
      create  spec/spec_helper.rb
      remove  .rspec
      create  .rspec
     prepend  spec/spec_helper.rb
      insert  spec/spec_helper.rb
      insert  config/application.rb
      create  spec/support/background_jobs.rb
         run  rails g delayed_job:active_record from "."
      create  script/delayed_job
       chmod  script/delayed_job
      create  db/migrate/20130616221035_create_delayed_jobs.rb
      create  spec/support/database_cleaner.rb
      append  spec/spec_helper.rb
Setting up the production environment
      create  config/initializers/smtp.rb
     prepend  config/environments/production.rb
      insert  config/environments/production.rb
Setting up the staging environment
         run  cp config/environments/production.rb config/environments/staging.rb from "."
     prepend  config/environments/staging.rb
      insert  config/application.rb
Creating suspenders views
      create  app/views/application
      create  app/views/application/_flashes.html.erb
      create  app/views/application/_javascript.html.erb
       force  app/views/layouts/application.html.erb
Pulling in some common javascripts
       exist  app/assets/javascripts
      create  app/assets/javascripts/prefilled_input.js
Add jQuery ui to the standard application.js
      insert  app/assets/javascripts/application.js
Configuring app
      insert  config/environments/development.rb
      insert  config/environments/test.rb
      insert  config/environments/staging.rb
      insert  config/environments/production.rb
      create  config/initializers/strong_parameters.rb
      insert  config/application.rb
      remove  config/locales/en.yml
      create  config/locales/en.yml
      create  config/initializers/rack_timeout.rb
      create  config/initializers/disable_xml_params.rb
      create  app/validators/email_validator.rb
      append  Rakefile
      create  config/unicorn.rb
      create  .sample.env
      create  Procfile
Set up stylesheets
      create  app/assets/stylesheets/application.css.scss
      remove  app/assets/stylesheets/application.css
      append  app/assets/stylesheets/application.css.scss
      create  app/assets/stylesheets/_screen.scss
Copying miscellaneous support files
      create  config/initializers/errors.rb
Customizing the 500/404/422 pages
      insert  public/500.html
      insert  public/404.html
      insert  public/422.html
Initializing git
      append  .gitignore
/Users/nat/.rvm/gems/ruby-1.9.3-p362/gems/thor-0.18.1/lib/thor/actions/inject_into_file.rb:99:in `binread': No such file or directory - /Users/nat/tmp/TestTest/.gitignore (Errno::ENOENT)
    from /Users/nat/.rvm/gems/ruby-1.9.3-p362/gems/thor-0.18.1/lib/thor/actions/inject_into_file.rb:99:in `replace!'
    from /Users/nat/.rvm/gems/ruby-1.9.3-p362/gems/thor-0.18.1/lib/thor/actions/inject_into_file.rb:60:in `invoke!'
    from /Users/nat/.rvm/gems/ruby-1.9.3-p362/gems/thor-0.18.1/lib/thor/actions.rb:95:in `action'
    from /Users/nat/.rvm/gems/ruby-1.9.3-p362/gems/thor-0.18.1/lib/thor/actions/inject_into_file.rb:31:in `insert_into_file'
    from /Users/nat/.rvm/gems/ruby-1.9.3-p362/gems/thor-0.18.1/lib/thor/actions/file_manipulation.rb:181:in `append_to_file'
    from /Users/nat/.rvm/gems/ruby-1.9.3-p362/gems/railties-3.2.13/lib/rails/generators/rails/app/app_generator.rb:24:in `method_missing'
    from /Users/nat/.rvm/gems/ruby-1.9.3-p362/gems/suspenders-1.3.0/lib/suspenders/actions.rb:5:in `concat_file'
    from /Users/nat/.rvm/gems/ruby-1.9.3-p362/gems/suspenders-1.3.0/lib/suspenders/app_builder.rb:227:in `gitignore_files'
    from /Users/nat/.rvm/gems/ruby-1.9.3-p362/gems/railties-3.2.13/lib/rails/generators/app_base.rb:96:in `build'
    from /Users/nat/.rvm/gems/ruby-1.9.3-p362/gems/suspenders-1.3.0/lib/suspenders/generators/app_generator.rb:155:in `setup_gitignore'
    from /Users/nat/.rvm/gems/ruby-1.9.3-p362/gems/thor-0.18.1/lib/thor/command.rb:27:in `run'
    from /Users/nat/.rvm/gems/ruby-1.9.3-p362/gems/thor-0.18.1/lib/thor/invocation.rb:120:in `invoke_command'
    from /Users/nat/.rvm/gems/ruby-1.9.3-p362/gems/thor-0.18.1/lib/thor/group.rb:231:in `dispatch'
    from /Users/nat/.rvm/gems/ruby-1.9.3-p362/gems/thor-0.18.1/lib/thor/invocation.rb:109:in `invoke'
    from /Users/nat/.rvm/gems/ruby-1.9.3-p362/gems/suspenders-1.3.0/lib/suspenders/generators/app_generator.rb:136:in `setup_git'
    from /Users/nat/.rvm/gems/ruby-1.9.3-p362/gems/thor-0.18.1/lib/thor/command.rb:27:in `run'
    from /Users/nat/.rvm/gems/ruby-1.9.3-p362/gems/thor-0.18.1/lib/thor/invocation.rb:120:in `invoke_command'
    from /Users/nat/.rvm/gems/ruby-1.9.3-p362/gems/thor-0.18.1/lib/thor/group.rb:231:in `dispatch'
    from /Users/nat/.rvm/gems/ruby-1.9.3-p362/gems/thor-0.18.1/lib/thor/invocation.rb:109:in `invoke'
    from /Users/nat/.rvm/gems/ruby-1.9.3-p362/gems/suspenders-1.3.0/lib/suspenders/generators/app_generator.rb:39:in `suspenders_customization'
    from /Users/nat/.rvm/gems/ruby-1.9.3-p362/gems/thor-0.18.1/lib/thor/command.rb:27:in `run'
    from /Users/nat/.rvm/gems/ruby-1.9.3-p362/gems/thor-0.18.1/lib/thor/invocation.rb:120:in `invoke_command'
    from /Users/nat/.rvm/gems/ruby-1.9.3-p362/gems/thor-0.18.1/lib/thor/group.rb:231:in `dispatch'
    from /Users/nat/.rvm/gems/ruby-1.9.3-p362/gems/thor-0.18.1/lib/thor/invocation.rb:109:in `invoke'
    from /Users/nat/.rvm/gems/ruby-1.9.3-p362/gems/suspenders-1.3.0/lib/suspenders/generators/app_generator.rb:19:in `finish_template'
    from /Users/nat/.rvm/gems/ruby-1.9.3-p362/gems/thor-0.18.1/lib/thor/command.rb:27:in `run'
    from /Users/nat/.rvm/gems/ruby-1.9.3-p362/gems/thor-0.18.1/lib/thor/invocation.rb:120:in `invoke_command'
    from /Users/nat/.rvm/gems/ruby-1.9.3-p362/gems/thor-0.18.1/lib/thor/invocation.rb:127:in `block in invoke_all'
    from /Users/nat/.rvm/gems/ruby-1.9.3-p362/gems/thor-0.18.1/lib/thor/invocation.rb:127:in `each'
    from /Users/nat/.rvm/gems/ruby-1.9.3-p362/gems/thor-0.18.1/lib/thor/invocation.rb:127:in `map'
    from /Users/nat/.rvm/gems/ruby-1.9.3-p362/gems/thor-0.18.1/lib/thor/invocation.rb:127:in `invoke_all'
    from /Users/nat/.rvm/gems/ruby-1.9.3-p362/gems/thor-0.18.1/lib/thor/group.rb:233:in `dispatch'
    from /Users/nat/.rvm/gems/ruby-1.9.3-p362/gems/thor-0.18.1/lib/thor/base.rb:439:in `start'
    from /Users/nat/.rvm/gems/ruby-1.9.3-p362/gems/suspenders-1.3.0/bin/suspenders:16:in `<top (required)>'
    from /Users/nat/.rvm/gems/ruby-1.9.3-p362/bin/suspenders:19:in `load'
    from /Users/nat/.rvm/gems/ruby-1.9.3-p362/bin/suspenders:19:in `<main>'
    from /Users/nat/.rvm/gems/ruby-1.9.3-p362/bin/ruby_noexec_wrapper:14:in `eval'
    from /Users/nat/.rvm/gems/ruby-1.9.3-p362/bin/ruby_noexec_wrapper:14:in `<main>'
$ suspenders TestTest 
      create  
      create  README.md
      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/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  tmp/cache
      create  tmp/cache/assets
      create  vendor/assets/javascripts
      create  vendor/assets/javascripts/.gitkeep
      create  vendor/assets/stylesheets
      create  vendor/assets/stylesheets/.gitkeep
      create  vendor/plugins
      create  vendor/plugins/.gitkeep
      remove  public/index.html
      remove  app/assets/images/rails.png
      remove  Gemfile
      create  Gemfile
      insert  Gemfile
         run  bundle install --binstubs=bin/stubs
Fetching gem metadata from https://rubygems.org/.......
Fetching gem metadata from https://rubygems.org/..
Resolving dependencies...
Using rake (10.0.4) 
Using i18n (0.6.1) 
Using multi_json (1.7.7) 
Using activesupport (3.2.13) 
Using builder (3.0.4) 
Using activemodel (3.2.13) 
Using erubis (2.7.0) 
Using journey (1.0.4) 
Using rack (1.4.5) 
Using rack-cache (1.2) 
Using rack-test (0.6.2) 
Using hike (1.2.3) 
Using tilt (1.4.1) 
Using sprockets (2.2.2) 
Using actionpack (3.2.13) 
Using mime-types (1.23) 
Using polyglot (0.3.3) 
Using treetop (1.4.14) 
Using mail (2.5.4) 
Using actionmailer (3.2.13) 
Using arel (3.0.2) 
Using tzinfo (0.3.37) 
Using activerecord (3.2.13) 
Using activeresource (3.2.13) 
Using addressable (2.3.4) 
Using json (1.8.0) 
Using airbrake (3.1.12) 
Using coderay (1.0.9) 
Using better_errors (0.9.0) 
Using debug_inspector (0.0.2) 
Using binding_of_caller (0.7.2) 
Using sass (3.2.9) 
Using thor (0.18.1) 
Using bourbon (3.1.8) 
Using metaclass (0.0.1) 
Using mocha (0.13.3) 
Using bourne (1.4.0) 
Using bundler (1.3.5) 
Using mini_portile (0.5.0) 
Using nokogiri (1.6.0) 
Using xpath (2.0.0) 
Using capybara (2.1.0) 
Using capybara-webkit (1.0.0) 
Using coffee-script-source (1.6.2) 
Using execjs (1.4.0) 
Using coffee-script (2.2.0) 
Using rack-ssl (1.3.3) 
Using rdoc (3.12.2) 
Using railties (3.2.13) 
Using coffee-rails (3.2.2) 
Using database_cleaner (1.0.1) 
Using delayed_job (3.0.5) 
Using delayed_job_active_record (4.0.0.beta3) 
Using diff-lcs (1.2.4) 
Using dotenv (0.8.0) 
Using factory_girl (4.2.0) 
Using factory_girl_rails (4.2.1) 
Using flutie (2.0.0) 
Using foreman (0.63.0) 
Using high_voltage (1.2.3) 
Using jquery-rails (3.0.1) 
Using kgio (2.8.0) 
Using launchy (2.3.0) 
Using newrelic_rpm (3.6.3.111) 
Using pg (0.15.1) 
Using rack-timeout (0.0.4) 
Using rails (3.2.13) 
Using raindrops (0.11.0) 
Using recipient_interceptor (0.1.1) 
Using rspec-core (2.13.1) 
Using rspec-expectations (2.13.0) 
Using rspec-mocks (2.13.1) 
Using rspec-rails (2.13.2) 
Using sass-rails (3.2.6) 
Using sham_rack (1.3.6) 
Using shoulda-matchers (2.2.0) 
Using simple_form (2.1.0) 
Using simplecov-html (0.7.1) 
Using simplecov (0.7.1) 
Using strong_parameters (0.2.1) 
Using timecop (0.6.1) 
Using uglifier (2.1.1) 
Using unicorn (4.6.2) 
Your bundle is complete!
Use `bundle show [gemname]` to see where a bundled gem is installed.
Setting up database
       force  config/database.yml
         run  bundle exec rake db:create
TestTest_development already exists
TestTest_test already exists
Setting up the development environment
      insert  config/environments/development.rb
      create  bin/setup
         run  chmod a+x bin/setup from "."
Setting up the test environment
      create  spec/support/factory_girl.rb
      create  spec/models/factories_spec.rb
      append  Rakefile
    generate  rspec:install
      create  .rspec
       exist  spec
      create  spec/spec_helper.rb
      remove  .rspec
      create  .rspec
     prepend  spec/spec_helper.rb
      insert  spec/spec_helper.rb
      insert  config/application.rb
      create  spec/support/background_jobs.rb
         run  rails g delayed_job:active_record from "."
      create  script/delayed_job
       chmod  script/delayed_job
      create  db/migrate/20130616222741_create_delayed_jobs.rb
      create  spec/support/database_cleaner.rb
      append  spec/spec_helper.rb
Setting up the production environment
      create  config/initializers/smtp.rb
     prepend  config/environments/production.rb
      insert  config/environments/production.rb
Setting up the staging environment
         run  cp config/environments/production.rb config/environments/staging.rb from "."
     prepend  config/environments/staging.rb
      insert  config/application.rb
Creating suspenders views
      create  app/views/application
      create  app/views/application/_flashes.html.erb
      create  app/views/application/_javascript.html.erb
       force  app/views/layouts/application.html.erb
Pulling in some common javascripts
       exist  app/assets/javascripts
      create  app/assets/javascripts/prefilled_input.js
Add jQuery ui to the standard application.js
      insert  app/assets/javascripts/application.js
Configuring app
      insert  config/environments/development.rb
      insert  config/environments/test.rb
      insert  config/environments/staging.rb
      insert  config/environments/production.rb
      create  config/initializers/strong_parameters.rb
      insert  config/application.rb
      remove  config/locales/en.yml
      create  config/locales/en.yml
      create  config/initializers/rack_timeout.rb
      create  config/initializers/disable_xml_params.rb
      create  app/validators/email_validator.rb
      append  Rakefile
      create  config/unicorn.rb
      create  .sample.env
      create  Procfile
Set up stylesheets
      create  app/assets/stylesheets/application.css.scss
      remove  app/assets/stylesheets/application.css
      append  app/assets/stylesheets/application.css.scss
      create  app/assets/stylesheets/_screen.scss
Copying miscellaneous support files
      create  config/initializers/errors.rb
Customizing the 500/404/422 pages
      insert  public/500.html
      insert  public/404.html
      insert  public/422.html
Initializing git
      append  .gitignore
       exist  app/models
   identical  app/models/.gitkeep
       exist  app/assets/images
      create  app/assets/images/.gitkeep
      create  app/views/pages
      create  app/views/pages/.gitkeep
       exist  db/migrate
      create  db/migrate/.gitkeep
       exist  log
   identical  log/.gitkeep
       exist  spec/support
      create  spec/support/.gitkeep
      create  spec/lib
      create  spec/lib/.gitkeep
       exist  spec/models
      create  spec/models/.gitkeep
      create  spec/views
      create  spec/views/.gitkeep
      create  spec/controllers
      create  spec/controllers/.gitkeep
      create  spec/helpers
      create  spec/helpers/.gitkeep
      create  spec/support/matchers
      create  spec/support/matchers/.gitkeep
      create  spec/support/mixins
      create  spec/support/mixins/.gitkeep
      create  spec/support/shared_examples
      create  spec/support/shared_examples/.gitkeep
         run  git init from "."
Initialized empty Git repository in /Users/nat/tmp/TestTest/.git/
Congratulations! You just pulled our suspenders.
Remember to run 'rails generate airbrake' with your API key.
Copying libraries
Contributor

croaky commented Aug 1, 2013

Very strange. Sorry for the trouble. I took a closer look at the .gitignore and .keep bits and have come up with this solution, confirmed it works locally with -G:

#207

@croaky croaky closed this Aug 1, 2013

EdinaVath pushed a commit to EdinaVath/suspenders that referenced this issue Dec 25, 2013

Update .gitignore and .keep files
* These directories already exist and have a `.keep` file.
* Follow Rails' convention of `.keep` instead of `.gitkeep`.
* Totally replace `.gitignore` for cleanliness and to allow Suspenders
  to be run with thor's `-G` flag.

Fixes:

thoughtbot/suspenders#183
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment