Warning: file_get_contents(/data/phpspider/zhask/data//catemap/5/ruby-on-rails-4/2.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Ruby on rails 4 activeadmin gem中出现错误_Ruby On Rails 4_Bundle_Activeadmin - Fatal编程技术网

Ruby on rails 4 activeadmin gem中出现错误

Ruby on rails 4 activeadmin gem中出现错误,ruby-on-rails-4,bundle,activeadmin,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

你好,我在这里再次与我的项目中的错误。 我想安装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'

我怀疑您的GEM文件将Desive版本限制为
~>3.1.0
,这意味着它不允许您升级到3.2。您删除
rails4
分支是正确的,因为
master
现在是官方的rails4兼容分支。若你们取消了Desive版本的限制,你们应该可以让它正常工作。

你们只需要在应用程序启动时先捆绑。 不需要输入其他gem文件

gem 'activeadmin', github: 'gregbell/active_admin'
它将自动下载应用程序中所有必需的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.
仅供参考:

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

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.