0

실행 후나침반 설치 부트 스트랩 -> NoMethodError on line [ "32"] ... sass-rails-3.2.6/lib/sass/rails/helpers.rb : 정의되지 않은 메소드`[] 'for nil : NilClass

identical sass/styles.scss 

...

identical javascripts/bootstrap-typeahead.js 
NoMethodError on line ["32"] of /Users/xxx/.rvm/gems/[email protected]/gems/sass-rails-3.2.6/lib/sass/rails/helpers.rb: undefined method `[]' for nil:NilClass 
Run with --trace to see the full backtrace 

/Users/xxx/.rvm/gems/[email protected]의 : 명령

compass install bootstrap 

나는이 메시지 /gems/sass-rails-3.2.6/ 내 설정/나침반이 물건을>https://gist.github.com/castus/4044953

def resolver 
    if ::Rails::env == "production" 
    options[:custom][:resolver] 
    else 
    Resolver.new(CompassRails.context) 
    end 
end 

& 여전히 운 :

- lib 디렉토리/말대꾸/레일/helpers.rb

31  def resolver 
32  options[:custom][:resolver] 
33  end 

나는 해결 방법을 시도하지 않습니다. rb

require 'bootstrap-sass' 

그리고 내 Gemfile

source 'http://rubygems.org' 

gem "paperclip" 
gem 'bootstrap-sass', '~> 2.3.1.0' 
gem 'compass-rails' 
gem 'bootswatch-rails' 

gem 'gmaps4rails' 

gem 'rails', '3.2.13' 
gem 'activerecord-postgresql-adapter' 
gem 'devise' 
gem 'sass-rails', '~> 3.2.3' 
gem "haml" 
gem "haml-rails" 

# Bundle edge Rails instead: 
# gem 'rails', :git => 'git://github.com/rails/rails.git' 

# 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 'uglifier', '>= 1.0.3' 
end 

gem 'jquery-rails' 

# To use ActiveModel has_secure_password 
# gem 'bcrypt-ruby', '~> 3.0.0' 

# To use Jbuilder templates for JSON 
# gem 'jbuilder' 

# Use unicorn as the app server 
# gem 'unicorn' 

# Deploy with Capistrano 
# gem 'capistrano' 

# To use debugger 
# gem 'debugger' 

답변

1

레일 및 부트 스트랩을 사용하는 경우에는 "컴퍼스"가 필요하지 않습니다. 나침반은 레일즈를 사용하지 않는 사이트를위한 것입니다.

여기에 설치하는 단계와 부트 스트랩 - 말대꾸

  1. 는 Gemfile에 추가하고 bundle install

  2. 은 이름 바꾸기 application.css이

  3. application.css.scss에서 모든 주석을 제거 할 수 있습니다 application.css.scss, 비워 둡니다.

  4. @import bootstrap

완료되었습니다. 그것을 일반적인 CSS 파일로 취급하고 @import를 사용하여 원하는대로하십시오. 하지만 덧글에 require 더 이상!

+0

고맙습니다. 그냥 확인하고 싶습니다. Bootstrap-Sass를 설치 한 후이 모든 것들 (http://compass-style.org/reference/compass/)을 사용할 수 있습니까? – whitesiroi

+1

@whitesiroi, 당신이 언급 한 것은 Compass의 CSS 프레임 워크입니다. 트위터 부트 스트랩에 이미 CSS 프레임 워크가 있습니다. 두 개를 함께 사용하면 불필요하며 충돌이 발생합니다. –

+0

대단히 감사합니다 :) – whitesiroi