2012-09-01 97 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位處理器的問題 - 我不記得它。