2015-07-26 4 views
0

Привет, я начинаю использовать ROR. Я попробовал развертывание герою. Но это не работает. Я мой драгоценный камень файл я поставил следующие драгоценные камниОшибка развертывания приложения Heroku 4

source 'https://rubygems.org' 


# Bundle edge Rails instead: gem 'rails', github: 'rails/rails' 
gem 'rails', '4.1.8' 
# Use sqlite3 as the database for Active Record 

group :production, :staging do 
    gem "pg" 
end 

group :development, :test do 
    gem "sqlite3" 
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 .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', '~> 2.0' 
# bundle exec rake doc:rails generates the API under doc/api. 
gem 'sdoc', '~> 0.4.0',   group: :doc 
gem 'byebug' 
# 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 

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

# Windows does not include zoneinfo files, so bundle the tzinfo-data gem 
gem 'tzinfo-data', platforms: [:mingw, :mswin] 
gem 'coffee-script-source', '1.8.0' 
gem 'bcrypt' 

Мой database.yml выглядит

# SQLite version 3.x 
# gem install sqlite3 
# 
# Ensure the SQLite 3 gem is defined in your Gemfile 
# gem 'sqlite3' 
# 
default: &default 
    adapter: sqlite3 
    pool: 5 
    timeout: 5000 

development: 
    <<: *default 
    database: db/development.sqlite3 

# Warning: The database defined as "test" will be erased and 
# re-generated from your development database when you run "rake". 
# Do not set this db to the same as development or production. 
test: 
    <<: *default 
    database: db/test.sqlite3 

production: 
    adapter: postgresql 
    database: db/production.sqlite3 
    pool: 5 
    timeout: 5000 

Я получаю следующее сообщение об ошибке на Heroku консоли:

-----> Ruby app detected 
-----> Compiling Ruby/Rails 
-----> Using Ruby version: ruby-2.0.0 
###### WARNING: 
     Removing `Gemfile.lock` because it was generated on Windows. 
     Bundler will do a full resolve so native gems are handled properly. 
     This may result in unexpected gem versions being used in your app. 
     In rare occasions Bundler may not be able to resolve your dependencies at all. 
     https://devcenter.heroku.com/articles/bundler-windows-gemfile 
-----> Installing dependencies using 1.9.7 
     Running: bundle install --without development:test --path vendor/bundle --binstubs vendor/bundle/bin -j4 
     Fetching gem metadata from https://rubygems.org/............ 
     Fetching version metadata from https://rubygems.org/... 
     Fetching dependency metadata from https://rubygems.org/.. 
     Resolving dependencies... 
     Rubygems 2.0.14 is not threadsafe, so your gems must be installed one at a time. Upgrade to Rubygems 2.1.0 or higher to enable parallel gem installation. 
     Installing rake 10.4.2 
     Installing i18n 0.7.0 
     Installing json 1.8.3 
     Installing minitest 5.7.0 
     Installing thread_safe 0.3.5 
     Installing tzinfo 1.2.2 
     Installing activesupport 4.1.8 
     Installing builder 3.2.2 
     Installing erubis 2.7.0 
     Installing actionview 4.1.8 
     Installing rack 1.5.5 
     Installing rack-test 0.6.3 
     Installing actionpack 4.1.8 
     Installing mime-types 2.6.1 
     Installing mail 2.6.3 
     Installing actionmailer 4.1.8 
     Installing activemodel 4.1.8 
     Installing arel 5.0.1.20140414130214 
     Installing activerecord 4.1.8 
     Installing bcrypt 3.1.10 
     Using bundler 1.9.7 
     Installing columnize 0.9.0 
     Installing byebug 5.0.0 
     Installing coffee-script-source 1.8.0 
     Installing execjs 2.5.2 
     Installing coffee-script 2.4.1 
     Installing thor 0.19.1 
     Installing railties 4.1.8 
     Installing coffee-rails 4.0.1 
     Installing hike 1.2.3 
     Installing multi_json 1.11.2 
     Installing jbuilder 2.3.1 
     Installing jquery-rails 3.1.3 
     Installing pg 0.18.2 
     Installing tilt 1.4.1 
     Installing sprockets 2.12.4 
     Installing sprockets-rails 2.3.2 
     Installing rails 4.1.8 
     Installing rdoc 4.2.0 
     Installing sass 3.2.19 
     Installing sass-rails 4.0.5 
     Installing sdoc 0.4.1 
     Installing turbolinks 2.5.3 
     Installing uglifier 2.7.1 
     Bundle complete! 14 Gemfile dependencies, 44 gems now installed. 
     Gems in the groups development and test were not installed. 
     Bundled gems are installed into ./vendor/bundle. 
     Post-install message from rdoc: 
     Depending on your version of ruby, you may need to install ruby rdoc/ri data: 
     <= 1.8.6 : unsupported 
     = 1.8.7 : gem install rdoc-data; rdoc-data --install 
     = 1.9.1 : gem install rdoc-data; rdoc-data --install 
     >= 1.9.2 : nothing to do! Yay! 
     Bundle completed (52.02s) 
     Cleaning up the bundler cache. 
-----> Preparing app for Rails asset pipeline 
     Running: rake assets:precompile 
     DEPRECATION WARNING: Paths in SQLite3 database URLs of the form `sqlite3:///path` will be treated as absolute in Rails 4.2. Please switch to `sqlite3:dbname`. (called from <top (required)> at /tmp/build_7c327500f441bbe0f5ec1b5b2f7a306a/Rakefile:6) 
     rake aborted! 
     Gem::LoadError: Specified 'sqlite3' for database adapter, but the gem is not loaded. Add `gem 'sqlite3'` to your Gemfile (and ensure its version is at the minimum required by ActiveRecord). 
     /tmp/build_7c327500f441bbe0f5ec1b5b2f7a306a/vendor/bundle/ruby/2.0.0/gems/activerecord-4.1.8/lib/active_record/connection_adapters/connection_specification.rb:190:in `rescue in spec' 
     /tmp/build_7c327500f441bbe0f5ec1b5b2f7a306a/vendor/bundle/ruby/2.0.0/gems/activerecord-4.1.8/lib/active_record/connection_adapters/connection_specification.rb:187:in `spec' 
     /tmp/build_7c327500f441bbe0f5ec1b5b2f7a306a/vendor/bundle/ruby/2.0.0/gems/activerecord-4.1.8/lib/active_record/connection_handling.rb:50:in `establish_connection' 
     /tmp/build_7c327500f441bbe0f5ec1b5b2f7a306a/vendor/bundle/ruby/2.0.0/gems/activerecord-4.1.8/lib/active_record/railtie.rb:129:in `block (2 levels) in <class:Railtie>' 
     /tmp/build_7c327500f441bbe0f5ec1b5b2f7a306a/vendor/bundle/ruby/2.0.0/gems/activesupport-4.1.8/lib/active_support/lazy_load_hooks.rb:38:in `instance_eval' 
     /tmp/build_7c327500f441bbe0f5ec1b5b2f7a306a/vendor/bundle/ruby/2.0.0/gems/activesupport-4.1.8/lib/active_support/lazy_load_hooks.rb:38:in `execute_hook' 
     /tmp/build_7c327500f441bbe0f5ec1b5b2f7a306a/vendor/bundle/ruby/2.0.0/gems/activesupport-4.1.8/lib/active_support/lazy_load_hooks.rb:28:in `block in on_load' 
     /tmp/build_7c327500f441bbe0f5ec1b5b2f7a306a/vendor/bundle/ruby/2.0.0/gems/activesupport-4.1.8/lib/active_support/lazy_load_hooks.rb:27:in `each' 
     /tmp/build_7c327500f441bbe0f5ec1b5b2f7a306a/vendor/bundle/ruby/2.0.0/gems/activesupport-4.1.8/lib/active_support/lazy_load_hooks.rb:27:in `on_load' 
     /tmp/build_7c327500f441bbe0f5ec1b5b2f7a306a/vendor/bundle/ruby/2.0.0/gems/activerecord-4.1.8/lib/active_record/railtie.rb:118:in `block in <class:Railtie>' 
     /tmp/build_7c327500f441bbe0f5ec1b5b2f7a306a/vendor/bundle/ruby/2.0.0/gems/railties-4.1.8/lib/rails/initializable.rb:30:in `instance_exec' 
     /tmp/build_7c327500f441bbe0f5ec1b5b2f7a306a/vendor/bundle/ruby/2.0.0/gems/railties-4.1.8/lib/rails/initializable.rb:30:in `run' 
     /tmp/build_7c327500f441bbe0f5ec1b5b2f7a306a/vendor/bundle/ruby/2.0.0/gems/railties-4.1.8/lib/rails/initializable.rb:55:in `block in run_initializers' 
     /tmp/build_7c327500f441bbe0f5ec1b5b2f7a306a/vendor/bundle/ruby/2.0.0/gems/railties-4.1.8/lib/rails/initializable.rb:54:in `run_initializers' 
     /tmp/build_7c327500f441bbe0f5ec1b5b2f7a306a/vendor/bundle/ruby/2.0.0/gems/railties-4.1.8/lib/rails/application.rb:300:in `initialize!' 
     /tmp/build_7c327500f441bbe0f5ec1b5b2f7a306a/config/environment.rb:5:in `<top (required)>' 
     /tmp/build_7c327500f441bbe0f5ec1b5b2f7a306a/vendor/bundle/ruby/2.0.0/gems/activesupport-4.1.8/lib/active_support/dependencies.rb:247:in `require' 
     /tmp/build_7c327500f441bbe0f5ec1b5b2f7a306a/vendor/bundle/ruby/2.0.0/gems/activesupport-4.1.8/lib/active_support/dependencies.rb:247:in `block in require' 
     /tmp/build_7c327500f441bbe0f5ec1b5b2f7a306a/vendor/bundle/ruby/2.0.0/gems/activesupport-4.1.8/lib/active_support/dependencies.rb:232:in `load_dependency' 
     /tmp/build_7c327500f441bbe0f5ec1b5b2f7a306a/vendor/bundle/ruby/2.0.0/gems/activesupport-4.1.8/lib/active_support/dependencies.rb:247:in `require' 
     /tmp/build_7c327500f441bbe0f5ec1b5b2f7a306a/vendor/bundle/ruby/2.0.0/gems/railties-4.1.8/lib/rails/application.rb:276:in `require_environment!' 
     /tmp/build_7c327500f441bbe0f5ec1b5b2f7a306a/vendor/bundle/ruby/2.0.0/gems/railties-4.1.8/lib/rails/application.rb:389:in `block in run_tasks_blocks' 
     /tmp/build_7c327500f441bbe0f5ec1b5b2f7a306a/vendor/bundle/ruby/2.0.0/gems/sprockets-rails-2.3.2/lib/sprockets/rails/task.rb:64:in `block (2 levels) in define' 
     Tasks: TOP => environment 
     (See full trace by running task with --trace) 
! 
!  Precompiling assets failed. 
! 
!  Push rejected, failed to compile Ruby app 

Я использую ОС Windows для развития. Я не могу понять, что это за ошибка? Нужна помощь. Спасибо.

После добавления rails_12factor в гем файл я получаю следующее сообщение об ошибке на Heroku журналы

-----> Ruby app detected 
-----> Compiling Ruby/Rails 
-----> Using Ruby version: ruby-2.0.0 
###### WARNING: 
     Removing `Gemfile.lock` because it was generated on Windows. 
     Bundler will do a full resolve so native gems are handled properly. 
     This may result in unexpected gem versions being used in your app. 
     In rare occasions Bundler may not be able to resolve your dependencies at all. 
     https://devcenter.heroku.com/articles/bundler-windows-gemfile 
-----> Installing dependencies using 1.9.7 
     Running: bundle install --without development:test --path vendor/bundle --binstubs vendor/bundle/bin -j4 
     Fetching gem metadata from https://rubygems.org/............ 
     Fetching version metadata from https://rubygems.org/... 
     Fetching dependency metadata from https://rubygems.org/.. 
     Resolving dependencies.... 
     Rubygems 2.0.14 is not threadsafe, so your gems must be installed one at a time. Upgrade to Rubygems 2.1.0 or higher to enable parallel gem installation. 
     Installing rake 10.4.2 
     Installing i18n 0.7.0 
     Installing json 1.8.3 
     Installing minitest 5.7.0 
     Installing thread_safe 0.3.5 
     Installing tzinfo 1.2.2 
     Installing activesupport 4.1.8 
     Installing builder 3.2.2 
     Installing erubis 2.7.0 
     Installing actionview 4.1.8 
     Installing rack 1.5.5 
     Installing rack-test 0.6.3 
     Installing actionpack 4.1.8 
     Installing mime-types 2.6.1 
     Installing mail 2.6.3 
     Installing actionmailer 4.1.8 
     Installing activemodel 4.1.8 
     Installing arel 5.0.1.20140414130214 
     Installing activerecord 4.1.8 
     Installing bcrypt 3.1.10 
     Using bundler 1.9.7 
     Installing columnize 0.9.0 
     Installing byebug 5.0.0 
     Installing coffee-script-source 1.8.0 
     Installing execjs 2.5.2 
     Installing coffee-script 2.4.1 
     Installing thor 0.19.1 
     Installing railties 4.1.8 
     Installing coffee-rails 4.0.1 
     Installing hike 1.2.3 
     Installing multi_json 1.11.2 
     Installing jbuilder 2.3.1 
     Installing jquery-rails 3.1.3 
     Installing pg 0.18.2 
     Installing tilt 1.4.1 
     Installing sprockets 2.12.4 
     Installing sprockets-rails 2.3.2 
     Installing rails 4.1.8 
     Installing rdoc 4.2.0 
     Installing sass 3.2.19 
     Installing sass-rails 4.0.5 
     Installing sdoc 0.4.1 
     Installing turbolinks 2.5.3 
     Installing uglifier 2.7.1 
     Bundle complete! 15 Gemfile dependencies, 44 gems now installed. 
     Gems in the groups development and test were not installed. 
     Bundled gems are installed into ./vendor/bundle. 
     Post-install message from rdoc: 
     Depending on your version of ruby, you may need to install ruby rdoc/ri data: 
     <= 1.8.6 : unsupported 
     = 1.8.7 : gem install rdoc-data; rdoc-data --install 
     = 1.9.1 : gem install rdoc-data; rdoc-data --install 
     >= 1.9.2 : nothing to do! Yay! 
     Bundle completed (57.99s) 
     Cleaning up the bundler cache. 
-----> Preparing app for Rails asset pipeline 
     Running: rake assets:precompile 
     DEPRECATION WARNING: Paths in SQLite3 database URLs of the form `sqlite3:///path` will be treated as absolute in Rails 4.2. Please switch to `sqlite3:dbname`. (called from <top (required)> at /tmp/build_0e966ea42527f491d64dc7a384ec85b6/Rakefile:6) 
     rake aborted! 
     Gem::LoadError: Specified 'sqlite3' for database adapter, but the gem is not loaded. Add `gem 'sqlite3'` to your Gemfile (and ensure its version is at the minimum required by ActiveRecord). 
     /tmp/build_0e966ea42527f491d64dc7a384ec85b6/vendor/bundle/ruby/2.0.0/gems/activerecord-4.1.8/lib/active_record/connection_adapters/connection_specification.rb:190:in `rescue in spec' 
     /tmp/build_0e966ea42527f491d64dc7a384ec85b6/vendor/bundle/ruby/2.0.0/gems/activerecord-4.1.8/lib/active_record/connection_adapters/connection_specification.rb:187:in `spec' 
     /tmp/build_0e966ea42527f491d64dc7a384ec85b6/vendor/bundle/ruby/2.0.0/gems/activerecord-4.1.8/lib/active_record/connection_handling.rb:50:in `establish_connection' 
     /tmp/build_0e966ea42527f491d64dc7a384ec85b6/vendor/bundle/ruby/2.0.0/gems/activerecord-4.1.8/lib/active_record/railtie.rb:129:in `block (2 levels) in <class:Railtie>' 
     /tmp/build_0e966ea42527f491d64dc7a384ec85b6/vendor/bundle/ruby/2.0.0/gems/activesupport-4.1.8/lib/active_support/lazy_load_hooks.rb:38:in `instance_eval' 
     /tmp/build_0e966ea42527f491d64dc7a384ec85b6/vendor/bundle/ruby/2.0.0/gems/activesupport-4.1.8/lib/active_support/lazy_load_hooks.rb:38:in `execute_hook' 
     /tmp/build_0e966ea42527f491d64dc7a384ec85b6/vendor/bundle/ruby/2.0.0/gems/activesupport-4.1.8/lib/active_support/lazy_load_hooks.rb:28:in `block in on_load' 
     /tmp/build_0e966ea42527f491d64dc7a384ec85b6/vendor/bundle/ruby/2.0.0/gems/activesupport-4.1.8/lib/active_support/lazy_load_hooks.rb:27:in `each' 
     /tmp/build_0e966ea42527f491d64dc7a384ec85b6/vendor/bundle/ruby/2.0.0/gems/activesupport-4.1.8/lib/active_support/lazy_load_hooks.rb:27:in `on_load' 
     /tmp/build_0e966ea42527f491d64dc7a384ec85b6/vendor/bundle/ruby/2.0.0/gems/activerecord-4.1.8/lib/active_record/railtie.rb:118:in `block in <class:Railtie>' 
     /tmp/build_0e966ea42527f491d64dc7a384ec85b6/vendor/bundle/ruby/2.0.0/gems/railties-4.1.8/lib/rails/initializable.rb:30:in `instance_exec' 
     /tmp/build_0e966ea42527f491d64dc7a384ec85b6/vendor/bundle/ruby/2.0.0/gems/railties-4.1.8/lib/rails/initializable.rb:30:in `run' 
     /tmp/build_0e966ea42527f491d64dc7a384ec85b6/vendor/bundle/ruby/2.0.0/gems/railties-4.1.8/lib/rails/initializable.rb:55:in `block in run_initializers' 
     /tmp/build_0e966ea42527f491d64dc7a384ec85b6/vendor/bundle/ruby/2.0.0/gems/railties-4.1.8/lib/rails/initializable.rb:54:in `run_initializers' 
     /tmp/build_0e966ea42527f491d64dc7a384ec85b6/vendor/bundle/ruby/2.0.0/gems/railties-4.1.8/lib/rails/application.rb:300:in `initialize!' 
     /tmp/build_0e966ea42527f491d64dc7a384ec85b6/config/environment.rb:5:in `<top (required)>' 
     /tmp/build_0e966ea42527f491d64dc7a384ec85b6/vendor/bundle/ruby/2.0.0/gems/activesupport-4.1.8/lib/active_support/dependencies.rb:247:in `require' 
     /tmp/build_0e966ea42527f491d64dc7a384ec85b6/vendor/bundle/ruby/2.0.0/gems/activesupport-4.1.8/lib/active_support/dependencies.rb:247:in `block in require' 
     /tmp/build_0e966ea42527f491d64dc7a384ec85b6/vendor/bundle/ruby/2.0.0/gems/activesupport-4.1.8/lib/active_support/dependencies.rb:232:in `load_dependency' 
     /tmp/build_0e966ea42527f491d64dc7a384ec85b6/vendor/bundle/ruby/2.0.0/gems/activesupport-4.1.8/lib/active_support/dependencies.rb:247:in `require' 
     /tmp/build_0e966ea42527f491d64dc7a384ec85b6/vendor/bundle/ruby/2.0.0/gems/railties-4.1.8/lib/rails/application.rb:276:in `require_environment!' 
     /tmp/build_0e966ea42527f491d64dc7a384ec85b6/vendor/bundle/ruby/2.0.0/gems/railties-4.1.8/lib/rails/application.rb:389:in `block in run_tasks_blocks' 
     /tmp/build_0e966ea42527f491d64dc7a384ec85b6/vendor/bundle/ruby/2.0.0/gems/sprockets-rails-2.3.2/lib/sprockets/rails/task.rb:64:in `block (2 levels) in define' 
     Tasks: TOP => environment 
     (See full trace by running task with --trace) 
! 
!  Precompiling assets failed. 
! 
!  Push rejected, failed to compile Ruby app 

ИТС, связанные с sqlite3.

+0

Причиной может быть имя *** db *** с расширением '.sqlite3' здесь' database: db/production.sqlite3' – Pavan

+0

@Pavan, то каким будет расширение? – nilkash

+0

Не знаю, может ли это быть проблемой, просто догадка. – Pavan

ответ

0

Вам нужно добавить следующее в ваш Gemfile, а затем расслоение:

group :production do 
    gem 'rails_12factor', '0.0.2' 
end 

Это, мы надеемся решить вашу проблему.

+0

joe dayvie это не работает для меня. – nilkash

+0

Какая у вас ошибка? –

+0

В вашем рабочем файле у вас есть следующее: 'database: db/production.sqlite3'. В рамках производственного аспекта не должно быть никаких SQLite3. Вот почему я полностью удаляю SQLite3 из проектов и использую PG только для обоих. Надеюсь, это проблема? –

Смежные вопросы