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

Failure during 'after bundler': You have already activated..., but your Gemfile requires ... #146

Closed kevinelliott closed 11 years ago

kevinelliott commented 11 years ago

1.9.2 Kevins-MacBook-Pro-2:~/work/WeLike $ rvm use 1.9.3 Using /Users/kevin/.rvm/gems/ruby-1.9.3-p194 1.9.3 Kevins-MacBook-Pro-2:~/work/WeLike $ rails -v Rails 3.2.9 1.9.3 Kevins-MacBook-Pro-2:~/work/WeLike $ rails new geek_scan -m https://raw.github.com/RailsApps/rails-composer/master/composer.rb create
create README.rdoc 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/javascripts create vendor/assets/javascripts/.gitkeep create vendor/assets/stylesheets create vendor/assets/stylesheets/.gitkeep create vendor/plugins create vendor/plugins/.gitkeep apply https://raw.github.com/RailsApps/rails-composer/master/composer.rb initializer generators.rb composer WOOT! The recipes you've selected are known to work together. 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 /Volumes/San Francisco/Users Extras/kevin/Dropbox/work/WeLike/geek_scan/.git/ run git add -A from "." run git commit -qm "rails_apps_composer: initial commit" from "." recipe Running railsapps recipe... question Install an example application? 1) I want to build my own application 2) rails-stripe-membership-saas 3) rails-prelaunch-signup 4) rails3-bootstrap-devise-cancan 5) rails3-devise-rspec-cucumber 6) rails3-mongoid-devise 7) rails3-mongoid-omniauth 8) rails3-subdomains railsapps Enter your selection: 1 recipe Running setup recipe... setup Your operating system is darwin12.0.0. setup You are using Ruby version 1.9.3. setup You are using Rails version 3.2.9. 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: 2 question Template engine? 1) ERB 2) Haml 3) Slim (experimental) setup Enter your selection: 2 question Unit testing? 1) Test::Unit 2) RSpec 3) MiniTest setup Enter your selection: 2 question Integration testing? 1) None 2) RSpec with Capybara 3) Cucumber with Capybara 4) Turnip with Capybara 5) MiniTest with Capybara setup Enter your selection: 3 question Fixture replacement? 1) None 2) Factory Girl 3) Machinist 4) Fabrication 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: 2 question Add support for sending email? 1) None 2) Gmail 3) SMTP 4) SendGrid 5) Mandrill setup Enter your selection: 4 question Authentication? 1) None 2) Devise 3) OmniAuth setup Enter your selection: 2 question Devise modules? 1) Devise with default modules 2) Devise with Confirmable module 3) Devise with Confirmable and Invitable modules setup Enter your selection: 3 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.5.0) gsub Gemfile gemfile pg (>= 0.14.1) gemfile haml (>= 3.1.7) gemfile haml-rails (>= 0.3.5) gemfile hpricot (>= 0.8.6) gemfile ruby_parser (>= 3.1.0) gemfile rspec-rails (>= 2.11.4) gemfile database_cleaner (>= 0.9.1) gemfile email_spec (>= 1.4.0) gemfile cucumber-rails (>= 1.3.0) gemfile launchy (>= 2.1.2) gemfile capybara (>= 2.0.1) gemfile factory_girl_rails (>= 4.1.0) gemfile bootstrap-sass (>= 2.1.1.0) gemfile sendgrid (>= 1.0.1) gemfile devise (>= 2.1.2) gemfile devise_invitable (>= 1.1.4) gemfile cancan (>= 1.6.8) gemfile rolify (>= 3.2.0) gemfile simple_form (>= 2.0.4) run git add -A from "." run git commit -qm "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 prelaunch recipe... recipe Running extras recipe... extras Reduce assets logger noise during development? (y/n) y extras Use a local_env.yml file for environment variables? (y/n) y extras Improve error reporting with 'better_errors' during development? (y/n) y 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 setting quiet_assets for reduced asset pipeline logging gemfile quiet_assets (>= 1.0.1) extras recipe creating local_env.yml file for environment variables remove config/local_env.example.yml create config/local_env.example.yml insert config/application.rb extras recipe adding better_errors gem gemfile better_errors (>= 0.2.0) gemfile binding_of_caller (>= 0.6.8) extras recipe creating project-specific rvm gemset and .rvmrc extras creating RVM gemset 'geek_scan' extras switching to gemset 'geek_scan' run rvm gemset list from "."

gemsets for ruby-1.9.3-p194 (found in /Users/kevin/.rvm/gems/ruby-1.9.3-p194) RQueuePrototype admin blue_kai_test edgerails-test1 => geek_scan global learn_tribe rate_card

  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/......... Fetching gem metadata from https://rubygems.org/.. Installing rake (10.0.3) Installing i18n (0.6.1) Installing multi_json (1.5.0) Installing activesupport (3.2.9) Installing builder (3.0.4) Installing activemodel (3.2.9) Installing erubis (2.7.0) Installing journey (1.0.4) Installing rack (1.4.1) Installing rack-cache (1.2) Installing rack-test (0.6.2) Installing hike (1.2.1) Installing tilt (1.3.3) Installing sprockets (2.2.2) Installing actionpack (3.2.9) Installing mime-types (1.19) Installing polyglot (0.3.3) Installing treetop (1.4.12) Installing mail (2.4.4) Installing actionmailer (3.2.9) Installing arel (3.0.2) Installing tzinfo (0.3.35) Installing activerecord (3.2.9) Installing activeresource (3.2.9) Installing addressable (2.3.2) Installing bcrypt-ruby (3.0.1) with native extensions Installing coderay (1.0.8) Installing better_errors (0.2.0) Installing binding_of_caller (0.6.8) with native extensions Installing sass (3.2.3) Installing bootstrap-sass (2.2.1.1) Using bundler (1.1.4) Installing cancan (1.6.8) Installing nokogiri (1.5.5) with native extensions Installing ffi (1.2.0) with native extensions Installing childprocess (0.3.6) Installing websocket (1.0.4) Installing libwebsocket (0.1.7.1) Installing rubyzip (0.9.9) Installing selenium-webdriver (2.27.2) Installing xpath (1.0.0) Installing capybara (2.0.1) Installing coffee-script-source (1.4.0) Installing execjs (1.4.0) Installing coffee-script (2.2.0) Installing rack-ssl (1.3.2) Installing json (1.7.5) with native extensions Installing rdoc (3.12) Installing thor (0.16.0) Installing railties (3.2.9) Installing coffee-rails (3.2.2) Installing diff-lcs (1.1.3) Installing gherkin (2.11.5) with native extensions Installing cucumber (1.2.1) Installing cucumber-rails (1.3.0) Installing daemons (1.1.9) Installing database_cleaner (0.9.1) Installing orm_adapter (0.4.0) Installing warden (1.2.1) Installing devise (2.1.2) Installing devise_invitable (1.1.4) Installing launchy (2.1.2) Installing email_spec (1.4.0) Installing eventmachine (1.0.0) with native extensions Installing factory_girl (4.1.0) Installing factory_girl_rails (4.1.0) Installing haml (3.1.7) Installing haml-rails (0.3.5) Installing hpricot (0.8.6) with native extensions Installing jquery-rails (2.1.4) Installing pg (0.14.1) with native extensions Installing quiet_assets (1.0.1) Installing rails (3.2.9) Installing rolify (3.2.0) Installing rspec-core (2.12.1) Installing rspec-expectations (2.12.0) Installing rspec-mocks (2.12.0) Installing rspec-rails (2.12.0) Installing sexp_processor (4.1.3) Installing ruby_parser (3.1.0) Installing sass-rails (3.2.5) Installing sendgrid (1.1.0) Installing simple_form (2.0.4) Installing thin (1.5.0) with native extensions Installing uglifier (1.3.0) Your bundle is complete! Use bundle show [gemname] to see where a bundled gem is installed. Post-install message from rdoc: Depending on your version of ruby, you may need to install ruby rdoc/ri data:

<= 1.8.6 : unsupported = 1.8.7 : gem install rdoc-data; rdoc-data --install = 1.9.1 : gem install rdoc-data; rdoc-data --install

= 1.9.2 : nothing to do! Yay!

composer  Running 'after bundler' callbacks.

The template [https://raw.github.com/RailsApps/rails-composer/master/composer.rb] could not be loaded. Error: You have already activated sprockets 2.2.1, but your Gemfile requires sprockets 2.2.2. Using bundle exec may solve this.

DanielKehoe commented 11 years ago

A solution is provided in "Troubleshooting" section of the README for rails_apps_composer. See suggestions to resolve the error “Could not be loaded… You have already activated…” in this article: http://railsapps.github.com/rails-error-you-have-already-activated.html

kevinelliott commented 11 years ago

This doesn't make sense. I'm starting with a fresh gem set, as specified by one of the recipes during execution. I have no control over the gem ahead of time to prevent it. Therefore, it has to be a problem with a recipe, and not my local environment.

DanielKehoe commented 11 years ago

I've run the script locally with the same options you've selected (with the exception of PostgreSQL, I chose SQLite) and the script succeeds with a working application.

When you start with a fresh gemset, an initial set of gems is loaded so the script can run. Rails 3.2.9 is required when you run rails new and you may have sprockets 2.2.1 associated with an earlier install of Rails. As soon as you've made your choices in the script, Bundler installs the new set of gems. If one of the new gems specifies a newer version of sprockets, you'll have a conflict. Note that sprockets 2.2.2 was released Nov 27th. Usually I see this error when a commonly required gem like sprockets or multi_json has had a recent update.

I suggest you create a fresh RVM gemset and run gem list. If it shows sprockets 2.2.1, do

gem uninstall sprockets -v 2.2.1
gem install sprockets
gem list

and make sure you have sprockets 2.2.2 before proceeding with rails new .....

I hope that helps because I don't have any better suggestion than that :-)

kevinelliott commented 11 years ago

That fixed it. This seems to come up every time. It's too bad there isn't something that the composer script can run to ensure the dependencies are good ahead of time and prompt to fix.

On Dec 13, 2012, at 6:09 PM, Daniel Kehoe notifications@github.com wrote:

I've run the script locally with the same options you've selected (with the exception of PostgreSQL, I chose SQLite) and the script succeeds with a working application.

When you start with a fresh gemset, an initial set of gems is loaded so the script can run. Rails 3.2.9 is required when you run rails new and you may have sprockets 2.2.1 associated with an earlier install of Rails. As soon as you've made your choices in the script, Bundler installs the new set of gems. If one of the new gems specifies a newer version of sprockets, you'll have a conflict. Note that sprockets 2.2.2 was released Nov 27th. Usually I see this error when a commonly required gem like sprockets or multi_json has had a recent update.

I suggest you create a fresh RVM gemset and run gem list. If it shows sprockets 2.2.1, do

gem uninstall sprockets -v 2.2.1 gem install sprockets gem list and make sure you have sprockets 2.2.2 before proceeding with rails new .....

I hope that helps because I don't have any better suggestion than that :-)

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

DanielKehoe commented 11 years ago

I'd love to find a way for the composer script to check for gem version conflicts. It's beyond my skill with Bundler, though, so I'll have to wait for someone smarter to figure it out :-(