我是 ruby 的新手,并且在首次部署网站时遵循一些指南。我发现很难准确地理解作者所说的话,因为它已经写了很长时间了。
这是我输入git push heroku master
后发生的事情
Counting objects: 68, done.
Delta compression using up to 8 threads.
Compressing objects: 100% (57/57), done.
Writing objects: 100% (68/68), 17.29 KiB | 0 bytes/s, done.
Total 68 (delta 5), 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.2.6
remote: -----> Installing dependencies using bundler 1.13.7
remote: Running: bundle install --without development:test --path vendor/bundle --binstubs vendor/bundle/bin -j4 --deployment
remote: Warning: the running version of Bundler (1.13.7) is older than the version that created the lockfile (1.14.4). We suggest you upgrade to the latest version of Bundler by running `gem install bundler`.
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: Installing i18n 0.8.1
remote: Installing rake 12.0.0
remote: Installing json 1.8.6 with native extensions
remote: Installing minitest 5.10.1
remote: Installing thread_safe 0.3.6
remote: Installing builder 3.2.3
remote: Installing erubis 2.7.0
remote: Installing mini_portile2 2.1.0
remote: Installing rack 1.6.5
remote: Installing arel 6.0.4
remote: Installing mime-types-data 3.2016.0521
remote: Installing execjs 2.7.0
remote: Installing coffee-script-source 1.12.2
remote: Installing thor 0.19.4
remote: Installing concurrent-ruby 1.0.5
remote: Installing multi_json 1.12.1
remote: Installing pg 0.20.0 with native extensions
remote: Using bundler 1.13.7
remote: Installing rails_serve_static_assets 0.0.5
remote: Installing rails_stdout_logging 0.0.5
remote: Installing rdoc 4.3.0
remote: Installing sass 3.4.23
remote: Installing tilt 1.4.1
remote: Installing turbolinks-source 5.0.0
remote: Installing tzinfo 1.2.3
remote: Installing nokogiri 1.7.1 with native extensions
remote: Installing rack-test 0.6.3
remote: Installing mime-types 3.1
remote: Installing coffee-script 2.4.1
remote: Installing uglifier 1.3.0
remote: Installing sprockets 3.7.1
remote: Installing rails_12factor 0.0.3
remote: Installing turbolinks 5.0.1
remote: Installing mail 2.6.4
remote: Installing loofah 2.0.3
remote: Installing rails-html-sanitizer 1.0.3
remote: Installing sdoc 0.4.0
remote: Installing activesupport 4.2.5
remote: Installing globalid 0.3.7
remote: Installing rails-deprecated_sanitizer 1.0.3
remote: Installing activemodel 4.2.5
remote: Installing jbuilder 2.0.0
remote: Installing activejob 4.2.5
remote: Installing rails-dom-testing 1.0.8
remote: Installing activerecord 4.2.5
remote: Installing actionview 4.2.5
remote: Installing actionpack 4.2.5
remote: Installing sprockets-rails 3.2.0
remote: Installing actionmailer 4.2.5
remote: Installing railties 4.2.5
remote: Installing coffee-rails 4.1.0
remote: Installing sass-rails 5.0.0
remote: Installing jquery-rails 4.3.1
remote: Installing rails 4.2.5
remote: Bundle complete! 14 Gemfile dependencies, 54 gems now installed.
remote: Gems in the groups development and test were not installed.
remote: Bundled gems are installed into ./vendor/bundle.
remote: Bundle completed (23.25s)
remote: Cleaning up the bundler cache.
remote: -----> Installing node-v6.10.0-linux-x64
remote: -----> Detecting rake tasks
remote: sh: 1: Syntax error: word unexpected (expecting ")")
remote: sh: 1: Syntax error: word unexpected (expecting ")")
remote: !
remote: ! Could not detect rake tasks
remote: ! ensure you can run `$ bundle exec rake -P` against your app
remote: ! and using the production group of your Gemfile.
remote: ! rake aborted!
remote: ! Bundler::GemRequireError: There was an error while trying to load the gem 'sass-rails'.
remote: ! Gem Load Error is: uninitialized constant Sass::Script
remote: ! Backtrace for gem load error is:
remote: ! /tmp/build_58ad731988b51b7dabe8f6a61971228c/vendor/bundle/ruby/2.2.0/gems/sass-rails-5.0.0/lib/sass/rails/helpers.rb:11:in `<top (required)>'
remote: ! /tmp/build_58ad731988b51b7dabe8f6a61971228c/vendor/bundle/ruby/2.2.0/gems/sass-rails-5.0.0/lib/sass/rails.rb:8:in `require'
remote: ! /tmp/build_58ad731988b51b7dabe8f6a61971228c/vendor/bundle/ruby/2.2.0/gems/sass-rails-5.0.0/lib/sass/rails.rb:8:in `<top (required)>'
remote: ! /tmp/build_58ad731988b51b7dabe8f6a61971228c/vendor/bundle/ruby/2.2.0/gems/sass-rails-5.0.0/lib/sass-rails.rb:1:in `require'
remote: ! /tmp/build_58ad731988b51b7dabe8f6a61971228c/vendor/bundle/ruby/2.2.0/gems/sass-rails-5.0.0/lib/sass-rails.rb:1:in `<top (required)>'
remote: ! /tmp/build_58ad731988b51b7dabe8f6a61971228c/vendor/bundle/ruby/2.2.0/gems/bundler-1.13.7/lib/bundler/runtime.rb:91:in `require'
remote: ! /tmp/build_58ad731988b51b7dabe8f6a61971228c/vendor/bundle/ruby/2.2.0/gems/bundler-1.13.7/lib/bundler/runtime.rb:91:in `block (2 levels) in require'
remote: ! /tmp/build_58ad731988b51b7dabe8f6a61971228c/vendor/bundle/ruby/2.2.0/gems/bundler-1.13.7/lib/bundler/runtime.rb:86:in `each'
remote: ! /tmp/build_58ad731988b51b7dabe8f6a61971228c/vendor/bundle/ruby/2.2.0/gems/bundler-1.13.7/lib/bundler/runtime.rb:86:in `block in require'
remote: ! /tmp/build_58ad731988b51b7dabe8f6a61971228c/vendor/bundle/ruby/2.2.0/gems/bundler-1.13.7/lib/bundler/runtime.rb:75:in `each'
remote: ! /tmp/build_58ad731988b51b7dabe8f6a61971228c/vendor/bundle/ruby/2.2.0/gems/bundler-1.13.7/lib/bundler/runtime.rb:75:in `require'
remote: ! /tmp/build_58ad731988b51b7dabe8f6a61971228c/vendor/bundle/ruby/2.2.0/gems/bundler-1.13.7/lib/bundler.rb:106:in `require'
remote: ! /tmp/build_58ad731988b51b7dabe8f6a61971228c/config/application.rb:7:in `<top (required)>'
remote: ! /tmp/build_58ad731988b51b7dabe8f6a61971228c/Rakefile:4:in `require'
remote: ! /tmp/build_58ad731988b51b7dabe8f6a61971228c/Rakefile:4:in `<top (required)>'
remote: ! /tmp/build_58ad731988b51b7dabe8f6a61971228c/vendor/bundle/ruby/2.2.0/gems/rake-12.0.0/lib/rake/rake_module.rb:28:in `load'
remote: ! /tmp/build_58ad731988b51b7dabe8f6a61971228c/vendor/bundle/ruby/2.2.0/gems/rake-12.0.0/lib/rake/rake_module.rb:28:in `load_rakefile'
remote: ! /tmp/build_58ad731988b51b7dabe8f6a61971228c/vendor/bundle/ruby/2.2.0/gems/rake-12.0.0/lib/rake/application.rb:687:in `raw_load_rakefile'
remote: ! /tmp/build_58ad731988b51b7dabe8f6a61971228c/vendor/bundle/ruby/2.2.0/gems/rake-12.0.0/lib/rake/application.rb:96:in `block in load_rakefile'
remote: ! /tmp/build_58ad731988b51b7dabe8f6a61971228c/vendor/bundle/ruby/2.2.0/gems/rake-12.0.0/lib/rake/application.rb:178:in `standard_exception_handling'
remote: ! /tmp/build_58ad731988b51b7dabe8f6a61971228c/vendor/bundle/ruby/2.2.0/gems/rake-12.0.0/lib/rake/application.rb:95:in `load_rakefile'
remote: ! /tmp/build_58ad731988b51b7dabe8f6a61971228c/vendor/bundle/ruby/2.2.0/gems/rake-12.0.0/lib/rake/application.rb:79:in `block in run'
remote: ! /tmp/build_58ad731988b51b7dabe8f6a61971228c/vendor/bundle/ruby/2.2.0/gems/rake-12.0.0/lib/rake/application.rb:178:in `standard_exception_handling'
remote: ! /tmp/build_58ad731988b51b7dabe8f6a61971228c/vendor/bundle/ruby/2.2.0/gems/rake-12.0.0/lib/rake/application.rb:77:in `run'
remote: ! /tmp/build_58ad731988b51b7dabe8f6a61971228c/vendor/bundle/ruby/2.2.0/gems/rake-12.0.0/exe/rake:27:in `<top (required)>'
remote: ! vendor/bundle/bin/rake:17:in `load'
remote: ! vendor/bundle/bin/rake:17:in `<main>'
remote: ! Bundler Error Backtrace:
remote: ! /tmp/build_58ad731988b51b7dabe8f6a61971228c/vendor/bundle/ruby/2.2.0/gems/bundler-1.13.7/lib/bundler/runtime.rb:94:in `rescue in block (2 levels) in require'
remote: ! /tmp/build_58ad731988b51b7dabe8f6a61971228c/vendor/bundle/ruby/2.2.0/gems/bundler-1.13.7/lib/bundler/runtime.rb:90:in `block (2 levels) in require'
remote: ! /tmp/build_58ad731988b51b7dabe8f6a61971228c/vendor/bundle/ruby/2.2.0/gems/bundler-1.13.7/lib/bundler/runtime.rb:86:in `each'
remote: ! /tmp/build_58ad731988b51b7dabe8f6a61971228c/vendor/bundle/ruby/2.2.0/gems/bundler-1.13.7/lib/bundler/runtime.rb:86:in `block in require'
remote: ! /tmp/build_58ad731988b51b7dabe8f6a61971228c/vendor/bundle/ruby/2.2.0/gems/bundler-1.13.7/lib/bundler/runtime.rb:75:in `each'
remote: ! /tmp/build_58ad731988b51b7dabe8f6a61971228c/vendor/bundle/ruby/2.2.0/gems/bundler-1.13.7/lib/bundler/runtime.rb:75:in `require'
remote: ! /tmp/build_58ad731988b51b7dabe8f6a61971228c/vendor/bundle/ruby/2.2.0/gems/bundler-1.13.7/lib/bundler.rb:106:in `require'
remote: ! /tmp/build_58ad731988b51b7dabe8f6a61971228c/config/application.rb:7:in `<top (required)>'
remote: ! /tmp/build_58ad731988b51b7dabe8f6a61971228c/Rakefile:4:in `require'
remote: ! /tmp/build_58ad731988b51b7dabe8f6a61971228c/Rakefile:4:in `<top (required)>'
remote: ! /tmp/build_58ad731988b51b7dabe8f6a61971228c/vendor/bundle/ruby/2.2.0/gems/rake-12.0.0/lib/rake/rake_module.rb:28:in `load'
remote: ! /tmp/build_58ad731988b51b7dabe8f6a61971228c/vendor/bundle/ruby/2.2.0/gems/rake-12.0.0/lib/rake/rake_module.rb:28:in `load_rakefile'
remote: ! /tmp/build_58ad731988b51b7dabe8f6a61971228c/vendor/bundle/ruby/2.2.0/gems/rake-12.0.0/lib/rake/application.rb:687:in `raw_load_rakefile'
......
remote: from /app/tmp/buildpacks/f6d48d8a14fccbb19c0c0402fca224929d18e9ee042b3e204bc5992612e990d3b3a0fb1f9627b1a3bae11e9fa20dffc96e136bd734a2f3cf92a0d05bedd42cfe/lib/language_pack/instrument.rb:16:in `instrument'
remote: from /app/tmp/buildpacks/f6d48d8a14fccbb19c0c0402fca224929d18e9ee042b3e204bc5992612e990d3b3a0fb1f9627b1a3bae11e9fa20dffc96e136bd734a2f3cf92a0d05bedd42cfe/lib/language_pack/instrument.rb:35:in `trace'
remote: from /app/tmp/buildpacks/f6d48d8a14fccbb19c0c0402fca224929d18e9ee042b3e204bc5992612e990d3b3a0fb1f9627b1a3bae11e9fa20dffc96e136bd734a2f3cf92a0d05bedd42cfe/bin/ruby_compile:11:in `<main>'
remote: ! Push rejected, failed to compile Ruby app.
remote:
remote: ! Push failed
remote: Verifying deploy....
remote:
remote: ! Push rejected to hidden-eyrie-90646.
remote:
To https://git.heroku.com/hidden-eyrie-90646.git
! [remote rejected] master -> master (pre-receive hook declined)
error: failed to push some refs to 'https://git.heroku.com/hidden-eyrie-90646.git'
But when I typed in the command `$ bundle install --without production`
It seems alright:
`Fetching gem metadata from https://rubygems.org/..........
Fetching version metadata from https://rubygems.org/..
Fetching dependency metadata from https://rubygems.org/.
Using rake 12.0.0
Using i18n 0.8.1
Using json 1.8.6
Using minitest 5.10.1
Using thread_safe 0.3.6
Using builder 3.2.3
Using erubis 2.7.0
Using mini_portile2 2.1.0
Using rack 1.6.5
Using mime-types-data 3.2016.0521
Using arel 6.0.4
Using coffee-script-source 1.12.2
Using execjs 2.7.0
Using thor 0.19.4
Using concurrent-ruby 1.0.5
Using multi_json 1.12.1
Using rack-timeout 0.3.2
Using bundler 1.14.4
Using rdoc 4.3.0
Using sass 3.4.23
Using tilt 1.4.1
Using sqlite3 1.3.13
Using turbolinks-source 5.0.0
Using tzinfo 1.2.3
Using nokogiri 1.7.1
Using rack-test 0.6.3
Using mime-types 3.1
Using coffee-script 2.4.1
Using sprockets 3.7.1
Using uglifier 1.3.0
Using sdoc 0.4.0
Using turbolinks 5.0.1
Using activesupport 4.2.5
Using loofah 2.0.3
Using mail 2.6.4
Using rails-deprecated_sanitizer 1.0.3
Using globalid 0.3.7
Using activemodel 4.2.5
Using jbuilder 2.0.0
Using spring 2.0.1
Using rails-html-sanitizer 1.0.3
Using rails-dom-testing 1.0.8
Using activejob 4.2.5
Using activerecord 4.2.5
Using actionview 4.2.5
Using actionpack 4.2.5
Using actionmailer 4.2.5
Using railties 4.2.5
Using sprockets-rails 3.2.0
Using coffee-rails 4.1.0
Using jquery-rails 4.3.1
Using rails 4.2.5
Using sass-rails 5.0.0
Bundle complete! 13 Gemfile dependencies, 53 gems now installed.
Gems in the group production were not installed.
Use `bundle show [gemname]` to see where a bundled gem is installed.`
(我删除了一些消息,因为它超过了堆栈溢出的长度限制。
我的宝石文件是:
source 'https://rubygems.org'
# Bundle edge Rails instead: gem 'rails', github: 'rails/rails'
gem 'rails', '4.2.5'
# Use sqlite3 as the database for Active Record
gem 'sqlite3', group: [:development, :test]
# Use postgresql as database for production
group :production do
gem 'pg'
gem 'rails_12factor'
end
# 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
# 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
gem 'spring', group: :development
gem 'rack-timeout', '0.3.2'
# 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 与讲师介绍的不一样,因为不知何故我无法在 Cloud9 IDE 上安装 4.1.0 版本的 Ruby(我的是 4.2.5)。 这是讲师的宝石文件:
source 'https://rubygems.org'
# Bundle edge Rails instead: gem 'rails', github: 'rails/rails'
gem 'rails', '4.1.0'
# Use sqlite3 as the database for Active Record
gem 'sqlite3', group: [:development, :test]
# Use postgresql as database for production
group :production do
gem 'pg'
gem 'rails_12factor'
end
# Use SCSS for stylesheets
gem 'sass-rails', ' 4.0.3'
# Use Uglifier as compressor for JavaScript assets
gem 'uglifier', ' 1.3.0'
# Use CoffeeScript for .coffee assets and views
gem 'coffee-rails', ' 4.0.0'
# See https://github.com/rails/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', ' 2.0'
# bundle exec rake doc:rails generates the API under doc/api.
gem 'sdoc', ' 0.4.0', group: :doc
gem 'spring', group: :development
我该怎么办?提前谢谢你。
您的 gem 版本是
gem 'sass-rails', ' 5.0'
将其更改为
gem 'sass-rails', '5.0.3' or gem 'sass-rails', '5.0.2'
或做
bundle update sass-rails
这最终会将您的SaaS-Rails Gem更新到最新版本。或者,您可以在 gemfile 中输入上面指定的版本。