2014-01-29 29 views
2

你好我在這裏再次遇到了我的項目中的錯誤。 我想安裝activeadmin寶石,但它顯示錯誤如下。我的rails版本是4.0.0activeadmin gem中的錯誤

我期待提供的解決方案,但它也顯示我錯誤。

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) 

回答

1

我懷疑你的Gemfile限制你的色器件版本類似~> 3.1.0,這意味着它不會讓你升級到3.2。您在刪除rails4分支時是正確的,因爲master現在是官方的Rails4兼容分支。如果你刪除你的設計版本限制,你應該能夠得到它的工作。

2

只需要在應用程序啓動時首先進行捆綁。 無需輸入其他寶石文件。

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. 
0

只爲信息:

如果有人面臨着類似的問題,而且已經有了寶玉「設計」,沒有版本的Gemfile中,然後首先做一個捆綁安裝,然後嘗試用active_admin

更新的Gemfile