seyhunak / twitter-bootstrap-rails

Twitter Bootstrap for Rails 6.0, Rails 5 - Rails 4.x Asset Pipeline
https://github.com/seyhunak/twitter-bootstrap-rails
4.49k stars 997 forks source link

Erros install #455

Closed kraudio closed 10 years ago

kraudio commented 11 years ago

$ rails g bootstrap:install

 insert  app/assets/javascripts/application.js

/Users/claudio/.rvm/gems/ruby-1.9.3-p327/gems/twitter-bootstrap-rails-2.1.6/lib/generators/bootstrap/install/install_generator.rb:34:in add_bootstrap: undefined method configuration for Bootstrap::Rails:Module (NoMethodError) from /Users/claudio/.rvm/gems/ruby-1.9.3-p327/gems/thor-0.16.0/lib/thor/task.rb:27:in run from /Users/claudio/.rvm/gems/ruby-1.9.3-p327/gems/thor-0.16.0/lib/thor/invocation.rb:120:in invoke_task from /Users/claudio/.rvm/gems/ruby-1.9.3-p327/gems/thor-0.16.0/lib/thor/invocation.rb:126:in block in invoke_all from /Users/claudio/.rvm/gems/ruby-1.9.3-p327/gems/thor-0.16.0/lib/thor/invocation.rb:126:in each from /Users/claudio/.rvm/gems/ruby-1.9.3-p327/gems/thor-0.16.0/lib/thor/invocation.rb:126:in map from /Users/claudio/.rvm/gems/ruby-1.9.3-p327/gems/thor-0.16.0/lib/thor/invocation.rb:126:in invoke_all from /Users/claudio/.rvm/gems/ruby-1.9.3-p327/gems/thor-0.16.0/lib/thor/group.rb:238:in dispatch from /Users/claudio/.rvm/gems/ruby-1.9.3-p327/gems/thor-0.16.0/lib/thor/base.rb:425:in start from /Users/claudio/.rvm/gems/ruby-1.9.3-p327/gems/railties-3.2.8/lib/rails/generators.rb:171:in invoke from /Users/claudio/.rvm/gems/ruby-1.9.3-p327/gems/railties-3.2.8/lib/rails/commands/generate.rb:12:in <top (required)> from /Users/claudio/.rvm/gems/ruby-1.9.3-p327/gems/activesupport-3.2.8/lib/active_support/dependencies.rb:251:in require from /Users/claudio/.rvm/gems/ruby-1.9.3-p327/gems/activesupport-3.2.8/lib/active_support/dependencies.rb:251:in block in require from /Users/claudio/.rvm/gems/ruby-1.9.3-p327/gems/activesupport-3.2.8/lib/active_support/dependencies.rb:236:in load_dependency from /Users/claudio/.rvm/gems/ruby-1.9.3-p327/gems/activesupport-3.2.8/lib/active_support/dependencies.rb:251:in require from /Users/claudio/.rvm/gems/ruby-1.9.3-p327/gems/railties-3.2.8/lib/rails/commands.rb:29:in <top (required)> from script/rails:6:in require from script/rails:6:in

$

toadkicker commented 11 years ago

Can you post your gemfile please?

dominikgrygiel commented 11 years ago

https://github.com/seyhunak/twitter-bootstrap-rails/pull/459 should be fixing this

ghost commented 11 years ago

The error is still here. I use TBS in the engine. All is good with TBS 2.1.3 but the error raises on 2.1.7 Also no problem in the new project with 2.1.7

rails g bootstrap:install
      insert  app/assets/javascripts/application.js
/Volumes/Storage/paul/.rvm/gems/ruby-1.9.3-p327@roles-ui/gems/railties-3.2.9/lib/rails.rb:46:in `configuration': undefined method `config' for nil:NilClass (NoMethodError)
    from /Volumes/Storage/paul/.rvm/gems/ruby-1.9.3-p327@roles-ui/gems/twitter-bootstrap-rails-2.1.7/lib/generators/bootstrap/install/install_generator.rb:66:in `use_coffeescript?'
    from /Volumes/Storage/paul/.rvm/gems/ruby-1.9.3-p327@roles-ui/gems/twitter-bootstrap-rails-2.1.7/lib/generators/bootstrap/install/install_generator.rb:35:in `add_bootstrap'
dominikgrygiel commented 11 years ago

Hey,

It did work before https://github.com/seyhunak/twitter-bootstrap-rails/issues/409 , where the issue was introduced. Engine is in it's philosophy encapsulated, so it won't access Rails config of non-existing app and this is checked when installing. I personally see 2 options here:

module Bootstrap
  module Generators
    class InstallGenerator < ::Rails::Generators::Base
    private
      def use_coffeescript?
        true
      end
    end
  end
end

You could also create a new issue to support engines. I hope that helps :)