简体   繁体   English

Rails:从 github 下载后,Bundle Install 无法安装必要的 gem

[英]Rails: Bundle Install fails to install necessary gem after downloading from github

I have cloned from my github account a repo, I am getting the following error, when i run bundle install.我从我的 github 帐户克隆了一个 repo,当我运行 bundle install 时出现以下错误。 i cant understand the reason for it.我无法理解它的原因。 The repo had been pushed from my pc and now i am cloning it to my laptop回购已从我的电脑推送,现在我将其克隆到我的笔记本电脑

An error occurred while installing sassc (2.2.1), and Bundler cannot continue.
Make sure that `gem install sassc -v '2.2.1' --source 'https://rubygems.org/'` succeeds before bundling.

In Gemfile:
  sass-rails was resolved to 6.0.0, which depends on
    sassc-rails was resolved to 2.1.2, which depends on
      sassc

This is a known issue: https://github.com/sass/sassc-ruby/issues/153这是一个已知问题: https://github.com/sass/sassc-ruby/issues/153

Solution:解决方案:

  1. add gem 'sassc', '~> 2.1.0' to your gemfile.gem 'sassc', '~> 2.1.0'添加到您的 gemfile 中。

  2. run bundle install运行bundle install

This will force it to use sassc version 2.1.0 which doesn't have the compile issue with Rails 6.这将强制它使用 sassc 版本 2.1.0,它没有 Rails 6 的编译问题。


As a tip, whenever a gem fails to install or conflicts with another gem, it's a good idea to go check out the gem itself.作为提示,每当一个 gem 安装失败或与另一个 gem 冲突时,go 检查 gem 本身是个好主意。 99% of the time, the code is on GitHub. 99% 的时间,代码在 GitHub 上。

If you're new to this, try following these steps:如果您对此不熟悉,请尝试按照以下步骤操作:

  1. Gems in your gemfile come from https://rubygems.org by default, so visit that site and search for the gem exactly as it's named in your gemfile.默认情况下,gemfile 中的 gem 来自https://rubygems.org ,因此请访问该站点并完全按照 gemfile 中的名称搜索 gem。 In this case, it's here: https://rubygems.org/gems/sassc在这种情况下,它在这里: https://rubygems.org/gems/sassc

  2. On the gem's info page, find links on the righthand side.在 gem 的信息页面上,在右侧找到链接。 Click 'homepage'.点击“主页”。 For sassc, it takes you to this URL: https://github.com/sass/sassc-ruby对于sassc,它带你到这个URL: https://github.com/sass/sassc-ruby

  3. Click on the issues tab and look for anything related to the thing you're struggling with.单击问题选项卡并查找与您正在努力解决的问题相关的任何内容。 In this case, I found about 3. Read through those issues and see if people have posted solutions or work-arounds.在这种情况下,我发现了大约 3 个。通读这些问题,看看人们是否发布了解决方案或变通方法。

Happy gem hunting!快乐的宝石狩猎!

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

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