Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/ruby-on-rails/64.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 在使用最新Ruby(2.4.1)和#x2B;轨道_Ruby On Rails_Json_Ruby_Rubygems_Upgrade - Fatal编程技术网

Ruby on rails 在使用最新Ruby(2.4.1)和#x2B;轨道

Ruby on rails 在使用最新Ruby(2.4.1)和#x2B;轨道,ruby-on-rails,json,ruby,rubygems,upgrade,Ruby On Rails,Json,Ruby,Rubygems,Upgrade,我刚刚尝试恢复我的一个旧Rails应用程序,它创建于2016年7月 在我的新机器上捆绑新安装的Ruby和Rails时,我遇到了这个错误,因为json现在包含在Rails中,不再需要在文件中: An error occurred while installing json (1.8.3), and Bundler cannot continue. Make sure that gem install json -v '1.8.3'` succeeds before bundling. 如果我从G

我刚刚尝试恢复我的一个旧Rails应用程序,它创建于2016年7月

在我的新机器上捆绑新安装的Ruby和Rails时,我遇到了这个错误,因为
json
现在包含在Rails中,不再需要在文件中:

An error occurred while installing json (1.8.3), and Bundler cannot continue. Make sure that gem install json -v '1.8.3'` succeeds before bundling.
如果我从Gemfile.lock中删除gem(编辑:这可能非常愚蠢,但是Gemfile中没有提到json,为什么我查看Gemfile.lock),我会得到
,不幸的是,发生了一个意外错误,Bundler无法继续。
关于bundle安装:

The git source `git://github.com/flori/json.git` uses the `git` protocol, which transmits data without encryption. Disable this warning with `bundle config git.allow_insecure true`, or switch to the `https` protocol to keep your data secure.
The git source `git://github.com/capistrano/rbenv.git` uses the `git` protocol, which transmits data without encryption. Disable this warning with `bundle config git.allow_insecure true`, or switch to the `https` protocol to keep your data secure.
Fetching git://github.com/flori/json.git
The git source `git://github.com/flori/json.git` uses the `git` protocol, which transmits data without encryption. Disable this warning with `bundle config git.allow_insecure true`, or switch to the `https` protocol to keep your data secure.
The git source `git://github.com/capistrano/rbenv.git` uses the `git` protocol, which transmits data without encryption. Disable this warning with `bundle config git.allow_insecure true`, or switch to the `https` protocol to keep your data secure.
--- ERROR REPORT TEMPLATE -------------------------------------------------------
# Error Report

## Questions

Please fill out answers to these questions, it'll help us figure out
why things are going wrong.

- **What did you do?**

  I ran the command `/home/howard/.rbenv/versions/2.4.1/bin/bundle install`

- **What did you expect to happen?**

  I expected Bundler to...

- **What happened instead?**

  Instead, what happened was...

- **Have you tried any solutions posted on similar issues in our issue tracker, stack overflow, or google?**

  I tried...

- **Have you read our issues document, https://github.com/bundler/bundler/blob/master/doc/contributing/ISSUES.md?**

  ...

## Backtrace

```
ArgumentError: Invalid source: nil
  /home/howard/.rbenv/versions/2.4.1/lib/ruby/gems/2.4.0/gems/bundler-1.15.3/lib/bundler/source_list.rb:107:in `source_list_for'
  /home/howard/.rbenv/versions/2.4.1/lib/ruby/gems/2.4.0/gems/bundler-1.15.3/lib/bundler/source_list.rb:56:in `get'
  /home/howard/.rbenv/versions/2.4.1/lib/ruby/gems/2.4.0/gems/bundler-1.15.3/lib/bundler/definition.rb:746:in `block in converge_locked_specs'
  /home/howard/.rbenv/versions/2.4.1/lib/ruby/2.4.0/forwardable.rb:229:in `each'
  /home/howard/.rbenv/versions/2.4.1/lib/ruby/2.4.0/forwardable.rb:229:in `each'
  /home/howard/.rbenv/versions/2.4.1/lib/ruby/gems/2.4.0/gems/bundler-1.15.3/lib/bundler/definition.rb:743:in `converge_locked_specs'
  /home/howard/.rbenv/versions/2.4.1/lib/ruby/gems/2.4.0/gems/bundler-1.15.3/lib/bundler/definition.rb:228:in `resolve'
  /home/howard/.rbenv/versions/2.4.1/lib/ruby/gems/2.4.0/gems/bundler-1.15.3/lib/bundler/definition.rb:159:in `specs'
  /home/howard/.rbenv/versions/2.4.1/lib/ruby/gems/2.4.0/gems/bundler-1.15.3/lib/bundler/definition.rb:147:in `resolve_remotely!'
  /home/howard/.rbenv/versions/2.4.1/lib/ruby/gems/2.4.0/gems/bundler-1.15.3/lib/bundler/installer.rb:226:in `resolve_if_need'
  /home/howard/.rbenv/versions/2.4.1/lib/ruby/gems/2.4.0/gems/bundler-1.15.3/lib/bundler/installer.rb:78:in `run'
  /home/howard/.rbenv/versions/2.4.1/lib/ruby/gems/2.4.0/gems/bundler-1.15.3/lib/bundler/installer.rb:24:in `install'
  /home/howard/.rbenv/versions/2.4.1/lib/ruby/gems/2.4.0/gems/bundler-1.15.3/lib/bundler/cli/install.rb:68:in `run'
  /home/howard/.rbenv/versions/2.4.1/lib/ruby/gems/2.4.0/gems/bundler-1.15.3/lib/bundler/cli.rb:191:in `block in install'
  /home/howard/.rbenv/versions/2.4.1/lib/ruby/gems/2.4.0/gems/bundler-1.15.3/lib/bundler/settings.rb:92:in `temporary'
  /home/howard/.rbenv/versions/2.4.1/lib/ruby/gems/2.4.0/gems/bundler-1.15.3/lib/bundler/cli.rb:190:in `install'
  /home/howard/.rbenv/versions/2.4.1/lib/ruby/gems/2.4.0/gems/bundler-1.15.3/lib/bundler/vendor/thor/lib/thor/command.rb:27:in `run'
  /home/howard/.rbenv/versions/2.4.1/lib/ruby/gems/2.4.0/gems/bundler-1.15.3/lib/bundler/vendor/thor/lib/thor/invocation.rb:126:in `invoke_command'
  /home/howard/.rbenv/versions/2.4.1/lib/ruby/gems/2.4.0/gems/bundler-1.15.3/lib/bundler/vendor/thor/lib/thor.rb:369:in `dispatch'
  /home/howard/.rbenv/versions/2.4.1/lib/ruby/gems/2.4.0/gems/bundler-1.15.3/lib/bundler/cli.rb:22:in `dispatch'
  /home/howard/.rbenv/versions/2.4.1/lib/ruby/gems/2.4.0/gems/bundler-1.15.3/lib/bundler/vendor/thor/lib/thor/base.rb:444:in `start'
  /home/howard/.rbenv/versions/2.4.1/lib/ruby/gems/2.4.0/gems/bundler-1.15.3/lib/bundler/cli.rb:13:in `start'
  /home/howard/.rbenv/versions/2.4.1/lib/ruby/gems/2.4.0/gems/bundler-1.15.3/exe/bundle:30:in `block in <top (required)>'
  /home/howard/.rbenv/versions/2.4.1/lib/ruby/gems/2.4.0/gems/bundler-1.15.3/lib/bundler/friendly_errors.rb:121:in `with_friendly_errors'
  /home/howard/.rbenv/versions/2.4.1/lib/ruby/gems/2.4.0/gems/bundler-1.15.3/exe/bundle:22:in `<top (required)>'
  /home/howard/.rbenv/versions/2.4.1/bin/bundle:22:in `load'
  /home/howard/.rbenv/versions/2.4.1/bin/bundle:22:in `<main>'
```

## Environment

```
Bundler   1.15.3
Rubygems  2.6.11
Ruby      2.4.1p111 (2017-03-22 revision 58053) [x86_64-linux]
GEM_HOME  /home/howard/.rbenv/versions/2.4.1/lib/ruby/gems/2.4.0
GEM_PATH  /home/howard/.rbenv/versions/2.4.1/lib/ruby/gems/2.4.0:/home/howard/.gem/ruby/2.4.0
Git       2.7.4
Platform  x86_64-linux
OpenSSL   OpenSSL 1.0.2g  1 Mar 2016
```

## Bundler settings

```
without
  Set for your local app (/home/howard/Downloads/telefon/code/.bundle/config): "development:test"
```

## Gemfile

### Gemfile

```ruby
source 'https://rubygems.org'


# Bundle edge Rails instead: gem 'rails', github: 'rails/rails'
gem 'rails', '4.2.6'
# Use sqlite3 as the database for Active Record
gem 'sqlite3'
# Use SCSS for stylesheets
gem 'sass-rails', '~> 5.0'
# Use Uglifier as compressor for JavaScript assets
gem 'uglifier', '>= 1.3.0'
# Use CoffeeScript for .coffee assets and views
gem 'coffee-rails', '~> 4.1.0'
# See https://github.com/rails/execjs#readme for more supported runtimes
# gem 'therubyracer', platforms: :ruby

gem 'capistrano', '~> 3.1.0'
gem 'capistrano-bundler', '~> 1.1.2'
gem 'capistrano-rails', '~> 1.1.1'
gem 'json', github: 'flori/json', branch: 'v1.8'

# Add this if you're using rbenv
gem 'capistrano-rbenv', github: "capistrano/rbenv"

gem "browser"

# Use jquery as the JavaScript library
gem 'jquery-rails'
# Turbolinks makes following links in your web application faster. Read more: https://github.com/rails/turbolinks
# gem 'turbolinks'
# Build JSON APIs with ease. Read more: https://github.com/rails/jbuilder
gem 'jbuilder', '~> 2.0'
# bundle exec rake doc:rails generates the API under doc/api.
gem 'sdoc', '~> 0.4.0', group: :doc

# Use ActiveModel has_secure_password
# gem 'bcrypt', '~> 3.1.7'

# Use Unicorn as the app server
# gem 'unicorn'

# Use Capistrano for deployment
# gem 'capistrano-rails', group: :development

group :development, :test do
  # Call 'byebug' anywhere in the code to stop execution and get a debugger console
  gem 'byebug'
end

group :development do
  # Access an IRB console on exception pages or by using <%= console %> in views
  gem 'web-console', '~> 2.0'

  # Spring speeds up development by keeping your application running in the background. Read more: https://github.com/rails/spring
  gem 'spring'
end
```

### Gemfile.lock

```
GIT
  remote: git://github.com/capistrano/rbenv.git
  revision: e056efc0c361cc15b76ff961d6c5f65ed5e2c57e
  specs:
    capistrano-rbenv (2.0.4)
      capistrano (~> 3.1)
      sshkit (~> 1.3)

GEM
  remote: https://rubygems.org/
  specs:'
    actionmailer (4.2.6)
      actionpack (= 4.2.6)
      actionview (= 4.2.6)
      activejob (= 4.2.6)
      mail (~> 2.5, >= 2.5.4)
      rails-dom-testing (~> 1.0, >= 1.0.5)
    actionpack (4.2.6)
      actionview (= 4.2.6)
      activesupport (= 4.2.6)
      rack (~> 1.6)
      rack-test (~> 0.6.2)
      rails-dom-testing (~> 1.0, >= 1.0.5)
      rails-html-sanitizer (~> 1.0, >= 1.0.2)
    actionview (4.2.6)
      activesupport (= 4.2.6)
      builder (~> 3.1)
      erubis (~> 2.7.0)
      rails-dom-testing (~> 1.0, >= 1.0.5)
      rails-html-sanitizer (~> 1.0, >= 1.0.2)
    activejob (4.2.6)
      activesupport (= 4.2.6)
      globalid (>= 0.3.0)
    activemodel (4.2.6)
      activesupport (= 4.2.6)
      builder (~> 3.1)
    activerecord (4.2.6)
      activemodel (= 4.2.6)
      activesupport (= 4.2.6)
      arel (~> 6.0)
    activesupport (4.2.6)
      i18n (~> 0.7)
      json (~> 1.7, >= 1.7.7)
      minitest (~> 5.1)
      thread_safe (~> 0.3, >= 0.3.4)
      tzinfo (~> 1.1)
    arel (6.0.3)
    binding_of_caller (0.7.2)
      debug_inspector (>= 0.0.1)
    browser (2.1.0)
    builder (3.2.2)
    byebug (9.0.5)
    capistrano (3.1.0)
      i18n
      rake (>= 10.0.0)
      sshkit (~> 1.3)
    capistrano-bundler (1.1.4)
      capistrano (~> 3.1)
      sshkit (~> 1.2)
    capistrano-rails (1.1.7)
      capistrano (~> 3.1)
      capistrano-bundler (~> 1.1)
    coffee-rails (4.1.1)
      coffee-script (>= 2.2.0)
      railties (>= 4.0.0, < 5.1.x)
    coffee-script (2.4.1)
      coffee-script-source
      execjs
    coffee-script-source (1.10.0)
    concurrent-ruby (1.0.2)
    debug_inspector (0.0.2)
    erubis (2.7.0)
    execjs (2.7.0)
    globalid (0.3.6)
      activesupport (>= 4.1.0)
    i18n (0.7.0)
    jbuilder (2.5.0)
      activesupport (>= 3.0.0, < 5.1)
      multi_json (~> 1.2)
    jquery-rails (4.1.1)
      rails-dom-testing (>= 1, < 3)
      railties (>= 4.2.0)
      thor (>= 0.14, < 2.0)
    loofah (2.0.3)
      nokogiri (>= 1.5.9)
    mail (2.6.4)
      mime-types (>= 1.16, < 4)
    mime-types (3.1)
      mime-types-data (~> 3.2015)
    mime-types-data (3.2016.0521)
    mini_portile2 (2.1.0)
    minitest (5.9.0)
    multi_json (1.12.1)
    net-scp (1.2.1)
      net-ssh (>= 2.6.5)
    net-ssh (3.1.1)
    nokogiri (1.6.8)
      mini_portile2 (~> 2.1.0)
      pkg-config (~> 1.1.7)
    pkg-config (1.1.7)
    rack (1.6.4)
    rack-test (0.6.3)
      rack (>= 1.0)
    rails (4.2.6)
      actionmailer (= 4.2.6)
      actionpack (= 4.2.6)
      actionview (= 4.2.6)
      activejob (= 4.2.6)
      activemodel (= 4.2.6)
      activerecord (= 4.2.6)
      activesupport (= 4.2.6)
      bundler (>= 1.3.0, < 2.0)
      railties (= 4.2.6)
      sprockets-rails
    rails-deprecated_sanitizer (1.0.3)
      activesupport (>= 4.2.0.alpha)
    rails-dom-testing (1.0.7)
      activesupport (>= 4.2.0.beta, < 5.0)
      nokogiri (~> 1.6.0)
      rails-deprecated_sanitizer (>= 1.0.1)
    rails-html-sanitizer (1.0.3)
      loofah (~> 2.0)
    railties (4.2.6)
      actionpack (= 4.2.6)
      activesupport (= 4.2.6)
      rake (>= 0.8.7)
      thor (>= 0.18.1, < 2.0)
    rake (11.2.2)
    rdoc (4.2.2)
      json (~> 1.4)
    sass (3.4.22)
    sass-rails (5.0.4)
      railties (>= 4.0.0, < 5.0)
      sass (~> 3.1)
      sprockets (>= 2.8, < 4.0)
      sprockets-rails (>= 2.0, < 4.0)
      tilt (>= 1.1, < 3)
    sdoc (0.4.1)
      json (~> 1.7, >= 1.7.7)
      rdoc (~> 4.0)
    spring (1.7.1)
    sprockets (3.6.0)
      concurrent-ruby (~> 1.0)
      rack (> 1, < 3)
    sprockets-rails (3.0.4)
      actionpack (>= 4.0)
      activesupport (>= 4.0)
      sprockets (>= 3.0.0)
    sqlite3 (1.3.11)
    sshkit (1.11.1)
      net-scp (>= 1.1.2)
      net-ssh (>= 2.8.0)
    thor (0.19.1)
    thread_safe (0.3.5)
    tilt (2.0.5)
    tzinfo (1.2.2)
      thread_safe (~> 0.1)
    uglifier (3.0.0)
      execjs (>= 0.3.0, < 3)
    web-console (2.3.0)
      activemodel (>= 4.0)
      binding_of_caller (>= 0.7.2)
      railties (>= 4.0)
      sprockets-rails (>= 2.0, < 4.0)

PLATFORMS
  ruby

DEPENDENCIES
  browser
  byebug
  capistrano (~> 3.1.0)
  capistrano-bundler (~> 1.1.2)
  capistrano-rails (~> 1.1.1)
  capistrano-rbenv!
  coffee-rails (~> 4.1.0)
  jbuilder (~> 2.0)
  jquery-rails
  rails (= 4.2.6)
  sass-rails (~> 5.0)
  sdoc (~> 0.4.0)
  spring
  sqlite3
  uglifier (>= 1.3.0)
  web-console (~> 2.0)

BUNDLED WITH
   1.12.5
```

--- TEMPLATE END ----------------------------------------------------------------

Unfortunately, an unexpected error occurred, and Bundler cannot continue.

First, try this link to see if there are any existing issue reports for this error:
https://github.com/bundler/bundler/search?q=Invalid+source++nil&type=Issues

If there aren't any reports for this error yet, please create copy and paste the report template above into a new issue. Don't forget to anonymize any private data! The new issue form is located at:
https://github.com/bundler/bundler/issues/new
git源代码`git://github.com/flori/json.git`使用“git”协议,该协议在不加密的情况下传输数据。使用“bundle config git.allow_unsecure true”禁用此警告,或切换到“https”协议以确保数据安全。
git源代码`git://github.com/capistrano/rbenv.git`使用“git”协议,该协议在不加密的情况下传输数据。使用“bundle config git.allow_unsecure true”禁用此警告,或切换到“https”协议以确保数据安全。
吸引git://github.com/flori/json.git
git源代码`git://github.com/flori/json.git`使用“git”协议,该协议在不加密的情况下传输数据。使用“bundle config git.allow_unsecure true”禁用此警告,或切换到“https”协议以确保数据安全。
git源代码`git://github.com/capistrano/rbenv.git`使用“git”协议,该协议在不加密的情况下传输数据。使用“bundle config git.allow_unsecure true”禁用此警告,或切换到“https”协议以确保数据安全。
---错误报告模板-------------------------------------------------------
#错误报告
##问题
请填写这些问题的答案,它将帮助我们找出答案
为什么事情会出错。
-**你做了什么**
我运行了命令`/home/howard/.rbenv/versions/2.4.1/bin/bundle install`
-**您预期会发生什么**
我希望Bundler。。。
-**发生了什么事**
相反,发生的是。。。
-**您是否尝试过在我们的问题跟踪器、堆栈溢出或谷歌上发布的关于类似问题的任何解决方案**
我试过。。。
-**您是否阅读了我们的问题文档,https://github.com/bundler/bundler/blob/master/doc/contributing/ISSUES.md?**
...
##回溯
```
ArgumentError:无效源:nil
/home/howard/.rbenv/versions/2.4.1/lib/ruby/gems/2.4.0/gems/bundler-1.15.3/lib/bundler/source\u list.rb:107:in'source\u list\u for'
/home/howard/.rbenv/versions/2.4.1/lib/ruby/gems/2.4.0/gems/bundler-1.15.3/lib/bundler/source_list.rb:56:in'get'
/home/howard/.rbenv/versions/2.4.1/lib/ruby/gems/2.4.0/gems/bundler-1.15.3/lib/bundler/definition.rb:746:在“聚合中的块锁定”规范中
/home/howard/.rbenv/versions/2.4.1/lib/ruby/2.4.0/forwardable.rb:229:in'each'
/home/howard/.rbenv/versions/2.4.1/lib/ruby/2.4.0/forwardable.rb:229:in'each'
/home/howard/.rbenv/versions/2.4.1/lib/ruby/gems/2.4.0/gems/bundler-1.15.3/lib/bundler/definition.rb:743:in'converge\u locked\u specs'
/home/howard/.rbenv/versions/2.4.1/lib/ruby/gems/2.4.0/gems/bundler-1.15.3/lib/bundler/definition.rb:228:in'resolve'
/home/howard/.rbenv/versions/2.4.1/lib/ruby/gems/2.4.0/gems/bundler-1.15.3/lib/bundler/definition.rb:159:在“规范”中
/home/howard/.rbenv/versions/2.4.1/lib/ruby/gems/2.4.0/gems/bundler-1.15.3/lib/bundler/definition.rb:147:in“远程解析”
/home/howard/.rbenv/versions/2.4.1/lib/ruby/gems/2.4.0/gems/bundler-1.15.3/lib/bundler/installer.rb:226:在“如果需要解决”中
/home/howard/.rbenv/versions/2.4.1/lib/ruby/gems/2.4.0/gems/bundler-1.15.3/lib/bundler/installer.rb:78:运行中
/home/howard/.rbenv/versions/2.4.1/lib/ruby/gems/2.4.0/gems/bundler-1.15.3/lib/bundler/installer.rb:24:in'install'
/home/howard/.rbenv/versions/2.4.1/lib/ruby/gems/2.4.0/gems/bundler-1.15.3/lib/bundler/cli/install.rb:68:在“运行”中
/home/howard/.rbenv/versions/2.4.1/lib/ruby/gems/2.4.0/gems/bundler-1.15.3/lib/bundler/cli.rb:191:在“安装中的块”中
/home/howard/.rbenv/versions/2.4.1/lib/ruby/gems/2.4.0/gems/bundler-1.15.3/lib/bundler/settings.rb:92:在“临时”中
/home/howard/.rbenv/versions/2.4.1/lib/ruby/gems/2.4.0/gems/bundler-1.15.3/lib/bundler/cli.rb:190:在“安装”中
/home/howard/.rbenv/versions/2.4.1/lib/ruby/gems/2.4.0/gems/bundler-1.15.3/lib/bundler/vendor/thor/lib/thor/command.rb:27:“运行”
/home/howard/.rbenv/versions/2.4.1/lib/ruby/gems/2.4.0/gems/bundler-1.15.3/lib/bundler/vendor/thor/lib/thor/invocation.rb:126:在“invoke_命令”中
/home/howard/.rbenv/versions/2.4.1/lib/ruby/gems/2.4.0/gems/bundler-1.15.3/lib/bundler/vendor/thor/lib/thor.rb:369:在'dispatch'中
/home/howard/.rbenv/versions/2.4.1/lib/ruby/gems/2.4.0/gems/bundler-1.15.3/lib/bundler/cli.rb:22:在'dispatch'中
/home/howard/.rbenv/versions/2.4.1/lib/ruby/gems/2.4.0/gems/bundler-1.15.3/lib/bundler/vendor/thor/lib/thor/base.rb:444:在“开始”中
/home/howard/.rbenv/versions/2.4.1/lib/ruby/gems/2.4.0/gems/bundler-1.15.3/lib/bundler/cli.rb:13:在“开始”中
/home/howard/.rbenv/versions/2.4.1/lib/ruby/gems/2.4.0/gems/bundler-1.15.3/exe/bundle:30:in'block-in'
/home/howard/.rbenv/versions/2.4.1/lib/ruby/gems/2.4.0/gems/bundler-1.15.3/lib/bundler/friendly\u errors.rb:121:in“with\u friendly\u errors”
/home/howard/.rbenv/versions/2.4.1/lib/ruby/gems/2.4.0/gems/bundler-1.15.3/exe/bundle:22:in`'
/home/howard/.rbenv/versions/2.4.1/bin/bundle:22:在“加载”中
/home/howard/.rbenv/versions/2.4.1/bin/bundle:22:in`'
```
##环境
```
捆扎机1.15.3
Rubygems 2.6.11
Ruby 2.4.1p111(2017-03-22修订版58053)[x86_64-linux]
GEM_HOME/HOME/howard/.rbenv/versions/2.4.1/lib/ruby/gems/2.4.0
GEM_PATH/home/howard/.rbenv/versions/2.4.1/lib/ruby/gems/2.4.0:/home/howard/.GEM/ruby/2.4.0
Git 2.7.4
平台x86_64-linux
OpenSSL OpenSSL 1.0.2g 2016年3月1日
```
##捆绑机设置
```
没有
为本地应用程序设置(/home/howard/Downloads/telefon/code/.bundle/config):“开发:测试”
```
##G