0

レールを使用して新しいプロジェクトを生成しました。

twitter-bootstrap-railsをGemfileに追加しました

    source 'https://rubygems.org'

    gem 'rails', '3.2.8'
    # Use thin as webserver
    gem 'thin'
    # Mysql
    gem 'mysql2'
    # Gems used only for assets and not required
    # in production environments by default.
    group :assets do
      gem 'sass-rails',   '~> 3.2.3'
      gem 'coffee-rails', '~> 3.2.1'
      # See https://github.com/sstephenson/execjs#readme for more supported runtimes
      gem 'therubyracer', :platforms => :ruby
      gem "less-rails"
      gem 'uglifier', '>= 1.0.3'
    end
    # Twitter bootstrap baby
    gem 'twitter-bootstrap-rails', :git => 'git://github.com/seyhunak/twitter-bootstrap-rails.git'
    # json
    gem 'json'
    # jQuery is the win
    gem 'jquery-rails'
    gem 'jquery-ui-rails'
    # Devise for auth goodness
    gem 'devise'
    # Cancan for permission goodness
    gem 'cancan'

    # Fog allows for easy communication with clouds
    gem 'fog'

    group :development, :test do
      # Cannot run as gem and use heroku
      # See: http://stackoverflow.com/questions/6288910/heroku-deployment-gemfile-lock-problem
      # gem 'rb-fsevent', :require => false if RUBY_PLATFORM =~ /darwin/i
      gem 'faker'
      gem 'factory_girl_rails'
      gem 'rspec-rails'
      gem 'shoulda-matchers'
      gem 'capybara'
      gem 'launchy'
      gem 'database_cleaner'
      gem 'guard-rspec'
    end

    # 
    # group :production do
    #   gem 'pg'
    # end

バンドルインストールを行いましたが、すべてうまくいきました。

それから私はしました

    $ rails g bootstrap:install

それでもすべてが良いです。

次に、これを行いました:

    $ rails g bootstrap:layout application fixed

まだいい。

それから私はこれをしました:

    $ rails g bootstrap:themed Posts

そしてこれを手に入れました:

    /Users/jason/.rvm/gems/ruby-1.9.3-p286/gems/activesupport-3.2.8/lib/active_support/inflector/methods.rb:230:in `block in constantize': uninitialized constant Post (NameError)
        from /Users/jason/.rvm/gems/ruby-1.9.3-p286/gems/activesupport-3.2.8/lib/active_support/inflector/methods.rb:229:in `each'
        from /Users/jason/.rvm/gems/ruby-1.9.3-p286/gems/activesupport-3.2.8/lib/active_support/inflector/methods.rb:229:in `constantize'
        from /Users/jason/.rvm/gems/ruby-1.9.3-p286/gems/activesupport-3.2.8/lib/active_support/core_ext/string/inflections.rb:54:in `constantize'
        from /Users/jason/.rvm/gems/ruby-1.9.3-p286/gems/twitter-bootstrap-rails-2.1.6/lib/generators/bootstrap/themed/themed_generator.rb:59:in `block in columns'
        from /Users/jason/.rvm/gems/ruby-1.9.3-p286/gems/twitter-bootstrap-rails-2.1.6/lib/generators/bootstrap/themed/themed_generator.rb:69:in `rescue_block'
        from /Users/jason/.rvm/gems/ruby-1.9.3-p286/gems/twitter-bootstrap-rails-2.1.6/lib/generators/bootstrap/themed/themed_generator.rb:58:in `columns'
        from (erb):9:in `template'
        from /Users/jason/.rvm/rubies/ruby-1.9.3-p286/lib/ruby/1.9.1/erb.rb:838:in `eval'
        from /Users/jason/.rvm/rubies/ruby-1.9.3-p286/lib/ruby/1.9.1/erb.rb:838:in `result'
        from /Users/jason/.rvm/gems/ruby-1.9.3-p286/gems/thor-0.16.0/lib/thor/actions/file_manipulation.rb:111:in `block in template'
        from /Users/jason/.rvm/gems/ruby-1.9.3-p286/gems/thor-0.16.0/lib/thor/actions/create_file.rb:54:in `call'
        from /Users/jason/.rvm/gems/ruby-1.9.3-p286/gems/thor-0.16.0/lib/thor/actions/create_file.rb:54:in `render'
        from /Users/jason/.rvm/gems/ruby-1.9.3-p286/gems/thor-0.16.0/lib/thor/actions/create_file.rb:47:in `identical?'
        from /Users/jason/.rvm/gems/ruby-1.9.3-p286/gems/thor-0.16.0/lib/thor/actions/create_file.rb:73:in `on_conflict_behavior'
        from /Users/jason/.rvm/gems/ruby-1.9.3-p286/gems/thor-0.16.0/lib/thor/actions/empty_directory.rb:130:in `invoke_with_conflict_check'
        from /Users/jason/.rvm/gems/ruby-1.9.3-p286/gems/thor-0.16.0/lib/thor/actions/create_file.rb:61:in `invoke!'
        from /Users/jason/.rvm/gems/ruby-1.9.3-p286/gems/thor-0.16.0/lib/thor/actions.rb:95:in `action'
        from /Users/jason/.rvm/gems/ruby-1.9.3-p286/gems/thor-0.16.0/lib/thor/actions/create_file.rb:26:in `create_file'
        from /Users/jason/.rvm/gems/ruby-1.9.3-p286/gems/thor-0.16.0/lib/thor/actions/file_manipulation.rb:110:in `template'
        from /Users/jason/.rvm/gems/ruby-1.9.3-p286/gems/twitter-bootstrap-rails-2.1.6/lib/generators/bootstrap/themed/themed_generator.rb:97:in `block in generate_erb'
        from /Users/jason/.rvm/gems/ruby-1.9.3-p286/gems/twitter-bootstrap-rails-2.1.6/lib/generators/bootstrap/themed/themed_generator.rb:96:in `each'
        from /Users/jason/.rvm/gems/ruby-1.9.3-p286/gems/twitter-bootstrap-rails-2.1.6/lib/generators/bootstrap/themed/themed_generator.rb:96:in `generate_erb'
        from /Users/jason/.rvm/gems/ruby-1.9.3-p286/gems/twitter-bootstrap-rails-2.1.6/lib/generators/bootstrap/themed/themed_generator.rb:92:in `generate_views'
        from /Users/jason/.rvm/gems/ruby-1.9.3-p286/gems/twitter-bootstrap-rails-2.1.6/lib/generators/bootstrap/themed/themed_generator.rb:19:in `copy_views'
        from /Users/jason/.rvm/gems/ruby-1.9.3-p286/gems/thor-0.16.0/lib/thor/task.rb:27:in `run'
        from /Users/jason/.rvm/gems/ruby-1.9.3-p286/gems/thor-0.16.0/lib/thor/invocation.rb:120:in `invoke_task'
        from /Users/jason/.rvm/gems/ruby-1.9.3-p286/gems/thor-0.16.0/lib/thor/invocation.rb:126:in `block in invoke_all'
        from /Users/jason/.rvm/gems/ruby-1.9.3-p286/gems/thor-0.16.0/lib/thor/invocation.rb:126:in `each'
        from /Users/jason/.rvm/gems/ruby-1.9.3-p286/gems/thor-0.16.0/lib/thor/invocation.rb:126:in `map'
        from /Users/jason/.rvm/gems/ruby-1.9.3-p286/gems/thor-0.16.0/lib/thor/invocation.rb:126:in `invoke_all'
        from /Users/jason/.rvm/gems/ruby-1.9.3-p286/gems/thor-0.16.0/lib/thor/group.rb:238:in `dispatch'
        from /Users/jason/.rvm/gems/ruby-1.9.3-p286/gems/thor-0.16.0/lib/thor/base.rb:425:in `start'
        from /Users/jason/.rvm/gems/ruby-1.9.3-p286/gems/railties-3.2.8/lib/rails/generators.rb:171:in `invoke'
        from /Users/jason/.rvm/gems/ruby-1.9.3-p286/gems/railties-3.2.8/lib/rails/commands/generate.rb:12:in `<top (required)>'
        from /Users/jason/.rvm/gems/ruby-1.9.3-p286/gems/railties-3.2.8/lib/rails/commands.rb:29:in `<top (required)>'
        from script/rails:6:in `require'
        from script/rails:6:in `<main>'
    /Volumes/dev/projects/jason/fuckthis $ rails g bootstrap:themed posts
    /Users/jason/.rvm/gems/ruby-1.9.3-p286/gems/activesupport-3.2.8/lib/active_support/inflector/methods.rb:230:in `block in constantize': uninitialized constant Post (NameError)
        from /Users/jason/.rvm/gems/ruby-1.9.3-p286/gems/activesupport-3.2.8/lib/active_support/inflector/methods.rb:229:in `each'
        from /Users/jason/.rvm/gems/ruby-1.9.3-p286/gems/activesupport-3.2.8/lib/active_support/inflector/methods.rb:229:in `constantize'
        from /Users/jason/.rvm/gems/ruby-1.9.3-p286/gems/activesupport-3.2.8/lib/active_support/core_ext/string/inflections.rb:54:in `constantize'
        from /Users/jason/.rvm/gems/ruby-1.9.3-p286/gems/twitter-bootstrap-rails-2.1.6/lib/generators/bootstrap/themed/themed_generator.rb:59:in `block in columns'
        from /Users/jason/.rvm/gems/ruby-1.9.3-p286/gems/twitter-bootstrap-rails-2.1.6/lib/generators/bootstrap/themed/themed_generator.rb:69:in `rescue_block'
        from /Users/jason/.rvm/gems/ruby-1.9.3-p286/gems/twitter-bootstrap-rails-2.1.6/lib/generators/bootstrap/themed/themed_generator.rb:58:in `columns'
        from (erb):9:in `template'
        from /Users/jason/.rvm/rubies/ruby-1.9.3-p286/lib/ruby/1.9.1/erb.rb:838:in `eval'
        from /Users/jason/.rvm/rubies/ruby-1.9.3-p286/lib/ruby/1.9.1/erb.rb:838:in `result'
        from /Users/jason/.rvm/gems/ruby-1.9.3-p286/gems/thor-0.16.0/lib/thor/actions/file_manipulation.rb:111:in `block in template'
        from /Users/jason/.rvm/gems/ruby-1.9.3-p286/gems/thor-0.16.0/lib/thor/actions/create_file.rb:54:in `call'
        from /Users/jason/.rvm/gems/ruby-1.9.3-p286/gems/thor-0.16.0/lib/thor/actions/create_file.rb:54:in `render'
        from /Users/jason/.rvm/gems/ruby-1.9.3-p286/gems/thor-0.16.0/lib/thor/actions/create_file.rb:47:in `identical?'
        from /Users/jason/.rvm/gems/ruby-1.9.3-p286/gems/thor-0.16.0/lib/thor/actions/create_file.rb:73:in `on_conflict_behavior'
        from /Users/jason/.rvm/gems/ruby-1.9.3-p286/gems/thor-0.16.0/lib/thor/actions/empty_directory.rb:130:in `invoke_with_conflict_check'
        from /Users/jason/.rvm/gems/ruby-1.9.3-p286/gems/thor-0.16.0/lib/thor/actions/create_file.rb:61:in `invoke!'
        from /Users/jason/.rvm/gems/ruby-1.9.3-p286/gems/thor-0.16.0/lib/thor/actions.rb:95:in `action'
        from /Users/jason/.rvm/gems/ruby-1.9.3-p286/gems/thor-0.16.0/lib/thor/actions/create_file.rb:26:in `create_file'
        from /Users/jason/.rvm/gems/ruby-1.9.3-p286/gems/thor-0.16.0/lib/thor/actions/file_manipulation.rb:110:in `template'
        from /Users/jason/.rvm/gems/ruby-1.9.3-p286/gems/twitter-bootstrap-rails-2.1.6/lib/generators/bootstrap/themed/themed_generator.rb:97:in `block in generate_erb'
        from /Users/jason/.rvm/gems/ruby-1.9.3-p286/gems/twitter-bootstrap-rails-2.1.6/lib/generators/bootstrap/themed/themed_generator.rb:96:in `each'
        from /Users/jason/.rvm/gems/ruby-1.9.3-p286/gems/twitter-bootstrap-rails-2.1.6/lib/generators/bootstrap/themed/themed_generator.rb:96:in `generate_erb'
        from /Users/jason/.rvm/gems/ruby-1.9.3-p286/gems/twitter-bootstrap-rails-2.1.6/lib/generators/bootstrap/themed/themed_generator.rb:92:in `generate_views'
        from /Users/jason/.rvm/gems/ruby-1.9.3-p286/gems/twitter-bootstrap-rails-2.1.6/lib/generators/bootstrap/themed/themed_generator.rb:19:in `copy_views'
        from /Users/jason/.rvm/gems/ruby-1.9.3-p286/gems/thor-0.16.0/lib/thor/task.rb:27:in `run'
        from /Users/jason/.rvm/gems/ruby-1.9.3-p286/gems/thor-0.16.0/lib/thor/invocation.rb:120:in `invoke_task'
        from /Users/jason/.rvm/gems/ruby-1.9.3-p286/gems/thor-0.16.0/lib/thor/invocation.rb:126:in `block in invoke_all'
        from /Users/jason/.rvm/gems/ruby-1.9.3-p286/gems/thor-0.16.0/lib/thor/invocation.rb:126:in `each'
        from /Users/jason/.rvm/gems/ruby-1.9.3-p286/gems/thor-0.16.0/lib/thor/invocation.rb:126:in `map'
        from /Users/jason/.rvm/gems/ruby-1.9.3-p286/gems/thor-0.16.0/lib/thor/invocation.rb:126:in `invoke_all'
        from /Users/jason/.rvm/gems/ruby-1.9.3-p286/gems/thor-0.16.0/lib/thor/group.rb:238:in `dispatch'
        from /Users/jason/.rvm/gems/ruby-1.9.3-p286/gems/thor-0.16.0/lib/thor/base.rb:425:in `start'
        from /Users/jason/.rvm/gems/ruby-1.9.3-p286/gems/railties-3.2.8/lib/rails/generators.rb:171:in `invoke'
        from /Users/jason/.rvm/gems/ruby-1.9.3-p286/gems/railties-3.2.8/lib/rails/commands/generate.rb:12:in `<top (required)>'
        from /Users/jason/.rvm/gems/ruby-1.9.3-p286/gems/railties-3.2.8/lib/rails/commands.rb:29:in `<top (required)>'
        from script/rails:6:in `require'
        from script/rails:6:in `<main>'
    /Volumes/dev/projects/jason/fuckthis $ rails g bootstrap:themed posts -f
    /Users/jason/.rvm/gems/ruby-1.9.3-p286/gems/activesupport-3.2.8/lib/active_support/inflector/methods.rb:230:in `block in constantize': uninitialized constant Post (NameError)
        from /Users/jason/.rvm/gems/ruby-1.9.3-p286/gems/activesupport-3.2.8/lib/active_support/inflector/methods.rb:229:in `each'
        from /Users/jason/.rvm/gems/ruby-1.9.3-p286/gems/activesupport-3.2.8/lib/active_support/inflector/methods.rb:229:in `constantize'
        from /Users/jason/.rvm/gems/ruby-1.9.3-p286/gems/activesupport-3.2.8/lib/active_support/core_ext/string/inflections.rb:54:in `constantize'
        from /Users/jason/.rvm/gems/ruby-1.9.3-p286/gems/twitter-bootstrap-rails-2.1.6/lib/generators/bootstrap/themed/themed_generator.rb:59:in `block in columns'
        from /Users/jason/.rvm/gems/ruby-1.9.3-p286/gems/twitter-bootstrap-rails-2.1.6/lib/generators/bootstrap/themed/themed_generator.rb:69:in `rescue_block'
        from /Users/jason/.rvm/gems/ruby-1.9.3-p286/gems/twitter-bootstrap-rails-2.1.6/lib/generators/bootstrap/themed/themed_generator.rb:58:in `columns'
        from (erb):9:in `template'
        from /Users/jason/.rvm/rubies/ruby-1.9.3-p286/lib/ruby/1.9.1/erb.rb:838:in `eval'
        from /Users/jason/.rvm/rubies/ruby-1.9.3-p286/lib/ruby/1.9.1/erb.rb:838:in `result'
        from /Users/jason/.rvm/gems/ruby-1.9.3-p286/gems/thor-0.16.0/lib/thor/actions/file_manipulation.rb:111:in `block in template'
        from /Users/jason/.rvm/gems/ruby-1.9.3-p286/gems/thor-0.16.0/lib/thor/actions/create_file.rb:54:in `call'
        from /Users/jason/.rvm/gems/ruby-1.9.3-p286/gems/thor-0.16.0/lib/thor/actions/create_file.rb:54:in `render'
        from /Users/jason/.rvm/gems/ruby-1.9.3-p286/gems/thor-0.16.0/lib/thor/actions/create_file.rb:47:in `identical?'
        from /Users/jason/.rvm/gems/ruby-1.9.3-p286/gems/thor-0.16.0/lib/thor/actions/create_file.rb:73:in `on_conflict_behavior'
        from /Users/jason/.rvm/gems/ruby-1.9.3-p286/gems/thor-0.16.0/lib/thor/actions/empty_directory.rb:130:in `invoke_with_conflict_check'
        from /Users/jason/.rvm/gems/ruby-1.9.3-p286/gems/thor-0.16.0/lib/thor/actions/create_file.rb:61:in `invoke!'
        from /Users/jason/.rvm/gems/ruby-1.9.3-p286/gems/thor-0.16.0/lib/thor/actions.rb:95:in `action'
        from /Users/jason/.rvm/gems/ruby-1.9.3-p286/gems/thor-0.16.0/lib/thor/actions/create_file.rb:26:in `create_file'
        from /Users/jason/.rvm/gems/ruby-1.9.3-p286/gems/thor-0.16.0/lib/thor/actions/file_manipulation.rb:110:in `template'
        from /Users/jason/.rvm/gems/ruby-1.9.3-p286/gems/twitter-bootstrap-rails-2.1.6/lib/generators/bootstrap/themed/themed_generator.rb:97:in `block in generate_erb'
        from /Users/jason/.rvm/gems/ruby-1.9.3-p286/gems/twitter-bootstrap-rails-2.1.6/lib/generators/bootstrap/themed/themed_generator.rb:96:in `each'
        from /Users/jason/.rvm/gems/ruby-1.9.3-p286/gems/twitter-bootstrap-rails-2.1.6/lib/generators/bootstrap/themed/themed_generator.rb:96:in `generate_erb'
        from /Users/jason/.rvm/gems/ruby-1.9.3-p286/gems/twitter-bootstrap-rails-2.1.6/lib/generators/bootstrap/themed/themed_generator.rb:92:in `generate_views'
        from /Users/jason/.rvm/gems/ruby-1.9.3-p286/gems/twitter-bootstrap-rails-2.1.6/lib/generators/bootstrap/themed/themed_generator.rb:19:in `copy_views'
        from /Users/jason/.rvm/gems/ruby-1.9.3-p286/gems/thor-0.16.0/lib/thor/task.rb:27:in `run'
        from /Users/jason/.rvm/gems/ruby-1.9.3-p286/gems/thor-0.16.0/lib/thor/invocation.rb:120:in `invoke_task'
        from /Users/jason/.rvm/gems/ruby-1.9.3-p286/gems/thor-0.16.0/lib/thor/invocation.rb:126:in `block in invoke_all'
        from /Users/jason/.rvm/gems/ruby-1.9.3-p286/gems/thor-0.16.0/lib/thor/invocation.rb:126:in `each'
        from /Users/jason/.rvm/gems/ruby-1.9.3-p286/gems/thor-0.16.0/lib/thor/invocation.rb:126:in `map'
        from /Users/jason/.rvm/gems/ruby-1.9.3-p286/gems/thor-0.16.0/lib/thor/invocation.rb:126:in `invoke_all'
        from /Users/jason/.rvm/gems/ruby-1.9.3-p286/gems/thor-0.16.0/lib/thor/group.rb:238:in `dispatch'
        from /Users/jason/.rvm/gems/ruby-1.9.3-p286/gems/thor-0.16.0/lib/thor/base.rb:425:in `start'
        from /Users/jason/.rvm/gems/ruby-1.9.3-p286/gems/railties-3.2.8/lib/rails/generators.rb:171:in `invoke'
        from /Users/jason/.rvm/gems/ruby-1.9.3-p286/gems/railties-3.2.8/lib/rails/commands/generate.rb:12:in `<top (required)>'
        from /Users/jason/.rvm/gems/ruby-1.9.3-p286/gems/railties-3.2.8/lib/rails/commands.rb:29:in `<top (required)>'
        from script/rails:6:in `require'
        from script/rails:6:in `<main>'

twitter-bootstrap-rails2.1.5および2.1.4にロールバックしましたが役に立ちませんでした。

お知らせ下さい。

4

1 に答える 1

5

最初に Post スキャフォールドを作成する必要があります。https://github.com/seyhunak/twitter-bootstrap-rails/blob/master/README.mdから:

rails g scaffold Post title:string description:text
rake db:migrate
rails g bootstrap:themed Posts
于 2012-11-19T21:05:07.553 に答える