0

使用導軌來生成新項目。腳手架與自舉:主題是拋出應用程序錯誤

增加Twitter的引導,導軌的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的引導護欄2.1.5和2.1.4無濟於事。

請指教。

回答

相關問題