i am having this problem on my heroku server
at=error code=H14 desc="No web processes running"
i attempted to run
heroku ps:scale web=1
but receive this error
Scaling web processes... failed
! No such type as web
heroku ps:restart web.1 --app dashboardaudi88
Restarting web.1 process... done
and here are the heroku logs
heroku logs
2012-12-08T21:14:46+00:00 app[web.1]: -d, [--database=DATABASE] # Preconfigure for selected database (options: mysql/oracle/postgresql/sqlite3/frontbase/ibm_db/sqlserver/jdbcmysql/jdbcsqlite3/jdbcpostgresql/jdbc)
2012-12-08T21:14:46+00:00 app[web.1]: [--dev] # Setup the application with Gemfile pointing to your Rails checkout
2012-12-08T21:14:46+00:00 app[web.1]: rails new APP_PATH [options]
2012-12-08T21:14:46+00:00 app[web.1]: # Default: /usr/local/bin/ruby
2012-12-08T21:14:46+00:00 app[web.1]: -m, [--template=TEMPLATE] # Path to an application template (can be a filesystem path or URL)
2012-12-08T21:14:46+00:00 app[web.1]: -f, [--force] # Overwrite files that already exist
2012-12-08T21:14:46+00:00 app[web.1]: -v, [--version] # Show Rails version number and quit
2012-12-08T21:14:46+00:00 app[web.1]: -j, [--javascript=JAVASCRIPT] # Preconfigure for selected JavaScript library
2012-12-08T21:14:46+00:00 app[web.1]: [--old-style-hash] # Force using old style hash (:foo => 'bar') on Ruby >= 1.9
2012-12-08T21:14:46+00:00 app[web.1]:
2012-12-08T21:14:46+00:00 app[web.1]: Description:
2012-12-08T21:14:46+00:00 app[web.1]: -b, [--builder=BUILDER] # Path to a application builder (can be a filesystem path or URL)
2012-12-08T21:14:46+00:00 app[web.1]: # Default: sqlite3
2012-12-08T21:14:46+00:00 app[web.1]: [--edge] # Setup the application with Gemfile pointing to Rails repository
2012-12-08T21:14:46+00:00 app[web.1]: -q, [--quiet] # Suppress status output
2012-12-08T21:14:46+00:00 app[web.1]: -h, [--help] # Show this help message and quit
2012-12-08T21:14:46+00:00 app[web.1]:
2012-12-08T21:14:46+00:00 app[web.1
]: Options:
2012-12-08T21:14:46+00:00 app[web.1]: -r, [--ruby=PATH] # Path to the Ruby binary of your choice
2012-12-08T21:14:46+00:00 app[web.1]: [--skip-gemfile] # Don't create a Gemfile
2012-12-08T21:14:46+00:00 app[web.1]: [--skip-bundle] # Don't run bundle install
2012-12-08T21:14:46+00:00 app[web.1]: -G, [--skip-git] # Skip Git ignores and keeps
2012-12-08T21:14:46+00:00 app[web.1]: -O, [--skip-active-record] # Skip Active Record files
2012-12-08T21:14:46+00:00 app[web.1]: 'rails new' runs in the .railsrc configuration file in your home directory.
2012-12-08T21:14:46+00:00 app[web.1]: -J, [--skip-javascript] # Skip JavaScript files
2012-12-08T21:14:46+00:00 app[web.1]: -p, [--pretend] # Run but do not make any changes
2012-12-08T21:14:46+00:00 app[web.1]:
2012-12-08T21:14:46+00:00 app[web.1]: -s, [--skip] # Skip files that already exist
2012-12-08T21:14:46+00:00 app[web.1]: # Default: jquery
2012-12-08T21:14:46+00:00 app[web.1]: -T, [--skip-test-unit] # Skip Test::Unit files
2012-12-08T21:14:46+00:00 app[web.1]:
2012-12-08T21:14:46+00:00 app[web.1]: Runtime options:
2012-12-08T21:14:46+00:00 app[web.1]: Example:
2012-12-08T21:14:46+00:00 app[web.1]:
2012-12-08T21:14:46+00:00 app[web.1]: rails new ~/Code/Ruby/weblog
2012-12-08T21:14:46+00:00 app[web.1]:
2012-12-08T21:14:46+00:00 app[web.1]: See the README in the newly created application to get going.
2012-12-08T21:14:46+00:00 app[web.1]: This generates a skeletal Rails installation in ~/Code/Ruby/weblog.
2012-12-08T21:14:46+00:00 app[web.1]: The 'rails new' command creates a new Rails application with a default
2012-12-08T21:14:46+00:00 app[web.1]:
2012-12-08T21:14:46+00:00 app[web.1]: Rails options:
2012-12-08T21:14:46+00:00 app[web.1]: directory structure and configuration at the path you specify.
2012-12-08T21:14:46+00:00 app[web.1]:
2012-12-08T21:14:46+00:00 app[web.1]: You can specify extra command-line arguments to be used every time
2012-12-08T21:14:46+00:00 app[web.1]: Note that the arguments specified in the .railsrc file don't affect the
2012-12-08T21:14:46+00:00 app[web.1]: defaults values shown above in this help message.
2012-12-08T21:14:47+00:00 heroku[web.1]: State changed from starting to crashed
2012-12-08T21:14:47+00:00 heroku[web.1]: Process exited with status 0
2012-12-08T21:23:59+00:00 heroku[web.1]: State changed from crashed to starting
2012-12-08T21:24:02+00:00 heroku[web.1]: Starting process with command `bundle exec rails server -p 37045`
2012-12-08T21:24:06+00:00 app[web.1]: -r, [--ruby=PATH] # Path to the Ruby binary of your choice
2012-12-08T21:24:06+00:00 app[web.1]: [--skip-bundle] # Don't run bundle install
2012-12-08T21:24:06+00:00 app[web.1]:
2012-12-08T21:24:06+00:00 app[web.1]: -m, [--template=TEMPLATE] # Path to an application template (can be a filesystem path or URL)
2012-12-08T21:24:06+00:00 app[web.1]: # Default: /usr/local/bin/ruby
2012-12-08T21:24:06+00:00 app[web.1]: -G, [--skip-git] # Skip Git ignores and keeps
2012-12-08T21:24:06+00:00 app[web.1]: # Default: sqlite3
2012-12-08T21:24:06+00:00 app[web.1]: -d, [--database=DATABASE] # Preconfigure for selected database (options: mysql/oracle/postgresql/sqlite3/frontbase/ibm_db/sqlserver/jdbcmysql/jdbcsqlite3/jdbcpostgresql/jdbc)
2012-12-08T21:24:06+00:00 app[web.1]: -O, [--skip-active-record] # Skip Active Record files
2012-12-08T21:24:06+00:00 app[web.1]: Options:
2012-12-08T21:24:06+00:00 app[web.1]: -j, [--javascript=JAVASCRIPT] # Preconfigure for selected JavaScript library
2012-12-08T21:24:06+00:00 app[web.1]: [--edge] # Setup the application with Gemfile pointing to Rails repository
2012-12-08T21:24:06+00:00 app[web.1]: Usage:
2012-12-08T21:24:06+00:00 app[web.1]: -b, [--builder=BUILDER] # Path to a application builder (can be a filesystem path or URL)
2012-12-08T21:24:06+00:00 app[web.1]: -S, [--skip-sprockets] # Skip Sprockets files
2012-12-08T21:24:06+00:00 app[web.1]: [--old-style-hash] # Force using old style hash (:foo => 'bar') on Ruby >= 1.9
2012-12-08T21:24:06+00:00 app[web.1]: -f, [--force] # Overwrite files that already exist
2012-12-08T21:24:06+00:00 app[web.1]: [--dev] # Setup the application with Gemfile pointing to your Rails checkout
2012-12-08T21:24:06+00:00 app[web.1]: # Default: jquery
2012-12-08T21:24:06+00:00 app[web.1]: -p, [--pretend] # Run but do not make any changes
2012-12-08T21:24:06+00:00 app[web.1]: -v, [--version] # Show Rails version number and quit
2012-12-08T21:24:06+00:00 app[web.1]: -J, [--skip-javascript] # Skip JavaScript files
2012-12-08T21:24:06+00:00 app[web.1]: -q, [--quiet] # Suppress status output
2012-12-08T21:24:06+00:00 app[web.1]: -h, [--help] # Show this help message and quit
2012-12-08T21:24:06+00:00 app[web.1]: -T, [--skip-test-unit] # Skip Test::Unit files
2012-12-08T21:24:06+00:00 app[web.1]:
2012-12-08T21:24:06+00:00 app[web.1]:
2012-12-08T21:24:06+00:00 app[web.1]:
2012-12-08T21:24:06+00:00 app[web.1]: -s, [--skip] # Skip files that already exist
2012-12-08T21:24:06+00:00 app[web.1]: Description:
2012-12-08T21:24:06+00:00 app[web.1]: rails new APP_PATH [options]
2012-12-08T21:24:06+00:00 app[web.1]: The 'rails new' command creates a new Rails application with a default
2012-12
-08T21:24:06+00:00 app[web.1]: defaults values shown above in this help message.
2012-12-08T21:24:06+00:00 app[web.1]: directory structure and configuration at the path you specify.
2012-12-08T21:24:06+00:00 app[web.1]: You can specify extra command-line arguments to be used every time
2012-12-08T21:24:06+00:00 app[web.1]: 'rails new' runs in the .railsrc configuration file in your home directory.
2012-12-08T21:24:06+00:00 app[web.1]:
2012-12-08T21:24:06+00:00 app[web.1]: Note that the arguments specified in the .railsrc file don't affect the
2012-12-08T21:24:06+00:00 app[web.1]:
2012-12-08T21:24:06+00:00 app[web.1]:
2012-12-08T21:24:06+00:00 app[web.1]: Example:
2012-12-08T21:24:06+00:00 app[web.1]: [--skip-gemfile] # Don't create a Gemfile
2012-12-08T21:24:06+00:00 app[web.1]: This generates a skeletal Rails installation in ~/Code/Ruby/weblog.
2012-12-08T21:24:06+00:00 app[web.1]:
2012-12-08T21:24:06+00:00 app[web.1]: See the README in the newly created application to get going.
2012-12-08T21:24:06+00:00 app[web.1]: rails new ~/Code/Ruby/weblog
2012-12-08T21:24:06+00:00 app[web.1]: Runtime options:
2012-12-08T21:24:06+00:00 app[web.1]: Rails options:
2012-12-08T21:24:07+00:00 heroku[web.1]: State changed from starting to crashed
2012-12-08T21:24:07+00:00 heroku[web.1]: Process exited with status 0
2012-12-08T21:24:54+00:00 heroku[web.1]: State changed from crashed to starting
Make sure the Procfile doesn't have any extension! For instance if you use Procfile.txt it's gonna return "Scaling web processes... failed ! No such type as web". Delete the extension of your Procfile and it'll work!
Looking at https://devcenter.heroku.com/articles/error-codes#h14-no-web-dynos-running, you should run: heroku ps:scale web=1, which fixed the error for me
Related
I'm trying to start the prometheus_exporter gem with -b 0.0.0.0 parameter, in a docker container.
I get this error:
remote: /usr/local/lib/ruby/2.6.0/socket.rb:227:in `getaddrinfo': getaddrinfo: Name or service not known (SocketError)
remote: from /usr/local/lib/ruby/2.6.0/socket.rb:227:in `foreach'
remote: from /usr/local/lib/ruby/2.6.0/socket.rb:762:in `tcp_server_sockets'
remote: from /usr/local/lib/ruby/2.6.0/webrick/utils.rb:65:in `create_listeners'
remote: from /usr/local/lib/ruby/2.6.0/webrick/server.rb:127:in `listen'
remote: from /usr/local/lib/ruby/2.6.0/webrick/server.rb:108:in `initialize'
remote: from /usr/local/lib/ruby/2.6.0/webrick/httpserver.rb:47:in `initialize'
remote: from /usr/local/bundle/gems/prometheus_exporter-0.8.1/lib/prometheus_exporter/server/web_server.rb:47:in `new'
remote: from /usr/local/bundle/gems/prometheus_exporter-0.8.1/lib/prometheus_exporter/server/web_server.rb:47:in `initialize'
remote: from /usr/local/bundle/gems/prometheus_exporter-0.8.1/lib/prometheus_exporter/server/runner.rb:45:in `new'
remote: from /usr/local/bundle/gems/prometheus_exporter-0.8.1/lib/prometheus_exporter/server/runner.rb:45:in `start'
remote: from /usr/local/bundle/gems/prometheus_exporter-0.8.1/bin/prometheus_exporter:122:in `run'
remote: from /usr/local/bundle/gems/prometheus_exporter-0.8.1/bin/prometheus_exporter:126:in `<top (required)>'
remote: from /usr/local/bundle/bin/prometheus_exporter:23:in `load'
remote: from /usr/local/bundle/bin/prometheus_exporter:23:in `<main>'
remote: 2021-10-29 14:39:23 +0000 Starting prometheus exporter on 0.0.0.0:9394
The container is built using this Dockerfile:
FROM ruby:2.6.6
RUN gem install prometheus_exporter
WORKDIR /app
EXPOSE 9394
CMD ["-v","-b 0.0.0.0"]
ENTRYPOINT ["/usr/local/bundle/bin/prometheus_exporter"]
I need this to run in its own container to collect metrics from multiple other containers, so the 0.0.0.0 bind is necessary.
It starts if the -b 0.0.0.0 parameter is not used.
Any idea?
Trying to learn Sinatra I just deployed a simple app to heroku.
My config file:
require './main'
require 'sinatra'
run Sinatra::Application
Gemfile:
source 'http://rubygems.org'
ruby '1.9.3'
gem 'sinatra'
gem 'slim'
gem 'sass'
gem 'dm-core'
gem 'dm-migrations'
gem 'thin'
gem 'pg', :group => :production
gem 'dm-postgres-adapter', :group => :production
gem 'dm-sqlite-adapter', :group => :development
I get following error in the logs:
2015-03-31T09:13:54.051645+00:00 heroku[web.1]: State changed from crashed to starting
2015-03-31T09:13:57.281158+00:00 heroku[web.1]: Starting process with command `bundle exec ruby main.rb -p 28463`
2015-03-31T09:13:59.598142+00:00 app[web.1]: /app/vendor/bundle/ruby/1.9.1/gems/dm-core-1.2.1/lib/dm-core/adapters.rb:163:in `require': cannot load such file -- dm-sqlite-adapter (LoadError)
2015-03-31T09:13:59.598161+00:00 app[web.1]: from /app/vendor/bundle/ruby/1.9.1/gems/dm-core-1.2.1/lib/dm-core/adapters.rb:163:in `load_adapter'
2015-03-31T09:13:59.598164+00:00 app[web.1]: from /app/vendor/bundle/ruby/1.9.1/gems/dm-core-1.2.1/lib/dm-core/adapters.rb:133:in `adapter_class'
2015-03-31T09:13:59.598165+00:00 app[web.1]: from /app/vendor/bundle/ruby/1.9.1/gems/dm-core-1.2.1/lib/dm-core/adapters.rb:13:in `new'
2015-03-31T09:13:59.598167+00:00 app[web.1]: from /app/vendor/bundle/ruby/1.9.1/gems/dm-core-1.2.1/lib/dm-core.rb:230:in `setup'
2015-03-31T09:13:59.598169+00:00 app[web.1]: from /app/song.rb:5:in `block in <top (required)>'
2015-03-31T09:13:59.598171+00:00 app[web.1]: from /app/vendor/bundle/ruby/1.9.1/gems/sinatra-1.4.6/lib/sinatra/base.rb:1410:in `configure'
2015-03-31T09:13:59.598172+00:00 app[web.1]: from /app/vendor/bundle/ruby/1.9.1/gems/sinatra-1.4.6/lib/sinatra/base.rb:1989:in `block (2 levels) in delegate'
2015-03-31T09:13:59.598174+00:00 app[web.1]: from /app/song.rb:4:in `<top (required)>'
2015-03-31T09:13:59.598178+00:00 app[web.1]: from main.rb:6:in `require'
2015-03-31T09:13:59.598187+00:00 app[web.1]: from main.rb:6:in `<main>'
2015-03-31T09:14:00.479331+00:00 heroku[web.1]: State changed from starting to crashed
2015-03-31T09:14:00.461548+00:00 heroku[web.1]: Process exited with status 1
I tried the solution proposed here but it did not work.
Thanks in advance for ideas
I think you need datamapper in your Gemfile.
gem "datamapper"
I'm trying to deploy my Ruby on Rails app to Heroku with Unicorn. I followed the tutorial on Heroku website. But it shows:
Precompiling assets failed.
Here is the running result:
-----> Preparing app for Rails asset pipeline
Running: rake assets:precompile
fatal: Not a git repository (or any of the parent directories): .git
fatal: Not a git repository (or any of the parent directories): .git
[deprecated] I18n.enforce_available_locales will default to true in the future. If you really want to skip validation of your locale you can set I18n.enforce_available_locales = false to avoid this message.
rake aborted!
uninitialized constant Rack::Timeout
/tmp/build_d3989303-c1d8-4020-9b98-eb9e1834f0d0/config/initializers/timeout.rb:1:in `<top (required)>'
/tmp/build_d3989303-c1d8-4020-9b98-eb9e1834f0d0/vendor/bundle/ruby/2.0.0/gems/railties-4.1.0.rc1/lib/rails/engine.rb:649:in `block in load_config_initializer'
/tmp/build_d3989303-c1d8-4020-9b98-eb9e1834f0d0/vendor/bundle/ruby/2.0.0/gems/activesupport-4.1.0.rc1/lib/active_support/notifications.rb:161:in `instrument'
/tmp/build_d3989303-c1d8-4020-9b98-eb9e1834f0d0/vendor/bundle/ruby/2.0.0/gems/railties-4.1.0.rc1/lib/rails/engine.rb:648:in `load_config_initializer'
/tmp/build_d3989303-c1d8-4020-9b98-eb9e1834f0d0/vendor/bundle/ruby/2.0.0/gems/railties-4.1.0.rc1/lib/rails/engine.rb:613:in `block (2 levels) in <class:Engine>'
/tmp/build_d3989303-c1d8-4020-9b98-eb9e1834f0d0/vendor/bundle/ruby/2.0.0/gems/railties-4.1.0.rc1/lib/rails/engine.rb:612:in `each'
/tmp/build_d3989303-c1d8-4020-9b98-eb9e1834f0d0/vendor/bundle/ruby/2.0.0/gems/railties-4.1.0.rc1/lib/rails/engine.rb:612:in `block in <class:Engine>'
/tmp/build_d3989303-c1d8-4020-9b98-eb9e1834f0d0/vendor/bundle/ruby/2.0.0/gems/railties-4.1.0.rc1/lib/rails/initializable.rb:30:in `instance_exec'
/tmp/build_d3989303-c1d8-4020-9b98-eb9e1834f0d0/vendor/bundle/ruby/2.0.0/gems/railties-4.1.0.rc1/lib/rails/initializable.rb:30:in `run'
/tmp/build_d3989303-c1d8-4020-9b98-eb9e1834f0d0/vendor/bundle/ruby/2.0.0/gems/railties-4.1.0.rc1/lib/rails/initializable.rb:55:in `block in run_initializers'
/tmp/build_d3989303-c1d8-4020-9b98-eb9e1834f0d0/vendor/bundle/ruby/2.0.0/gems/railties-4.1.0.rc1/lib/rails/initializable.rb:44:in `each'
/tmp/build_d3989303-c1d8-4020-9b98-eb9e1834f0d0/vendor/bundle/ruby/2.0.0/gems/railties-4.1.0.rc1/lib/rails/initializable.rb:44:in `tsort_each_child'
/tmp/build_d3989303-c1d8-4020-9b98-eb9e1834f0d0/vendor/bundle/ruby/2.0.0/gems/railties-4.1.0.rc1/lib/rails/initializable.rb:54:in `run_initializers'
/tmp/build_d3989303-c1d8-4020-9b98-eb9e1834f0d0/vendor/bundle/ruby/2.0.0/gems/railties-4.1.0.rc1/lib/rails/application.rb:286:in `initialize!'
/tmp/build_d3989303-c1d8-4020-9b98-eb9e1834f0d0/config/environment.rb:5:in `<top (required)>'
/tmp/build_d3989303-c1d8-4020-9b98-eb9e1834f0d0/vendor/bundle/ruby/2.0.0/gems/railties-4.1.0.rc1/lib/rails/application.rb:262:in `require_environment!'
/tmp/build_d3989303-c1d8-4020-9b98-eb9e1834f0d0/vendor/bundle/ruby/2.0.0/gems/railties-4.1.0.rc1/lib/rails/application.rb:346:in `block in run_tasks_blocks'
/tmp/build_d3989303-c1d8-4020-9b98-eb9e1834f0d0/vendor/bundle/ruby/2.0.0/gems/sprockets-rails-2.0.1/lib/sprockets/rails/task.rb:54: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
I use Ruby2.0, Ruby on Rails 4.1.0.rc1.
It looks like your problem is actually related to Rack::Timeout and not asset compilation.
uninitialized constant Rack::Timeout
/tmp/build_d3989303-c1d8-4020-9b98-eb9e1834f0d0/config/initializers/timeout.rb:1:in `<top (required)>'
Have you included the rack-timeout gem in your gemfile? And ran bundle install after that?
gem "rack-timeout"
Remove the timeout setting:
rm config/initializers/timeout.rb
Heroku times-out all requests at 30 seconds but the process will continue running in the background.
If you want to avoid that, re-add the line above but put rack-timeout in your Gemfile.
I would suggest trying the following:
heroku labs:enable user-env-compile
If this fails, you could always precompile your production assets, add them to your codebase and push them to heroku yourself.
RAILS_ENV=production rake assets:precompile
git add .
git commit -m 'serving up my precompiled assets'
git push origin master
git push origin heroku
Had new relic up and working fine, but now the push fails during asset precompile. It has to do with the 'newrelic_plugin' gem, because the push worked fine after removing that line from my gemfile and re-bundling.
I have the heroku lab 'user-env-compile' enabled, not sure if it's relevant.
Here's the full stack trace; any help would be much appreciated:
Your bundle is complete! It was installed into ./vendor/bundle
Cleaning up the bundler cache.
-----> Writing config/database.yml to read from DATABASE_URL
-----> Preparing app for Rails asset pipeline
Running: rake assets:precompile
** Invoke assets:precompile (first_time)
** Invoke assets:environment (first_time)
** Execute assets:environment
** Invoke environment (first_time)
** Execute environment
rake aborted!
uninitialized constant NewRelic::Logger::INFO
/tmp/build_k8jk6mc5x6ch/vendor/bundle/ruby/2.0.0/gems/newrelic_rpm-3.6.6.147/lib/new_relic/agent/agent_logger.rb:131:in `log_level_for'
/tmp/build_k8jk6mc5x6ch/vendor/bundle/ruby/2.0.0/gems/newrelic_rpm-3.6.6.147/lib/new_relic/agent/agent_logger.rb:119:in `set_log_level!'
/tmp/build_k8jk6mc5x6ch/vendor/bundle/ruby/2.0.0/gems/newrelic_rpm-3.6.6.147/lib/new_relic/agent/agent_logger.rb:13:in `initialize'
/tmp/build_k8jk6mc5x6ch/vendor/bundle/ruby/2.0.0/gems/newrelic_rpm-3.6.6.147/lib/new_relic/control/instance_methods.rb:62:in `new'
/tmp/build_k8jk6mc5x6ch/vendor/bundle/ruby/2.0.0/gems/newrelic_rpm-3.6.6.147/lib/new_relic/control/instance_methods.rb:62:in `init_plugin'
/tmp/build_k8jk6mc5x6ch/vendor/bundle/ruby/2.0.0/gems/newrelic_rpm-3.6.6.147/lib/newrelic_rpm.rb:40:in `block in <class:Railtie>'
/tmp/build_k8jk6mc5x6ch/vendor/bundle/ruby/2.0.0/bundler/gems/rails-0b3a078a2481/railties/lib/rails/initializable.rb:30:in `instance_exec'
/tmp/build_k8jk6mc5x6ch/vendor/bundle/ruby/2.0.0/bundler/gems/rails-0b3a078a2481/railties/lib/rails/initializable.rb:30:in `run'
/tmp/build_k8jk6mc5x6ch/vendor/bundle/ruby/2.0.0/bundler/gems/rails-0b3a078a2481/railties/lib/rails/initializable.rb:55:in `block in run_initializers'
/tmp/build_k8jk6mc5x6ch/vendor/bundle/ruby/2.0.0/bundler/gems/rails-0b3a078a2481/railties/lib/rails/initializable.rb:54:in `run_initializers'
/tmp/build_k8jk6mc5x6ch/vendor/bundle/ruby/2.0.0/bundler/gems/rails-0b3a078a2481/railties/lib/rails/application.rb:257:in `initialize!'
/tmp/build_k8jk6mc5x6ch/vendor/bundle/ruby/2.0.0/bundler/gems/rails-0b3a078a2481/railties/lib/rails/railtie.rb:194:in `public_send'
/tmp/build_k8jk6mc5x6ch/vendor/bundle/ruby/2.0.0/bundler/gems/rails-0b3a078a2481/railties/lib/rails/railtie.rb:194:in `method_missing'
/tmp/build_k8jk6mc5x6ch/config/environment.rb:5:in `<top (required)>'
/tmp/build_k8jk6mc5x6ch/vendor/bundle/ruby/2.0.0/bundler/gems/rails-0b3a078a2481/railties/lib/rails/application.rb:233:in `require_environment!'
/tmp/build_k8jk6mc5x6ch/vendor/bundle/ruby/2.0.0/bundler/gems/rails-0b3a078a2481/railties/lib/rails/application.rb:295:in `block in run_tasks_blocks'
/tmp/build_k8jk6mc5x6ch/vendor/bundle/ruby/2.0.0/gems/sprockets-rails-2.0.0/lib/sprockets/rails/task.rb:54:in `block (2 levels) in define'
Tasks: TOP => environment
(See full trace by running task with --trace)
!
! Precompiling assets failed.
I am new to ruby, git and heroku. I was trying to build a simple Hello World app and deploy it on heroku. I see the following error in the logs when I try to access the site using the heroku provided URL. Could you tell me what I am not doing right.
2011-07-03T01:15:06+00:00 app[web.1]: from /usr/ruby1.9.2/lib/ruby/gems/1.9.1/gems/rack-1.1.0/lib/rack/builder.rb:46:in `instance_eval'
2011-07-03T01:15:06+00:00 app[web.1]: from /usr/ruby1.9.2/lib/ruby/gems/1.9.1/gems/rack-1.1.0/lib/rack/builder.rb:46:in `initialize'
2011-07-03T01:15:06+00:00 app[web.1]: from /home/heroku_rack/heroku.ru:1:in `new'
2011-07-03T01:15:06+00:00 app[web.1]: from /home/heroku_rack/heroku.ru:1:in `<main>'
2011-07-03T01:15:06+00:00 app[web.1]: from /usr/ruby1.9.2/lib/ruby/gems/1.9.1/gems/thin-1.2.6/lib/rack/adapter/loader.rb:36:in `eval'
2011-07-03T01:15:06+00:00 app[web.1]: from /usr/ruby1.9.2/lib/ruby/gems/1.9.1/gems/thin-1.2.6/lib/thin/controllers/controller.rb:175:in `load_rackup_config'
2011-07-03T01:15:06+00:00 app[web.1]: from /usr/ruby1.9.2/lib/ruby/gems/1.9.1/gems/thin-1.2.6/lib/rack/adapter/loader.rb:36:in `load'
2011-07-03T01:15:06+00:00 app[web.1]: from /usr/ruby1.9.2/lib/ruby/gems/1.9.1/gems/thin-1.2.6/lib/thin/controllers/controller.rb:65:in `start'
2011-07-03T01:15:06+00:00 app[web.1]: from /usr/ruby1.9.2/lib/ruby/gems/1.9.1/gems/thin-1.2.6/lib/thin/runner.rb:177:in `run_command'
2011-07-03T01:15:06+00:00 heroku[web.1]: Process exited
2011-07-03T01:15:07+00:00 heroku[web.1]: State changed from starting to crashed
config.ru file
require 'myapp2'
run Sinatra::Application
myapp2.rb
require 'rubygems'
require 'sinatra'
get '/' do
'Hello World'
end
You're missing the top of the stack trace, but it looks like the problem is the require.
In config.ru change
require 'myapp2'
to
require './myapp2'
or
require File.expand_path("../myapp2", __FILE__)
Ruby 1.9.2 no longer has the current directory in the load path, so require 'myapp2' isn't able to find your app file which is in the same directory.
If this is working on your local machine, but not on Heroku, then you're likely using a different version of Ruby, probably 1.8.7. It would be a good idea to install 1.9.2 locally so that you're using the same version in development and production. Alternatively you could change the Heroku stack you're using; have a look at the Heroku stack docs