activeadmin gem出错

时间:2014-01-29 04:34:53

标签: ruby-on-rails-4 bundle activeadmin

你好我在这里再次出现我的项目中的错误。 我想安装activeadmin gem,但它显示我的错误如下所示。我的rails版本是4.0.0

我查看了所提供的解决方案,但随后它也显示了错误。

Updating git://github.com/gregbell/active_admin.git
fatal: ambiguous argument 'rails4': unknown revision or path not in the working
tree.
Use '--' to separate paths from revisions, like this:
'git <command> [<revision>...] -- [<file>...]'
Git error: command `git rev-parse rails4` in directory
 C:/RailsInstaller/Ruby2.0.0/lib/ruby/gems/2.0.0/cache/bundler/git/active_admin-d
 67faab65e9b74efbc8efb4a777a851e9f78b2ca has failed.
If this error persists you could try removing the cache directory
'C:/RailsInstaller/Ruby2.0.0/lib/ruby/gems/2.0.0/cache/bundler/git/active_admin-
 d67faab65e9b74efbc8efb4a777a851e9f78b2ca'

如果我删除了分支名称,则会显示错误

Updating git://github.com/gregbell/active_admin.git
Resolving dependencies...
Bundler could not find compatible versions for gem "devise":
 In Gemfile:
activeadmin (>= 0) x86-mingw32 depends on
  devise (~> 3.2) x86-mingw32

devise (3.1.1)

3 个答案:

答案 0 :(得分:2)

只需要先启动app即可。 无需输入其他gem文件。

gem 'activeadmin', github: 'gregbell/active_admin'

在Gemfile和bundle中。它会自动下载你应用程序中所有必需的gem。

C:\Sites\try>bundle
Updating git://github.com/gregbell/active_admin.git
Fetching gem metadata from https://rubygems.org/...........
Fetching gem metadata from https://rubygems.org/..
Resolving dependencies...
Using rake (10.1.1)
Using i18n (0.6.9)
Using minitest (4.7.5)
Using multi_json (1.8.4)
Using atomic (1.1.14)
Using thread_safe (0.1.3)
Using tzinfo (0.3.38)
Using activesupport (4.0.0)
Using builder (3.1.4)
Using erubis (2.7.0)
Using rack (1.5.2)
Using rack-test (0.6.2)
Using actionpack (4.0.0)
Using mime-types (1.25.1)
Using polyglot (0.3.3)
Using treetop (1.4.15)
Using mail (2.5.4)
Using actionmailer (4.0.0)
Installing arbre (1.0.1)
 Using sass (3.2.14)
Using thor (0.18.1)
Installing bourbon (3.1.8)
Using coffee-script-source (1.6.3)
Using execjs (2.0.2)
Using coffee-script (2.2.0)
Using railties (4.0.0)
Using coffee-rails (4.0.1)
Using bcrypt-ruby (3.1.2)
Installing orm_adapter (0.5.0)
Using warden (1.2.3)
Installing devise (3.2.2)
Installing formtastic (2.3.0.rc2)
Installing has_scope (0.6.0.rc)
Installing responders (1.0.0)
Installing inherited_resources (1.4.1)
Using jquery-rails (3.0.4)
Using jquery-ui-rails (4.1.1)
Installing kaminari (0.15.1)
Using activemodel (4.0.0)
Using activerecord-deprecated_finders (1.0.3)
Using arel (4.0.1)
Using activerecord (4.0.0)
Using bundler (1.3.5)
Using hike (1.2.3)
Using tilt (1.4.1)
Using sprockets (2.10.1)
Using sprockets-rails (2.0.1)
Using rails (4.0.0)
Installing polyamorous (0.6.4)
Installing ransack (1.1.0)
 Using sass-rails (4.0.1)
Using activeadmin (1.0.0.pre) from git://github.com/gregbell/active_admin.git (at master)
Using jbuilder (1.5.3)
Using json (1.8.1)
Using pg (0.17.0)
Using rdoc (4.1.1)
Using sdoc (0.4.0)
Using turbolinks (2.2.0)
Using uglifier (2.4.0)
Your bundle is complete!
Use `bundle show [gemname]` to see where a bundled gem is installed.

答案 1 :(得分:1)

我怀疑您的Gemfile会将您的设计版本限制为~> 3.1.0,这意味着它不会让您升级到3.2。删除rails4分支是正确的,因为master现在是Rails4兼容的官方分支。如果你删除你的设计版本限制,你应该可以让它工作。

答案 2 :(得分:0)

仅供参考:

如果某人遇到类似的问题,并且已经拥有gem'depaise',而Gemfile中没有版本,那么首先进行捆绑安装,然后尝试使用active_admin更新Gemfile