2012-09-01 58 views
2

看起来我的问题与OP相同: https://github.com/seyhunak/twitter-bootstrap-rails/issues/27 但我无法修复它。无法使用rails g bootstrap:使用'twitter-bootstrap-rails'进行安装

做一个基本的轨道应用程序,如下所述: http://railscasts.com/episodes/328-twitter-bootstrap-basics 失败,并尝试rails g bootstrap:install

R/R的我的系统上的基本版本是: 红宝石v 1.9.2p320, 轨道上雪豹10.6.4

我可以在我的本地系统上的复制方式3.1.0 :

rails new bsapp --skip-stylesheets 
cd bsapp 
rails g scaffold product name:string price:decimal --skip-stylesheets 

将gem'twitter-bootstrap-rails'添加到gemfile中的资产组。

bundle update 
rails g bootstrap:install 

这是问题所在。

Hayk-Saakians-Mac:bsapp hayk$ rails g bootstrap:install 
/Users/hayk/.rvm/gems/ruby-1.9.2-p320/gems/less-2.2.1/lib/less/java_script/v8_context.rb:61:in `rescue in lock': uninitialized constant V8::JSError (NameError) 
    from /Users/hayk/.rvm/gems/ruby-1.9.2-p320/gems/less-2.2.1/lib/less/java_script/v8_context.rb:60:in `lock' 
    from /Users/hayk/.rvm/gems/ruby-1.9.2-p320/gems/less-2.2.1/lib/less/java_script/v8_context.rb:19:in `initialize' 
    from /Users/hayk/.rvm/gems/ruby-1.9.2-p320/gems/less-2.2.1/lib/less/java_script/v8_context.rb:15:in `new' 
    from /Users/hayk/.rvm/gems/ruby-1.9.2-p320/gems/less-2.2.1/lib/less/java_script/v8_context.rb:15:in `instance' 
    from /Users/hayk/.rvm/gems/ruby-1.9.2-p320/gems/less-2.2.1/lib/less/loader.rb:10:in `initialize' 
    from /Users/hayk/.rvm/gems/ruby-1.9.2-p320/gems/less-2.2.1/lib/less.rb:14:in `new' 
    from /Users/hayk/.rvm/gems/ruby-1.9.2-p320/gems/less-2.2.1/lib/less.rb:14:in `<module:Less>' 
    from /Users/hayk/.rvm/gems/ruby-1.9.2-p320/gems/less-2.2.1/lib/less.rb:9:in `<top (required)>' 
    from /Users/hayk/.rvm/gems/ruby-1.9.2-p320/gems/less-rails-2.2.3/lib/less/rails.rb:6:in `require' 
    from /Users/hayk/.rvm/gems/ruby-1.9.2-p320/gems/less-rails-2.2.3/lib/less/rails.rb:6:in `<top (required)>' 
    from /Users/hayk/.rvm/gems/ruby-1.9.2-p320/gems/less-rails-2.2.3/lib/less-rails.rb:1:in `require' 
    from /Users/hayk/.rvm/gems/ruby-1.9.2-p320/gems/less-rails-2.2.3/lib/less-rails.rb:1:in `<top (required)>' 
    from /Users/hayk/.rvm/gems/ruby-1.9.2-p320/gems/twitter-bootstrap-rails-2.1.3/lib/twitter-bootstrap-rails.rb:9:in `require' 
    from /Users/hayk/.rvm/gems/ruby-1.9.2-p320/gems/twitter-bootstrap-rails-2.1.3/lib/twitter-bootstrap-rails.rb:9:in `<top (required)>' 
    from /Users/hayk/.rvm/gems/[email protected]/gems/bundler-1.2.0/lib/bundler/runtime.rb:68:in `require' 
    from /Users/hayk/.rvm/gems/[email protected]/gems/bundler-1.2.0/lib/bundler/runtime.rb:68:in `block (2 levels) in require' 
    from /Users/hayk/.rvm/gems/[email protected]/gems/bundler-1.2.0/lib/bundler/runtime.rb:66:in `each' 
    from /Users/hayk/.rvm/gems/[email protected]/gems/bundler-1.2.0/lib/bundler/runtime.rb:66:in `block in require' 
    from /Users/hayk/.rvm/gems/[email protected]/gems/bundler-1.2.0/lib/bundler/runtime.rb:55:in `each' 
    from /Users/hayk/.rvm/gems/[email protected]/gems/bundler-1.2.0/lib/bundler/runtime.rb:55:in `require' 
    from /Users/hayk/.rvm/gems/[email protected]/gems/bundler-1.2.0/lib/bundler.rb:128:in `require' 
    from /Users/hayk/ror/bsapp/config/application.rb:7:in `<top (required)>' 
    from /Users/hayk/.rvm/gems/ruby-1.9.2-p320/gems/railties-3.1.0/lib/rails/commands.rb:21:in `require' 
    from /Users/hayk/.rvm/gems/ruby-1.9.2-p320/gems/railties-3.1.0/lib/rails/commands.rb:21:in `<top (required)>' 
    from script/rails:6:in `require' 
    from script/rails:6:in `<main>' 
Hayk-Saakians-Mac:bsapp hayk$ 

完整的源:http://pastebin.com/nXBcq2bB

回答

0

问题的根源是一个坏/老/不存在的安装V8/therubyracer/libv8

的libv8宝石的某些版本只是直上安装失败,以及那些 - 他们花了几个小时,所以我认为他们挂/碰撞(我正在与一个上网本,这是可以预料的)。

目前,以下配置适用于我:

gem "libv8", "3.11.8.13" 
gem "therubyracer", :require => 'v8' 
gem "less-rails" 
gem "twitter-bootstrap-rails" 
发展

,并在生产中(Heroku的)

有对与此相关的,所提到要么rubyracer或libv8一个GitHub的问题x86/32位处理器的问题 - 我不记得它。