尝试加载gem' activeadmin'时出错。 (捆扎机:: GemRequireError)

时间:2016-02-29 11:21:21

标签: ruby-on-rails ruby bundler gem-bundler

我在gemfile中添加了一个gem(gem' presto-client','〜> 0.4.5')后,我进行了bundle install和bundle update。我的ruby版本是 - >红宝石2.1.6 在启动rails应用程序时,我收到以下错误 -

/home/user/.rvm/gems/ruby-2.1.6/gems/tlsmail-0.0.1/lib/net/smtp.rb:806: warning: already initialized constant Net::SMTPSession
/home/user/.rvm/gems/ruby-2.1.6/gems/tlsmail-0.0.1/lib/net/smtp.rb:806: warning: previous definition of SMTPSession was here
/home/user/.rvm/gems/ruby-2.1.6/gems/tlsmail-0.0.1/lib/net/pop.rb:687: warning: already initialized constant Net::POP
/home/user/.rvm/gems/ruby-2.1.6/gems/tlsmail-0.0.1/lib/net/pop.rb:687: warning: previous definition of POP was here
/home/user/.rvm/gems/ruby-2.1.6/gems/tlsmail-0.0.1/lib/net/pop.rb:688: warning: already initialized constant Net::POPSession
/home/user/.rvm/gems/ruby-2.1.6/gems/tlsmail-0.0.1/lib/net/pop.rb:688: warning: previous definition of POPSession was here
/home/user/.rvm/gems/ruby-2.1.6/gems/tlsmail-0.0.1/lib/net/pop.rb:689: warning: already initialized constant Net::POP3Session
/home/user/.rvm/gems/ruby-2.1.6/gems/tlsmail-0.0.1/lib/net/pop.rb:689: warning: previous definition of POP3Session was here
/home/user/.rvm/gems/ruby-2.1.6/gems/tlsmail-0.0.1/lib/net/pop.rb:702: warning: already initialized constant Net::APOPSession
/home/user/.rvm/gems/ruby-2.1.6/gems/tlsmail-0.0.1/lib/net/pop.rb:702: warning: previous definition of APOPSession was here
/home/user/.rvm/gems/ruby-2.1.6/gems/bundler-1.11.2/lib/bundler/runtime.rb:80:in `rescue in block (2 levels) in require': There was an error while trying to load the gem 'activeadmin'. (Bundler::GemRequireError)
    from /home/user/.rvm/gems/ruby-2.1.6/gems/bundler-1.11.2/lib/bundler/runtime.rb:76:in `block (2 levels) in require'
    from /home/user/.rvm/gems/ruby-2.1.6/gems/bundler-1.11.2/lib/bundler/runtime.rb:72:in `each'
    from /home/user/.rvm/gems/ruby-2.1.6/gems/bundler-1.11.2/lib/bundler/runtime.rb:72:in `block in require'
    from /home/user/.rvm/gems/ruby-2.1.6/gems/bundler-1.11.2/lib/bundler/runtime.rb:61:in `each'
    from /home/user/.rvm/gems/ruby-2.1.6/gems/bundler-1.11.2/lib/bundler/runtime.rb:61:in `require'
    from /home/user/.rvm/gems/ruby-2.1.6/gems/bundler-1.11.2/lib/bundler.rb:99:in `require'
    from /home/user/src/qbol/tapp/config/application.rb:8:in `<top (required)>'
    from /home/user/.rvm/gems/ruby-2.1.6/gems/railties-3.2.17/lib/rails/commands.rb:53:in `require'
    from /home/user/.rvm/gems/ruby-2.1.6/gems/railties-3.2.17/lib/rails/commands.rb:53:in `block in <top (required)>'
    from /home/user/.rvm/gems/ruby-2.1.6/gems/railties-3.2.17/lib/rails/commands.rb:50:in `tap'
    from /home/user/.rvm/gems/ruby-2.1.6/gems/railties-3.2.17/lib/rails/commands.rb:50:in `<top (required)>'
    from script/rails:6:in `require'
    from script/rails:6:in `<main>'

Activeadmin已安装在我的系统上。

 bundle show activeadmin
/home/user/.rvm/gems/ruby-2.1.6/gems/activeadmin-0.6.6

以下是我的宝石文件 -

source 'http://rubygems.org'
gem 'rails', '3.2.17'

# Bundle edge Rails instead:
# gem 'rails',     :git => 'git://github.com/rails/rails.git'

gem 'sqlite3'
gem 'rabl', '~> 0.8.0'
gem 'yajl-ruby'
gem 'json'
gem "zendesk_api"
gem 'google-api-client'
gem 'ruby-saml'
#gem 'presto-client', '~> 0.4.8'

gem 'jquery-rails'
gem 'therubyracer', '~> 0.12.0'

gem 'activevalidators', '~> 1.8.1'

# To use ActiveModel has_secure_password
# gem 'bcrypt-ruby', '~> 3.0.0'

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

# Deploy with Capistrano
# gem 'capistrano'

# To use debugger
# gem 'ruby-debug'

gem 'mysql2', '~> 0.3'
gem 'annotate'
gem 'will_paginate'
gem 'net-ssh', '~> 2.7.0'
gem 'dogapi'
gem 'devise', '~> 1.5.2'
gem 'haml'
gem 'cancan'
gem 'open4'

gem 'tlsmail'

gem 'backgroundrb-rails3', :require => 'backgroundrb'

gem 'jslint_on_rails'

gem 'flash_render'

gem 'dbi', '~> 0.4.5'

gem 'dbd-mysql'

gem 'uuidtools'

gem 'aws-sdk', '1.40.3'

gem 'aws-sdk-resources', '~> 2'

gem 'algorithms'

gem 'ezcrypto'
gem 'delayed_job_active_record'
gem "daemons", '~>1.0.10'
gem 'activeadmin'
gem 'sass-rails',   '~> 3.2.6'
gem "meta_search",    '>= 1.1.0.pre'

gem "switch_user"

gem "stripe", '>= 1.7.4'

gem 'acts_as_paranoid', '~> 0.4.3'

gem 'lhm', '2.2.0'

我还完成了捆绑更新和捆绑安装。

我正在尝试运行所有给出here的命令,但由于我收到错误无法加载activeadmin错误,因此我无法运行第一步。 我该如何解决这个错误?

修改 在做一个宝石列表我得到 - activeadmin(0.6.6,0.6.0,0.5.1),Irestricted activeadmin在gem文件中使用0.6.6版本,但我仍然遇到同样的错误。

2 个答案:

答案 0 :(得分:1)

尝试安装nodejs,编译某些资产需要JavaScript运行时,我认为这是个问题。 至少为我工作:

ArchLinux:pacman -S nodejs

Ubuntu:apt-get install nodejs

Mac:可能使用自制软件

答案 1 :(得分:0)

在1.0 pre4版本中遇到相同的错误

gem 'activeadmin', '~> 1.0.0.pre4'

我将其更改为:

gem 'activeadmin'

再次运行捆绑程序后,

bundle

它安装了适用于我的最新版本。

Fetching activeadmin 1.3.1
Installing activeadmin 1.3.1