我一直在尝试根据本教程(http://angular-rails.com/bootstrap.html)向Heroku部署Rails 4 / AngularJS(Ruby 2.2.3 / Rails 4.2.4)应用程序。它只是让我用PostgreSQL数据库创建Rails 4应用程序,并使用“bower-rails”gem为AngularJS和Bootstrap提供服务。该应用程序在这一点上非常简单,在本地工作非常好。起初,我认为这是一个Windows问题,因为我最初开始在我的Windows 10机器上构建应用程序,但是我已经在Ubuntu 14.04机器上从头开始复制了所有内容,结果相同。
我认为文件路径存在问题,根据Heroku教程(https://devcenter.heroku.com/articles/rails-4-asset-pipeline),我看到应该使用“rails_12factor”gem修复和/或添加“config.serve_static_assets = true “to config / application.rb,我做了两件事。我将我的Gemfile,Gemfile.lock,Procfile,config / application.rb和Rakefile推送到Heroku,没有任何东西使我的应用程序正常工作。
在尝试了所有可能之后,我使用PG db构建了一个新的空Rails应用程序,以排除导致错误的AngularJS / Bootstrap资产,结果是相同的。以下是该部署的日志的底部部分:
remote: Bundle complete! 17 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: Post-install message from rdoc:
remote: Depending on your version of ruby, you may need to install ruby rdoc/ri data:
remote: <= 1.8.6 : unsupported
remote: = 1.8.7 : gem install rdoc-data; rdoc-data --install
remote: = 1.9.1 : gem install rdoc-data; rdoc-data --install
remote: >= 1.9.2 : nothing to do! Yay!
remote: Bundle completed (29.50s)
remote: Cleaning up the bundler cache.
remote:
remote: -----> Discovering process types
remote: Procfile declares types -> web
remote: Default types for buildpack -> console, rake, worker
remote:
remote: -----> Compressing...
remote: Done: 31.3M
remote: -----> Launching...
remote: Released v5
remote: https://desolate-river-80004.herokuapp.com/ deployed to Heroku
remote:
remote: Verifying deploy.... done.
To https://git.heroku.com/desolate-river-80004.git
* [new branch] master -> master
部署之后,在我输入“heroku open”后出现此消息:
Opening desolate-river-80004... done
(process:14649): GLib-CRITICAL **: g_slice_set_config: assertion 'sys_page_size == 0' failed
我已经尽力了。任何人都可以帮助我指出正确的方向吗?
这是我的Gemfile:
source 'https://rubygems.org'
ruby "2.2.3"
# Bundle edge Rails instead: gem 'rails', github: 'rails/rails'
gem 'rails', '4.2.4'
# Use postgresql as the database for Active Record
gem 'pg'
# 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 'sass', '3.2.19'
gem "bower-rails"
gem "puma"
group :development, :test do
# Call 'byebug' anywhere in the code to stop execution and get a debugger console
gem 'byebug'
gem "rspec-rails", "~> 2.0"
gem "factory_girl_rails", "~> 4.0"
gem "capybara"
gem "database_cleaner"
gem "selenium-webdriver"
end
gem "foreman"
group :production, :staging do
gem "rails_12factor"
gem "rails_stdout_logging"
gem "rails_serve_static_assets"
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