【问题标题】:Bundler 1.5.0 throws normalize_uri ArgumentErrorBundler 1.5.0 抛出 normalize_uri ArgumentError
【发布时间】:2013-12-27 12:55:09
【问题描述】:

有谁知道为什么 bundler 会抛出这个错误。

/home/arrc/.rvm/gems/ruby-2.1.0@global/gems/bundler-1.5.0/lib/bundler/source/rubygems.rb:158:in `normalize_uri': The source must be an absolute URI (ArgumentError)
       /home/arrc/.rvm/gems/ruby-2.1.0@global/gems/bundler-1.5.0/lib/bundler/source/rubygems.rb:129:in `add_remote'
       /home/arrc/.rvm/gems/ruby-2.1.0@global/gems/bundler-1.5.0/lib/bundler/dsl.rb:121:in `source'
       /home/arrc/arrC/rails/Gemfile:1:in `eval_gemfile'
       /home/arrc/.rvm/gems/ruby-2.1.0@global/gems/bundler-1.5.0/lib/bundler/dsl.rb:30:in `instance_eval'
       /home/arrc/.rvm/gems/ruby-2.1.0@global/gems/bundler-1.5.0/lib/bundler/dsl.rb:30:in `eval_gemfile'
       /home/arrc/.rvm/gems/ruby-2.1.0@global/gems/bundler-1.5.0/lib/bundler/dsl.rb:9:in `evaluate'
       /home/arrc/.rvm/gems/ruby-2.1.0@global/gems/bundler-1.5.0/lib/bundler/definition.rb:26:in `build'
       /home/arrc/.rvm/gems/ruby-2.1.0@global/gems/bundler-1.5.0/lib/bundler.rb:152:in `definition'
       /home/arrc/.rvm/gems/ruby-2.1.0@global/gems/bundler-1.5.0/lib/bundler/cli.rb:255:in `install'
       /home/arrc/.rvm/gems/ruby-2.1.0@global/gems/bundler-1.5.0/lib/bundler/vendor/thor/command.rb:27:in `run'
       /home/arrc/.rvm/gems/ruby-2.1.0@global/gems/bundler-1.5.0/lib/bundler/vendor/thor/invocation.rb:120:in `invoke_command'
       /home/arrc/.rvm/gems/ruby-2.1.0@global/gems/bundler-1.5.0/lib/bundler/vendor/thor.rb:363:in `dispatch'
       /home/arrc/.rvm/gems/ruby-2.1.0@global/gems/bundler-1.5.0/lib/bundler/vendor/thor/base.rb:438:in `start'
       /home/arrc/.rvm/gems/ruby-2.1.0@global/gems/bundler-1.5.0/lib/bundler/cli.rb:10:in `start'
       /home/arrc/.rvm/gems/ruby-2.1.0@global/gems/bundler-1.5.0/bin/bundle:22:in `block in <main>'
       /home/arrc/.rvm/gems/ruby-2.1.0@global/gems/bundler-1.5.0/lib/bundler/friendly_errors.rb:5:in `with_friendly_errors'
       /home/arrc/.rvm/gems/ruby-2.1.0@global/gems/bundler-1.5.0/bin/bundle:22:in `<main>'
There was an error in your Gemfile, and Bundler cannot continue.

我认为这个错误是特定于版本的,所以我卸载了 bundler 1.5.0,但我在 1.3.5 版(bundler)中仍然遇到同样的错误。

标准 rails 4.0.2 生成的 Gemfile

source 'https://rubygems.org'

# Bundle edge Rails instead: gem 'rails', github: 'rails/rails'
gem 'rails', '4.0.2'

# Use sqlite3 as the database for Active Record
gem 'sqlite3'

# Use SCSS for stylesheets
gem 'sass-rails', '~> 4.0.0'

# Use Uglifier as compressor for JavaScript assets
gem 'uglifier', '>= 1.3.0'

# Use CoffeeScript for .js.coffee assets and views
gem 'coffee-rails', '~> 4.0.0'

# See https://github.com/sstephenson/execjs#readme for more supported runtimes
# gem 'therubyracer', platforms: :ruby

# 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', '~> 1.2'

group :doc do
  # bundle exec rake doc:rails generates the API under doc/api.
  gem 'sdoc', require: false
end

# Use ActiveModel has_secure_password
# gem 'bcrypt-ruby', '~> 3.1.2'

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

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

# Use debugger
# gem 'debugger', group: [:development, :test]

【问题讨论】:

  • 您是否尝试使用旧版 ruby​​ 重现此问题?
  • 在 ruby​​ 1.9.3 中是,同样的错误 here is the output
  • 你能出示你的 Gemfile 吗?

标签: ruby-on-rails ruby rvm bundler


【解决方案1】:

尝试删除 Gemfile 第一行中的缩进,否则会在 Bundler github 存储库中创建问题。

【讨论】:

    猜你喜欢
    • 2014-10-20
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2011-11-30
    • 1970-01-01
    • 2021-06-24
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多