【问题标题】:Gitlab import: Could not locate GemfileGitlab导入:找不到Gemfile
【发布时间】:2014-06-16 09:47:54
【问题描述】:

我有一个带有 Debian Wheezy 的测试虚拟机,但没有安装 ruby​​。 Gitlab 6.9.2 已使用提供的安装程序安装,该安装程序带有嵌入式 ruby​​。现在,我想将一些旧的 repos 导入 Gitlab,但我找不到正确的过程。我觉得应该是这样的:

su - git
export PATH=$PATH:/opt/gitlab/embedded/bin
cd ~
bundle exec rake gitlab:import:repos RAILS_ENV=production

不过,我只收到错误“无法找到 Gemfile”。我尝试了其他几种方法,还安装了 Debians ruby​​,搜索了多个 Google 和 StackOverflow 结果,但我无法让它工作。

【问题讨论】:

    标签: gitlab


    【解决方案1】:

    您应该首先将 bare 存储库放在 repo 目录中。综合的default path/var/opt/gitlab/git-data/repositories/<namespace>。然后你只需运行 rake 任务:

    sudo -u git -H cp -r my-project/.git /var/opt/gitlab/git-data/repositories/<namespace>/my-project.git
    sudo gitlab-rake gitlab:import:repos
    

    参见invoking rake tasksimport mechanism

    编辑:发送MR upstream 以将此信息包含在自述文件中。

    【讨论】:

      【解决方案2】:

      我遇到了与“找不到 Gemfile”相同的问题。所以我搜索了 Gemfile 并尝试了几个文件夹。直到成功为止。

      该解决方案从源代码与 Gitlab 相关(或者在我的情况下它在 offical docker container 中运行)。

      将您的 .git 裸存储库(或其中几个)放在 "/var/opt/gitlab/git-data/repositories//my-project.git"

      切换到用户“git”。

      su git
      

      试试“rake”是否有正确的 PATH。如果不可用,请扩展您的 PATH:

      export PATH=$PATH:/opt/gitlab/embedded/bin
      

      在切换到 shell 之后,用于导入裸项目的 rake 命令将起作用并进行导入。

      cd /opt/gitlab/embedded/service/gitlab-rails/
      bundle exec rake gitlab:import:repos RAILS_ENV=production
      

      输出将与此类似:

      Processing raspberry/apollo-web.git
       * Created apollo-web (raspberry/apollo-web.git)
      Processing raspberry/apollo-web.wiki.git
       * Skipping wiki repo
      Processing dhbw/dhbw-prototyping-node-rest-course.git
      ...
      

      编辑: 好吧,我高兴得太早了。虽然输出说它是进口的。在 Web GUI 上没有新项目。

      我会进一步调查...

      【讨论】:

      • 好吧,我高兴得太早了。虽然输出说它是进口的。在 Web GUI 上没有新项目。我会进一步调查...
      猜你喜欢
      • 2019-03-17
      • 2015-01-21
      • 1970-01-01
      • 2011-03-20
      • 2017-07-12
      • 1970-01-01
      • 2017-03-27
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多