HappyFunCorp / happy_seed

A seed for planting new apps.
http://seed.happyfuncorp.com
MIT License
119 stars 22 forks source link

Unable to generate rails app #42

Closed suchipi closed 9 years ago

suchipi commented 9 years ago

I'm using rbenv, ruby 2.2.1, and rails 4.2.0.

$ gem install happy_seed
Fetching: happy_seed-0.0.15.gem (100%)
Successfully installed happy_seed-0.0.15
1 gem installed
$ happy_seed rails myapp
      create  
      create  README.rdoc
      create  Rakefile
      create  config.ru
      create  .gitignore
      create  Gemfile
      create  app
      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/assets/images/.keep
      create  app/mailers/.keep
      create  app/models/.keep
      create  app/controllers/concerns/.keep
      create  app/models/concerns/.keep
      create  bin
      create  bin/bundle
      create  bin/rails
      create  bin/rake
      create  bin/setup
      create  config
      create  config/routes.rb
      create  config/application.rb
      create  config/environment.rb
      create  config/secrets.yml
      create  config/environments
      create  config/environments/development.rb
      create  config/environments/production.rb
      create  config/environments/test.rb
      create  config/initializers
      create  config/initializers/assets.rb
      create  config/initializers/backtrace_silencers.rb
      create  config/initializers/cookies_serializer.rb
      create  config/initializers/filter_parameter_logging.rb
      create  config/initializers/inflections.rb
      create  config/initializers/mime_types.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  lib
      create  lib/tasks
      create  lib/tasks/.keep
      create  lib/assets
      create  lib/assets/.keep
      create  log
      create  log/.keep
      create  public
      create  public/404.html
      create  public/422.html
      create  public/500.html
      create  public/favicon.ico
      create  public/robots.txt
      create  test/fixtures
      create  test/fixtures/.keep
      create  test/controllers
      create  test/controllers/.keep
      create  test/mailers
      create  test/mailers/.keep
      create  test/models
      create  test/models/.keep
      create  test/helpers
      create  test/helpers/.keep
      create  test/integration
      create  test/integration/.keep
      create  test/test_helper.rb
      create  tmp/cache
      create  tmp/cache/assets
      create  vendor/assets/javascripts
      create  vendor/assets/javascripts/.keep
      create  vendor/assets/stylesheets
      create  vendor/assets/stylesheets/.keep
       apply  /home/suchipi/.rbenv/versions/2.2.1/lib/ruby/gems/2.2.0/gems/happy_seed-0.0.15/happy_seed.rb
Setting up basic template

        gsub    Gemfile
     gemfile    haml-rails
     gemfile    httparty
     gemfile    group :development, :test
      append    Gemfile
     gemfile    sqlite3
     gemfile    rspec
     gemfile    rspec-rails
     gemfile    factory_girl_rails
     gemfile    capybara
     gemfile    cucumber-rails
     gemfile    guard-rspec
     gemfile    guard-cucumber
     gemfile    database_cleaner
     gemfile    spring-commands-rspec
     gemfile    spring-commands-cucumber
     gemfile    quiet_assets
     gemfile    launchy
     gemfile    vcr
     gemfile    faker
      append    Gemfile
     gemfile    group :test
      append    Gemfile
     gemfile    webmock
      append    Gemfile
     gemfile    group :production
      append    Gemfile
     gemfile    pg
      append    Gemfile
     gemfile    happy_seed
/home/suchipi/.rbenv/versions/2.2.1/lib/ruby/gems/2.2.0/gems/happy_seed-0.0.15/happy_seed.rb:42:in `apply': uninitialized constant Rails::Generators::AppGenerator::Bundler (NameError)
        from /home/suchipi/.rbenv/versions/2.2.1/lib/ruby/gems/2.2.0/gems/thor-0.19.1/lib/thor/actions.rb:223:in `instance_eval'
        from /home/suchipi/.rbenv/versions/2.2.1/lib/ruby/gems/2.2.0/gems/thor-0.19.1/lib/thor/actions.rb:223:in `apply'
        from /home/suchipi/.rbenv/versions/2.2.1/lib/ruby/gems/2.2.0/gems/railties-4.2.0/lib/rails/generators/app_base.rb:143:in `apply_rails_template'
        from (eval):1:in `apply_rails_template'
        from /home/suchipi/.rbenv/versions/2.2.1/lib/ruby/gems/2.2.0/gems/thor-0.19.1/lib/thor/command.rb:27:in `run'
        from /home/suchipi/.rbenv/versions/2.2.1/lib/ruby/gems/2.2.0/gems/thor-0.19.1/lib/thor/invocation.rb:126:in `invoke_command'
        from /home/suchipi/.rbenv/versions/2.2.1/lib/ruby/gems/2.2.0/gems/thor-0.19.1/lib/thor/invocation.rb:133:in `block in invoke_all'
        from /home/suchipi/.rbenv/versions/2.2.1/lib/ruby/gems/2.2.0/gems/thor-0.19.1/lib/thor/invocation.rb:133:in `each'
        from /home/suchipi/.rbenv/versions/2.2.1/lib/ruby/gems/2.2.0/gems/thor-0.19.1/lib/thor/invocation.rb:133:in `map'
        from /home/suchipi/.rbenv/versions/2.2.1/lib/ruby/gems/2.2.0/gems/thor-0.19.1/lib/thor/invocation.rb:133:in `invoke_all'
        from /home/suchipi/.rbenv/versions/2.2.1/lib/ruby/gems/2.2.0/gems/thor-0.19.1/lib/thor/group.rb:232:in `dispatch'
        from /home/suchipi/.rbenv/versions/2.2.1/lib/ruby/gems/2.2.0/gems/thor-0.19.1/lib/thor/base.rb:440:in `start'
        from /home/suchipi/.rbenv/versions/2.2.1/lib/ruby/gems/2.2.0/gems/railties-4.2.0/lib/rails/commands/application.rb:17:in `<top (required)>'
        from /home/suchipi/.rbenv/versions/2.2.1/lib/ruby/2.2.0/rubygems/core_ext/kernel_require.rb:69:in `require'
        from /home/suchipi/.rbenv/versions/2.2.1/lib/ruby/2.2.0/rubygems/core_ext/kernel_require.rb:69:in `require'
        from /home/suchipi/.rbenv/versions/2.2.1/lib/ruby/gems/2.2.0/gems/railties-4.2.0/lib/rails/cli.rb:14:in `<top (required)>'
        from /home/suchipi/.rbenv/versions/2.2.1/lib/ruby/2.2.0/rubygems/core_ext/kernel_require.rb:69:in `require'
        from /home/suchipi/.rbenv/versions/2.2.1/lib/ruby/2.2.0/rubygems/core_ext/kernel_require.rb:69:in `require'
        from /home/suchipi/.rbenv/versions/2.2.1/lib/ruby/gems/2.2.0/gems/railties-4.2.0/bin/rails:9:in `<top (required)>'
        from /home/suchipi/.rbenv/versions/2.2.1/bin/rails:23:in `load'
        from /home/suchipi/.rbenv/versions/2.2.1/bin/rails:23:in `<main>'
$
rreusser commented 9 years ago

@wschenk, looks like the same Bundler.with_clean_env issue that was causing @rezendi problems. I didn't get to the bottom of what precisely triggers this, but is it reasonable to remove this and push a new gem version? It wasn't clear to me that it was actually necessary for the thing to function.

wschenk commented 9 years ago

adding require ‘bundler’ to the happy_seed.rb script fixed it I think

--  Will Schenk http://happyfuncorp.com http://willschenk.com http://sublimeguile.com

From: Ricky Reusser notifications@github.com Reply: HappyFunCorp/happy_seed reply@reply.github.com> Date: April 21, 2015 at 6:28:20 PM To: HappyFunCorp/happy_seed happy_seed@noreply.github.com> Cc: Will Schenk wschenk@gmail.com> Subject:  Re: [happy_seed] Unable to generate rails app (#42)

@wschenk, looks like the same Bundler.with_clean_env issue that was causing @rezendi problems. I didn't get to the bottom of what precisely triggers this, but is it reasonable to remove this and push a new gem version? It wasn't clear to me that it was actually necessary for the thing to function.

— Reply to this email directly or view it on GitHub.

suchipi commented 9 years ago

Adding require 'bundler' as the first line of happy_seed.rb helped it to continue, but then it failed when it was unable to find spring-commands-rspec, spring-commands-cucumber, vcr, and webmock. After installing those gems with a gem install, it failed to compile pg because I don't have postgres installed, so I changed line 43 of happy_seed.rb from run "bundle install > /dev/null" to run "bundle install --without production > /dev/null".

johnrlive commented 9 years ago

Thanks @wschenk adding require 'bundler' as the first line of happy_seed.rb worked for me.

FYI my file was located here: _./Users/jr/.rbenv/versions/2.2.2/lib/ruby/gems/2.2.0/gems/happy_seed-0.0.15/happyseed.rb

rreusser commented 9 years ago

Seems like everyone who uses this runs into the same issue. Can that line either be removed or fixed?

wschenk commented 9 years ago

@suchipi Are you still having the issue with spring-commands-rspec etc?

suchipi commented 9 years ago

I can check tonight if it's still relevant