尝试安装运行twitter Bootstrap gem所需的gem - 运行bundle时出错

时间:2013-10-23 16:00:33

标签: ruby-on-rails twitter-bootstrap gem dependencies

我有一个常规的Rails 4应用程序,我试图加入twitter引导程序框架。

我的gemfile的相关部分如下所示:

  #Gems used only for assets and not required  in production environments by default
  group :assets do

  # See https://github.com/sstephenson/execjs#readme for more supported runtimes
  gem "therubyracer", :require => 'v8'

  gem "less-rails", "~> 2.4.2"

  # Use SCSS for stylesheets
  gem 'sass-rails', '~> 4.0.0'

  # Use CoffeeScript for .js.coffee assets and views
  gem 'coffee-rails', '~> 4.0.0'

  # Use Uglifier as compressor for JavaScript assets
  gem 'uglifier', '>= 1.3.0'

  gem "twitter-bootstrap-rails", "~> 2.2.8"

  end

当我在终端上运行bundle命令时出现此错误:

 > bundle
 Fetching gem metadata from https://rubygems.org/...........
 Fetching gem metadata from https://rubygems.org/..
 Resolving dependencies...
 Using rake (10.1.0)
 Using i18n (0.6.5)
 Using minitest (4.7.5)
 Using multi_json (1.8.0)
 Using atomic (1.1.14)
 Using thread_safe (0.1.3)
 Using tzinfo (0.3.37)
 Using activesupport (4.0.0)
 Using builder (3.1.4)
 Using erubis (2.7.0)
 Using rack (1.5.2)
 Using rack-test (0.6.2)
 Using actionpack (4.0.0)
 Using mime-types (1.25)
 Using polyglot (0.3.3)
 Using treetop (1.4.15)
 Using mail (2.5.4)
 Using actionmailer (4.0.0)
 Using activemodel (4.0.0)
 Using activerecord-deprecated_finders (1.0.3)
 Using arel (4.0.0)
 Using activerecord (4.0.0)
 Using annotate (2.5.0)
 Using bundler (1.3.5)
 Using coffee-script-source (1.6.3)
 Using execjs (2.0.2)
 Using coffee-script (2.2.0)
 Using thor (0.18.1)
 Using railties (4.0.0)
 Using coffee-rails (4.0.0)

 Gem::RemoteFetcher::FetchError: SSL_connect returned=1 errno=0 state=SSLv3 read server 
 certificate B: certificate verify failed 
 (https://s3.amazonaws.com/production.s3.rubygems.org/gems/commonjs-0.2.7.gem)

 An error occurred while installing commonjs (0.2.7), and Bundler cannot continue.

 Make sure that `gem install commonjs -v '0.2.7'` succeeds before bundling.

我做错了什么?感谢

1 个答案:

答案 0 :(得分:0)

这是Mac上的常见问题(对我而言)。尝试更新openssl:

router.post('/register', function (req, resp) {
    var api = "/user/register"
    var data = req.body)
    request({
        url: api,
        method: "POST",
        json: true,
        headers: {'session_id' : req.cookies.session_id},
        body: {
            "tel": data.tel, "code": data.code,
            "password": data.passwd, "referee": data.recommend
        }
    }, function (error, response, body) {
        resp.cookies('session_id', response.headers['sessionId'])
        resp.json(body)
    })
})

有时更新符号链接和证书也很有用:

brew update
brew install openssl

如果这没有用,并且您正在使用RVM尝试更新rvm的证书:

brew link openssl --force
brew install curl-ca-bundle

希望这有帮助!