首页 > 解决方案 > Running a forked repo

问题描述

I'm attempting to fork the repo and run it locally. Steps I took so far are:

  1. Download repo
  2. Change gemname gem version in version.rb to 1.4.0 because version is not available
  3. Uninstall and reinstall bundler to version 1.6.1
  4. Run bundle install
  5. Get the error Make sure that gem install gemname -v '1.4' succeeds before bundling.
  6. Run gem install gemname -v '1.4' and installed gem successfully
  7. Run bundle install and I loop back to the error on step 5

I clearly have surveyor installed but yet bundler doesn't seem to recognize this. I'm a novice and very rusty on Rails.

Thanks in advance for your help!

标签: ruby-on-railsruby

解决方案


要依赖 Git repo 中的 gem 版本,请告诉 bundler 从 repo 获取 gem

gem 'surveyor', '~> 1.4', git: 'https://github.com/scwong93/surveyor/'

然后bundle正常运行。你应该看到...

使用来自https://github.com/scwong93/surveyor/的surveyor 1.4.1.q (在master@e253789)

查看您的内部Gemfile.lock,通过从 repo 的 master 分支中拉出它确实找到了 repo 版本 1.4.1q。

GIT
  remote: https://github.com/scwong93/surveyor/
  revision: e25378983fd465db701610eb076179c74db98c11
  specs:
    surveyor (1.4.1.q)
      formtastic (~> 2.2.1)
      haml (>= 4.1.0.beta.1)
      mustache (~> 0.99)
      rabl (~> 0.6)
      rails (>= 3.2)
      sass
      uuidtools (~> 2.1)

推荐阅读