【问题标题】:Ruby on Rails Bundler activeadmin gem install errorRuby on Rails Bundler activeadmin gem 安装错误
【发布时间】:2014-03-02 20:16:20
【问题描述】:

我在尝试安装 activeadmin gem 时遇到了问题。我正在使用 Ruby 2.0 和 Rails 4.0.2。

这是我在项目目录中运行“捆绑安装”时得到的结果:

C:\Users\Samuel\Desktop\RubyonRailsWorkspace\GroupSRailsProjectNew>bundle install
DL is deprecated, please use Fiddle
Updating git://github.com/gregbell/active_admin.git
fatal: failed to open '/cygdrive/c/Users/Samuel/Desktop/RubyonRailsWorkspace/Gro
upSRailsProjectNew/C:/Ruby200-x64/lib/ruby/gems/2.0.0/cache/bundler/git/active_a
dmin-d67faab65e9b74efbc8efb4a777a851e9f78b2ca/objects': No such file or directory

Retrying git clone --no-checkout "C:/Ruby200-x64/lib/ruby/gems/2.0.0/cache/bundl
er/git/active_admin-d67faab65e9b74efbc8efb4a777a851e9f78b2ca" "C:/Ruby200-x64/li
b/ruby/gems/2.0.0/bundler/gems/active_admin-60d8be97ec2c" due to error (2/3): Bu
ndler::Source::Git::GitCommandError Git error: command `git clone --no-checkout
"C:/Ruby200-x64/lib/ruby/gems/2.0.0/cache/bundler/git/active_admin-d67faab65e9b7
4efbc8efb4a777a851e9f78b2ca" "C:/Ruby200-x64/lib/ruby/gems/2.0.0/bundler/gems/ac
tive_admin-60d8be97ec2c"` in directory C:/Users/Samuel/Desktop/RubyonRailsWorksp
ace/GroupSRailsProjectNew has failed.
If this error persists you could try removing the cache directory 'C:/Ruby200-x6
4/lib/ruby/gems/2.0.0/cache/bundler/git/active_admin-d67faab65e9b74efbc8efb4a777
a851e9f78b2ca'

这是我运行“gem install activeadmin”时得到的结果:

C:\Users\Samuel\Desktop\RubyonRailsWorkspace\GroupSRailsProjectNew>gem install activeadmin
ERROR:  While executing gem ... (Gem::DependencyError)
Unable to resolve dependencies: rails requires activesupport (= 3.2.16), actionpack 
(= 3.2.16); actionmailer requires actionpack (= 3.2.16); activeresource
requires activesupport (= 3.2.16); meta_search requires activesupport (~> 3.1),
actionpack (~> 3.1); activerecord requires activesupport (= 3.2.16); activemodel
requires activesupport (= 3.2.16), builder (~> 3.0.0); railties requires rack-s
sl (~> 1.3.2), rdoc (~> 3.4), activesupport (= 3.2.16), actionpack (= 3.2.16)

这是我的 GemFile:

source 'https://rubygems.org'

# Bundle edge Rails instead: gem 'rails', github: 'rails/rails'
gem 'rails', '4.0.2'

# Use sqlite3 as the database for Active Record
gem 'sqlite3'

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

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

#Use CarrierWave for File uploading
gem 'carrierwave'

gem 'mini_magick'

gem 'jquery-fileupload-rails'

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

# Admin Panel
#gem "ransack", github: "activerecord-hackery/ransack", branch: "rails-4"
gem 'activeadmin', github: 'gregbell/active_admin'
#gem 'i18n', github: 'svenfuchs/i18n'


# See https://github.com/sstephenson/execjs#readme for more supported runtimes
# gem 'therubyracer', platforms: :ruby

# Use jquery as the JavaScript library
gem 'jquery-rails'

# Turbolinks makes following links in your web application faster. Read more:      https://github.com/rails/turbolinks
gem 'turbolinks'

# Build JSON APIs with ease. Read more: https://github.com/rails/jbuilder
gem 'jbuilder', '~> 1.2'

group :doc do
  # bundle exec rake doc:rails generates the API under doc/api.
  gem 'sdoc', require: false
end

gem 'execjs'
# gem 'therubyracer'

# Use ActiveModel has_secure_password
# gem 'bcrypt-ruby', '~> 3.1.2'

# Use unicorn as the app server
# gem 'unicorn'

# Use Capistrano for deployment
# gem 'capistrano', group: :development

# Use debugger
# gem 'debugger', group: [:development, :test]

如果能解决此问题,我们将不胜感激。

【问题讨论】:

    标签: ruby-on-rails ruby cygwin bundler activeadmin


    【解决方案1】:

    您正在从 运行bundle install,而已经开始从 shell 运行它,尝试从 shell 运行它,因为我看到你已经混合了本机 , 和 路径样式向上。

    【讨论】:

    • 感谢您的帮助!我只是将 msysgit 用于“捆绑安装”并且它有效。但是,当我运行 gem install activeadmin 时,我仍然得到 Gem::DependencyError。不过这应该没关系,因为我是通过 Gemfile 安装的,对吗?
    • @EighthEmperor 这个工作gem install activeadmin?
    • 有人告诉我,如果我用 Bundler 安装它,我不需要使用 gem install。这是正确的吗?
    • @EighthEmperor bundle 以同样的方式安装已发布的 gem。所以只需尝试gem install activeadmin。是否给出:C:\Users\Samuel\Desktop\RubyonRailsWorkspace\GroupSRailsProjectNew>bundle install DL is deprecated, please use Fiddle?
    • "gem install activeadmin" 对我不起作用,但我已经通过在我的 Gemfile 上使用 bundle install 安装了它。 “DL 已弃用,请使用 Fiddle”只是一个警告。
    【解决方案2】:

    您尝试安装的 gem 需要 rails 3.2.* 并且您使用的是 4.0。要么降级铁轨,要么使用另一颗宝石。

    使用它为 rails 4 安装 activeadmin:Active admin install with Rails 4

    gem 'activeadmin', github: 'gregbell/active_admin', branch: "rails4"
    

    【讨论】:

    • 我读到 Rails 4 分支已经合并到 master 中,我现在可以使用:gem 'activeadmin', github: 'gregbell/active_admin' 就好了。
    猜你喜欢
    • 1970-01-01
    • 2015-07-15
    • 2019-03-01
    • 1970-01-01
    • 2021-08-18
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多