gpt4 book ai didi

ruby-on-rails - 无法安装 bundle

转载 作者:行者123 更新时间:2023-12-04 03:33:32 25 4
gpt4 key购买 nike

我正在按照 Rails Tutorial Chapter 3 上的说明进行操作.当运行命令行 bundle install --without production 我得到:

Bundler could not find compatible versions for gem "sprockets-rails":

In snapshot (Gemfile.lock):
sprockets-rails (2.1.3)

In Gemfile:

sass-rails (= 4.0.1) ruby depends on
sprockets-rails (~> 2.0.0) ruby

运行 bundle update 将从头开始重建您的快照,仅使用Gemfile 中的 gem,这可能会解决冲突。

运行 bundle update 时我得到:

An error occurred while installing nokogiri (1.6.2.1), and Bundler cannot continue.
Make sure that `gem install nokogiri -v '1.6.2.1'` succeeds before bundling.

当我运行 gem install nokogiri -v '1.6.2.1' 时,它会提示:

Building native extensions. This could take a while... Building nokogiri using packaged libraries. ERROR: Error installing nokogiri: ERROR: Failed to build gem native extension. /Users/yotamros/.rvm/rubies/ruby-2.1.2/bin/ruby extconf.rb Building nokogiri using packaged libraries. ----- libiconv is missing. please visit nokogiri.org/tutorials/installing_nokogiri.html for help with installing dependencies. ----- * extconf.rb failed *

这是我的 Gemfile:

source 'https://rubygems.org'
ruby '2.1.2'
#ruby-gemset=railstutorial_rails_4_0

gem 'rails', '4.1.1'

group :development, :test do
gem 'sqlite3', '1.3.8'
gem 'rspec-rails', '2.13.1'
end

group :test do
gem 'selenium-webdriver', '2.35.1'
gem 'capybara', '2.1.0'
end

gem 'sass-rails', '4.0.1'
gem 'uglifier', '2.1.1'
gem 'coffee-rails', '4.0.1'
gem 'jquery-rails', '3.0.4'
gem 'turbolinks', '1.1.1'
gem 'jbuilder', '1.0.2'

group :doc do
gem 'sdoc', '0.3.20', require: false
end

group :production do
gem 'pg', '0.15.1'
gem 'rails_12factor', '0.0.2'
end

任何帮助将不胜感激。

最佳答案

我找到了适合我的解决方案 here (克劳迪奥波利):

  1. brew 重新安装 libiconv libxml2 libxslt
  2. gem install nokogiri -- --with-iconv-dir=/usr/local/Cellar/libiconv/1.14/

关于ruby-on-rails - 无法安装 bundle ,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/23965357/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com