3

当我$bundle install --without production,我得到这个:

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

我的 gemfile 看起来像这样:

source 'https://rubygems.org'

gem 'rails', '3.2.8'

group :development, :test do
gem 'sqlite3', '1.3.5'
gem 'rspec-rails', '2.11.0'
end

# Gems used only for assets and not required
# in production environments by default.
group :assets do
gem 'sass-rails',   '3.2.5'
gem 'coffee-rails', '3.2.2'
gem 'uglifier', '1.2.3'
end

gem 'jquery-rails', '2.0.2'

group :test do
gem 'capybara', '1.1.2'
end

group :production do
gem 'pg', '0.12.2'
end
4

1 回答 1

2

您可能缺少本机扩展的一些依赖项。当你运行gem install nokogiri -v '1.5.5'它应该输出丢失的东西,你可以修复它。

在 Debian/Ubuntu 上,您还可以运行以下命令

sudo apt-get install build-essential openssl libreadline6 libreadline6-dev curl git-core zlib1g zlib1g-dev libssl-dev libyaml-dev libsqlite3-0 libsqlite3-dev sqlite3 libxml2-dev libxslt-dev autoconf libc6-dev ncurses-dev automake libtool bison subversion

安装 Ruby / gems 通常需要的依赖项。这可能会为您解决问题。

于 2012-08-31T23:42:32.730 回答