简体   繁体   English

使用bundle install在我的Ruby on Rails项目中安装Bootstrap

[英]Install Bootstrap in my Ruby on Rails project using bundle install

I am new to Rails. 我是Rails的新手。 I wanted to use bootstrap so I have placed the 'bootstrap-sass' as in it's documentation in my Gemfile like the following: 我想使用引导程序,因此将“ bootstrap-sass”放置在我的Gemfile中的文档中,如下所示:

group :assets do
 gem 'sass-rails',   '~> 3.2.3'
 gem 'coffee-rails', '~> 3.2.1'
 gem 'uglifier', '>= 1.0.3'
 gem 'bootstrap-sass', '~> 2.3.1.0'
end

and I tried to install it using 'bundle install', which gave me the following error message: 并且我尝试使用“捆绑安装”安装它,这给了我以下错误消息:

Fetching gem metadata from https,//rubygems.org/"...........
Unfortunately, a fatal error has occurred. Please see the Bundler troubleshooting documentation at
http://bit.ly/bundler-issues. Thanks!

/usr/local/rvm/rubies/ruby-1.9.3-p392/lib/ruby/site_ruby/1.9.1/rubygems/config_file.rb:195:in `merge': can't convert String into Hash (TypeError)
    from /usr/local/rvm/rubies/ruby-1.9.3-p392/lib/ruby/site_ruby/1.9.1/rubygems/config_file.rb:195:in `initialize'
    from /usr/local/rvm/rubies/ruby-1.9.3-p392/lib/ruby/site_ruby/1.9.1/rubygems.rb:364:in `new'
    from /usr/local/rvm/rubies/ruby-1.9.3-p392/lib/ruby/site_ruby/1.9.1/rubygems.rb:364:in `configuration'
    from /usr/local/rvm/gems/ruby-1.9.3-p392/gems/bundler-1.3.4/lib/bundler/rubygems_integration.rb:34:in `configuration'
    from /usr/local/rvm/gems/ruby-1.9.3-p392/gems/bundler-1.3.4/lib/bundler/rubygems_integration.rb:53:in `sources='
    from /usr/local/rvm/gems/ruby-1.9.3-p392/gems/bundler-1.3.4/lib/bundler/source/rubygems.rb:249:in `remote_specs'
    from /usr/local/rvm/gems/ruby-1.9.3-p392/gems/bundler-1.3.4/lib/bundler/source/rubygems.rb:162:in `fetch_specs'
    from /usr/local/rvm/gems/ruby-1.9.3-p392/gems/bundler-1.3.4/lib/bundler/source/rubygems.rb:66:in `specs'
    from /usr/local/rvm/gems/ruby-1.9.3-p392/gems/bundler-1.3.4/lib/bundler/definition.rb:192:in `block (2 levels) in index'
    from /usr/local/rvm/gems/ruby-1.9.3-p392/gems/bundler-1.3.4/lib/bundler/definition.rb:189:in `each'
    from /usr/local/rvm/gems/ruby-1.9.3-p392/gems/bundler-1.3.4/lib/bundler/definition.rb:189:in `block in index'
    from /usr/local/rvm/gems/ruby-1.9.3-p392/gems/bundler-1.3.4/lib/bundler/index.rb:9:in `build'
    from /usr/local/rvm/gems/ruby-1.9.3-p392/gems/bundler-1.3.4/lib/bundler/definition.rb:185:in `index'
    from /usr/local/rvm/gems/ruby-1.9.3-p392/gems/bundler-1.3.4/lib/bundler/definition.rb:179:in `resolve'
    from /usr/local/rvm/gems/ruby-1.9.3-p392/gems/bundler-1.3.4/lib/bundler/definition.rb:114:in `specs'
    from /usr/local/rvm/gems/ruby-1.9.3-p392/gems/bundler-1.3.4/lib/bundler/definition.rb:109:in `resolve_remotely!'
    from /usr/local/rvm/gems/ruby-1.9.3-p392/gems/bundler-1.3.4/lib/bundler/installer.rb:83:in `run'
    from /usr/local/rvm/gems/ruby-1.9.3-p392/gems/bundler-1.3.4/lib/bundler/installer.rb:14:in `install'
    from /usr/local/rvm/gems/ruby-1.9.3-p392/gems/bundler-1.3.4/lib/bundler/cli.rb:247:in `install'
    from /usr/local/rvm/gems/ruby-1.9.3-p392/gems/bundler-1.3.4/lib/bundler/vendor/thor/task.rb:27:in `run'
    from /usr/local/rvm/gems/ruby-1.9.3-p392/gems/bundler-1.3.4/lib/bundler/vendor/thor/invocation.rb:120:in `invoke_task'
    from /usr/local/rvm/gems/ruby-1.9.3-p392/gems/bundler-1.3.4/lib/bundler/vendor/thor.rb:344:in `dispatch'
    from /usr/local/rvm/gems/ruby-1.9.3-p392/gems/bundler-1.3.4/lib/bundler/vendor/thor/base.rb:434:in `start'
    from /usr/local/rvm/gems/ruby-1.9.3-p392/gems/bundler-1.3.4/bin/bundle:20:in `block in <top (required)>'
    from /usr/local/rvm/gems/ruby-1.9.3-p392/gems/bundler-1.3.4/lib/bundler/friendly_errors.rb:3:in `with_friendly_errors'
    from /usr/local/rvm/gems/ruby-1.9.3-p392/gems/bundler-1.3.4/bin/bundle:20:in `<top (required)>'
    from /usr/local/rvm/gems/ruby-1.9.3-p392/bin/bundle:19:in `load'
    from /usr/local/rvm/gems/ruby-1.9.3-p392/bin/bundle:19:in `<main>'
    from /usr/local/rvm/gems/ruby-1.9.3-p392/bin/ruby_noexec_wrapper:14:in `eval'
    from /usr/local/rvm/gems/ruby-1.9.3-p392/bin/ruby_noexec_wrapper:14:in `<main>'

Your error message is messed up, but there seems to be a problem with bundler. 您的错误消息被弄乱了,但是捆绑器似乎有问题。

If not, quick and dirty: Use the twitter-bootstrap-rails gem . 如果没有,那么又快又脏:使用twitter-bootstrap-rails gem It will work for sure. 它肯定会工作。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM