RailsApps / rails_apps_composer

A gem with recipes to create Rails application templates for Rails starter apps.
http://railsapps.github.io/rails_apps_composer/
1.42k stars 304 forks source link

Rake failures with Ruby 1.9.2 #116

Closed Qard closed 12 years ago

Qard commented 12 years ago

This configuration;

Recipes:
["controllers", "core", "email", "extras", "frontend", "gems", "git", "init", "models", "prelaunch", "railsapps", "readme", "routes", "setup", "testing", "views"]

Preferences:
{:git=>true, :railsapps=>"none", :dev_webserver=>"thin", :prod_webserver=>"thin", :database=>"mongodb", :orm=>"mongoid", :templates=>"haml", :unit_test=>"rspec", :integration=>"capybara", :fixtures=>"factory_girl", :frontend=>"bootstrap", :bootstrap=>"less", :email=>"gmail", :authentication=>"devise", :devise_modules=>"default", :authorization=>"cancan", :form_builder=>"simple_form", :starter_app=>"admin_app"}

is giving me this error;

undefined method `[]' for nil:NilClass

for every call to rake in the composition process.

DanielKehoe commented 12 years ago

@Qard I'm unable to duplicate the error you report. I believe I've duplicated your preference choices. Here's my (partlal) console output. As you see, it runs fine when it hits the first run bundle exec rake db:drop from "." and it generates a complete running application (though I didn't include the output after the rake task).

If you try it again, show me the console output.

-- Daniel

$ rails_apps_composer new myapp -r core
Would you like to skip Test::Unit? (yes for RSpec) (y/n) y
Would you like to skip Active Record? (yes for MongoDB) (y/n) y
.
.
.
    composer  Using rails_apps_composer recipes to generate an application.
      insert    config/application.rb
      recipe  Running core recipe...
        core  selected all core recipes
      recipe  Running git recipe...
         git  initialize git
      remove    .gitignore
      create    .gitignore
         run    git init from "."
Initialized empty Git repository in /Users/danielkehoe/code/wip/myapp/.git/
         run    git add . from "."
         run    git commit -aqm 'rails_apps_composer: initial commit' from "."
      recipe  Running railsapps recipe...
    question  Install an example application?
          1)  I want to build my own application
          2)  rails3-bootstrap-devise-cancan
          3)  rails3-devise-rspec-cucumber
          4)  rails3-mongoid-devise
          5)  rails3-mongoid-omniauth
          6)  rails3-subdomains
   railsapps  Enter your selection: 1
      recipe  Running setup recipe...
       setup  Your operating system is darwin11.4.0.
       setup  You are using Ruby version 1.9.3.
       setup  You are using Rails version 3.2.8.
    question  Web server for development?
          1)  WEBrick (default)
          2)  Thin
          3)  Unicorn
          4)  Puma
       setup  Enter your selection: 2
    question  Web server for production?
          1)  Same as development
          2)  Thin
          3)  Unicorn
          4)  Puma
       setup  Enter your selection: 1
    question  Database used in development?
          1)  SQLite
          2)  PostgreSQL
          3)  MySQL
          4)  MongoDB
       setup  Enter your selection: 4
    question  How will you connect to MongoDB?
          1)  Mongoid
       setup  Enter your selection: 1
    question  Template engine?
          1)  ERB
          2)  Haml
          3)  Slim
       setup  Enter your selection: 2
    question  Unit testing?
          1)  Test::Unit
          2)  RSpec
       setup  Enter your selection: 2
    question  Integration testing?
          1)  None
          2)  RSpec with Capybara
          3)  Cucumber with Capybara
          4)  Turnip with Capybara
       setup  Enter your selection: 2
    question  Fixture replacement?
          1)  None
          2)  Factory Girl
          3)  Machinist
       setup  Enter your selection: 2
    question  Front-end framework?
          1)  None
          2)  Twitter Bootstrap
          3)  Zurb Foundation
          4)  Skeleton
          5)  Just normalize CSS for consistent styling
       setup  Enter your selection: 2
    question  Twitter Bootstrap version?
          1)  Twitter Bootstrap (Less)
          2)  Twitter Bootstrap (Sass)
       setup  Enter your selection: 1
    question  Add support for sending email?
          1)  None
          2)  Gmail
          3)  SMTP
          4)  SendGrid
          5)  Mandrill
       setup  Enter your selection: 2
    question  Authentication?
          1)  None
          2)  Devise
          3)  OmniAuth
       setup  Enter your selection: 2
    question  Devise modules?
          1)  Devise with default modules
       setup  Enter your selection: 1
    question  Authorization?
          1)  None
          2)  CanCan with Rolify
       setup  Enter your selection: 2
    question  Use a form builder gem?
          1)  None
          2)  SimpleForm
       setup  Enter your selection: 2
    question  Install a starter app?
          1)  None
          2)  Home Page
          3)  Home Page, User Accounts
          4)  Home Page, User Accounts, Admin Dashboard
       setup  Enter your selection: 4
      create    README
      append    README
      recipe  Running readme recipe...
      recipe  Running gems recipe...
     gemfile    thin (>= 1.4.1)
        gsub    Gemfile
     gemfile    mongoid (>= 3.0.5)
     gemfile    haml (>= 3.1.7)
     gemfile    haml-rails (>= 0.3.5)
     gemfile    hpricot (>= 0.8.6)
     gemfile    ruby_parser (>= 2.3.1)
     gemfile    rspec-rails (>= 2.11.0)
     gemfile    capybara (>= 1.1.2)
     gemfile    database_cleaner (>= 0.8.0)
     gemfile    mongoid-rspec (>= 1.4.6)
     gemfile    email_spec (>= 1.2.1)
     gemfile    factory_girl_rails (>= 4.0.0)
     gemfile    twitter-bootstrap-rails (>= 2.1.3)
     gemfile    therubyracer (>= 0.10.2)
     gemfile    devise (>= 2.1.2)
     gemfile    cancan (>= 1.6.8)
     gemfile    rolify (>= 3.2.0)
     gemfile    simple_form (>= 2.0.2)
         run    git add . from "."
         run    git commit -aqm 'rails_apps_composer: Gemfile' from "."
      recipe  Running testing recipe...
      recipe  Running email recipe...
      recipe  Running models recipe...
      recipe  Running controllers recipe...
      recipe  Running views recipe...
      recipe  Running routes recipe...
      recipe  Running frontend recipe...
      recipe  Running init recipe...
      recipe  Running prelaunch recipe...
      recipe  Running extras recipe...
      extras  Set a robots.txt file to ban spiders? (y/n) n
      extras  Create a project-specific rvm gemset and .rvmrc? (y/n) y
      extras  Create a GitHub repository? (y/n) n
      extras  recipe creating project-specific rvm gemset and .rvmrc
      extras  creating RVM gemset 'myapp'
         run    rvm rvmrc trust from "."
Marked /Users/danielkehoe/code/wip/myapp/Gemfile as trusted
      extras  switching to gemset 'myapp'
         run    rvm gemset list from "."

gemsets for ruby-1.9.3-p194 (found in /Users/danielkehoe/.rvm/gems/ruby-1.9.3-p194)
   global
=> myapp
   rails-membership-subscription-saas
   rails-prelaunch-signup
   rails3-bootstrap-devise-cancan
   rails3-devise-rspec-cucumber
   rails3-mongoid-devise
   rails3-mongoid-omniauth
   rails3-subdomains
   rails328
   rails_apps_composer
   rhh
   tutorials-railsapps
   wiki

      remove    .rvmrc
      create    .rvmrc
        gsub    .rvmrc
    composer  Installing gems. This will take a while.
         run    bundle install --without production from "."
Fetching gem metadata from https://rubygems.org/.......
.
.
. 
Your bundle is complete! Use `bundle show [gemname]` to see where a bundled gem is installed.
    composer  Running 'after bundler' callbacks.
    composer  importing html2haml conversion tool
    generate    mongoid:config

Mongoid config not found. Create a config file at: config/mongoid.yml
to generate one run: rails generate mongoid:config

      create  config/mongoid.yml
      remove    config/database.yml
    question  Drop any existing databases named myapp?
          1)  Yes (continue)
          2)  No (abort)
        gems  Enter your selection: 1
         run    bundle exec rake db:drop from "."
         run    bundle exec rake db:create from "."
         run    git add . from "."
         run    git commit -aqm 'rails_apps_composer: create database' from "."
Qard commented 12 years ago

Here's my log;

EDIT: Moved to gist for easier reading.

Qard commented 12 years ago

Tried again with just -r core and still no luck. :(

EDIT: Moved to gist for easier reading.

DanielKehoe commented 12 years ago

What rake version? rake --version

DanielKehoe commented 12 years ago

I see "You are using Ruby version 1.9.2.". Can you install rvm and try ruby 1.9.3p194?

Qard commented 12 years ago

rake is version 0.9.2.2. Trying to upgrade ruby, but it's taking awhile. I'll let you know if that makes a difference.

EDIT: Yep, that seems to have fixed it. Yay! :D

rogerg9999 commented 11 years ago

Yes, upgrade to ruby 1.9.3 fix the problem. Thanks