新手问题 本人按照 Ruby on rails 教程做了一个 Demo,但是部署到 Heroku 时出现错误

hanrong · 2015年08月10日 · 最后由 hanrong 回复于 2015年08月11日 · 2659 次阅读

操作系统:deepin linux(2014.3 桌面版),rails 版本 4.2.1,ruby 版本 2.2.1

gem 清单

gem 'rails', '4.2.1'
# Use sqlite3 as the database for Active Record
gem 'bcrypt', '3.1.7'
# Use SCSS for stylesheets
gem 'sass-rails', '~> 5.0'
# Use Uglifier as compressor for JavaScript assets
gem 'uglifier', '2.5.3'
# 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 'bootstrap-sass',  '3.2.0.0'
# Use jquery as the JavaScript library
gem 'jquery-rails', '4.0.0.beta2'
# Turbolinks makes following links in your web application faster. Read more: https://github.com/rails/turbolinks
gem 'turbolinks', '2.3.0'
# Build JSON APIs with ease. Read more: https://github.com/rails/jbuilder
gem 'jbuilder', '2.2.3'
# bundle exec rake doc:rails generates the API under doc/api.
gem 'sdoc', '~> 0.4.0', group: :doc
gem 'faker',  '1.4.2'
gem 'bootstrap-will_paginate',  '0.0.10'
gem 'carrierwave',  '0.10.0'
gem 'mini_magick',  '3.8.0'
gem 'fog',  '1.23.0'
gem 'net-ssh', '2.10.0' 
## 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
  gem  'sqlite3', '1.3.9'
  # Call 'byebug' anywhere in the code to stop execution and get a debugger console
  gem 'byebug', '3.4.0'

  # 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', '1.1.3'
end
group :test do
    gem 'minitest-reporters',   '1.0.5'
    gem 'mini_backtrace',   '0.1.3'
    gem 'guard-minitest',   '2.3.1'
end
group :production do
    gem 'pg',   '0.17.1'
    gem 'rails_12factor',   '0.0.2'
  gem 'unicorn',  '4.8.3'
end

rails 控制台

Total 0 (delta 0), reused 0 (delta 0)
remote: Compressing source files... done.
remote: Building source:
remote: 
remote: -----> Ruby app detected
remote: -----> Compiling Ruby/Rails
remote: -----> Using Ruby version: ruby-2.0.0
remote: -----> Installing dependencies using 1.9.7
remote:        Running: bundle install --without development:test --path vendor/bundle --binstubs vendor/bundle/bin -j4 --deployment
remote:        Fetching gem metadata from https://rubygems.org/...........
remote:        Fetching version metadata from https://rubygems.org/...
remote:        Fetching dependency metadata from https://rubygems.org/..
remote:        Could not find net-ssh-2.10.0 in any of the sources
remote:        Bundler Output: Fetching gem metadata from https://rubygems.org/...........
remote:        Fetching version metadata from https://rubygems.org/...
remote:        Fetching dependency metadata from https://rubygems.org/..
remote:        Could not find net-ssh-2.10.0 in any of the sources
remote:  !
remote:  !     Failed to install gems via Bundler.
remote:  !
remote: 
remote:  !     Push rejected, failed to compile Ruby app
remote: 
remote: Verifying deploy....
remote: 
remote: !   Push rejected to salty-citadel-1665.
remote: 
To https://git.heroku.com/salty-citadel-1665.git
 ! [remote rejected] master -> master (pre-receive hook declined)
error: 无法推送一些引用到 'https://git.heroku.com/salty-citadel-1665.git'

第一,请贴代码,不要用截图,以便别人可以 copy 你的出错信息 第二,请用错误信息 google 一下,比论坛等别人回答要快得多,请相信一点,你几乎不太可能是第一个遇到这个问题的人。

希望搜索结果页面第一条 stackoverflow 的信息能帮到你: https://www.google.de/search?q=could+not+find+net+ssh+2.10.0+in+any+of+the+sources&oq=could+not+find+net+ssh+2.10.0+in+any+of+the+sources&aqs=chrome..69i57.279j0j7&sourceid=chrome&es_sm=93&ie=UTF-8

@peter 额,不好意思。第一次发帖,往见谅。下次我会注意了。谷歌的解决方法我基本上都试过了,但就是解决不了。

@hanrong 从这个页面https://rubygems.org/gems/net-ssh/versionsnet-ssh,可以看到 2.10.0 已经 yanked,你可以试试在 Gemfile 里面把gem 'net-ssh', '2.10.0'替换成gem 'net-ssh', '2.10.1.rc1', 或者直接去掉版本,然后运行bundle update net-ssh, 应该会更新 Gemfile.lock, 然后重新部署

3 楼正解。2.10.0 被回收了。

@leomayleomay 嗯嗯,晚上回去我试一下。谢谢啊

需要 登录 后方可回复, 如果你还没有账号请 注册新账号