When I run heroku run rails console, my stack trace reads:
Running rails console on ⬢ canvas-gattaca... up, run.8126 (Standard-1X)
Exiting
/app/vendor/bundle/ruby/2.2.0/gems/activesupport-4.2.5.2/lib/active_support/dependencies.rb:274:in `require': cannot load such file -- rack/handler/console (LoadError)
from /app/vendor/bundle/ruby/2.2.0/gems/activesupport-4.2.5.2/lib/active_support/dependencies.rb:274:in `block in require'
from /app/vendor/bundle/ruby/2.2.0/gems/activesupport-4.2.5.2/lib/active_support/dependencies.rb:240:in `load_dependency'
from /app/vendor/bundle/ruby/2.2.0/gems/activesupport-4.2.5.2/lib/active_support/dependencies.rb:274:in `require'
from /app/vendor/bundle/ruby/2.2.0/gems/rack-1.6.5/lib/rack/handler.rb:90:in `try_require'
from /app/vendor/bundle/ruby/2.2.0/gems/rack-1.6.5/lib/rack/handler.rb:16:in `get'
from /app/vendor/bundle/ruby/2.2.0/gems/rack-1.6.5/lib/rack/server.rb:290:in `server'
from /app/vendor/bundle/ruby/2.2.0/gems/railties-4.2.5.2/lib/rails/commands/server.rb:125:in `print_boot_information'
from /app/vendor/bundle/ruby/2.2.0/gems/railties-4.2.5.2/lib/rails/commands/server.rb:75:in `start'
from /app/vendor/bundle/ruby/2.2.0/gems/railties-4.2.5.2/lib/rails/commands/commands_tasks.rb:80:in `block in server'
from /app/vendor/bundle/ruby/2.2.0/gems/railties-4.2.5.2/lib/rails/commands/commands_tasks.rb:75:in `tap'
from /app/vendor/bundle/ruby/2.2.0/gems/railties-4.2.5.2/lib/rails/commands/commands_tasks.rb:75:in `server'
from /app/vendor/bundle/ruby/2.2.0/gems/railties-4.2.5.2/lib/rails/commands/commands_tasks.rb:39:in `run_command!'
from /app/vendor/bundle/ruby/2.2.0/gems/railties-4.2.5.2/lib/rails/commands.rb:17:in `<top (required)>'
from bin/rails:9:in `require'
from bin/rails:9:in `<main>'
My logs read:
2017-03-28T19:02:33.583671+00:00 app[api]: Starting process with command `bundle exec rails server console` by user ccromar#instructure.com
2017-03-28T19:02:37.784210+00:00 heroku[run.4264]: Awaiting client
2017-03-28T19:02:37.827306+00:00 heroku[run.4264]: Starting process with command `bundle exec rails server console`
2017-03-28T19:02:38.058988+00:00 heroku[run.4264]: State changed from starting to up
2017-03-28T19:02:45.391746+00:00 heroku[run.4264]: State changed from up to complete
2017-03-28T19:02:45.377045+00:00 heroku[run.4264]: Process exited with status 1
My Procfile-
rails: bundle exec rails server
webpack: ./node_modules/.bin/webpack-dev-server --config config/webpack.config.js
Am I missing anything?
You can try this way:
heroku run console
Related
Starting the Ruby thin client works fine in command line:
RAILS_ENV=production bundle exec thin --ssl-disable-verify -C services/private_pub/private_pub_thin.yml start
But starting it as deamon returns a Bad File Descriptor:
user#app:~/app$ RAILS_ENV=production bundle exec thin -d --ssl-disable-verify -C services/private_pub/private_pub_thin.yml start
user#app:~/app$ /opt/rbenv/versions/2.2.1/lib/ruby/gems/2.2.0/gems/bundler-1.12.5/lib/bundler/source/git/git_proxy.rb:149:in ``': Bad file descriptor (Errno::EBADF)
from /opt/rbenv/versions/2.2.1/lib/ruby/gems/2.2.0/gems/bundler-1.12.5/lib/bundler/source/git/git_proxy.rb:149:in `block in git'
from /opt/rbenv/versions/2.2.1/lib/ruby/gems/2.2.0/gems/bundler-1.12.5/lib/bundler/shared_helpers.rb:72:in `call'
from /opt/rbenv/versions/2.2.1/lib/ruby/gems/2.2.0/gems/bundler-1.12.5/lib/bundler/shared_helpers.rb:72:in `with_clean_git_env'
from /opt/rbenv/versions/2.2.1/lib/ruby/gems/2.2.0/gems/bundler-1.12.5/lib/bundler/source/git/git_proxy.rb:149:in `git'
from /opt/rbenv/versions/2.2.1/lib/ruby/gems/2.2.0/gems/bundler-1.12.5/lib/bundler/source/git/git_proxy.rb:83:in `version'
from /opt/rbenv/versions/2.2.1/lib/ruby/gems/2.2.0/gems/bundler-1.12.5/lib/bundler/env.rb:78:in `git_version'
from /opt/rbenv/versions/2.2.1/lib/ruby/gems/2.2.0/gems/bundler-1.12.5/lib/bundler/env.rb:22:in `report'
from /opt/rbenv/versions/2.2.1/lib/ruby/gems/2.2.0/gems/bundler-1.12.5/lib/bundler/friendly_errors.rb:74:in `request_issue_report_for'
from /opt/rbenv/versions/2.2.1/lib/ruby/gems/2.2.0/gems/bundler-1.12.5/lib/bundler/friendly_errors.rb:40:in `log_error'
from /opt/rbenv/versions/2.2.1/lib/ruby/gems/2.2.0/gems/bundler-1.12.5/lib/bundler/friendly_errors.rb:100:in `rescue in with_friendly_errors'
from /opt/rbenv/versions/2.2.1/lib/ruby/gems/2.2.0/gems/bundler-1.12.5/lib/bundler/friendly_errors.rb:98:in `with_friendly_errors'
from /opt/rbenv/versions/2.2.1/lib/ruby/gems/2.2.0/gems/bundler-1.12.5/exe/bundle:19:in `<top (required)>'
from /opt/rbenv/versions/2.2.1/bin/bundle:23:in `load'
from /opt/rbenv/versions/2.2.1/bin/bundle:23:in `<main>'
Any idea? This happened without any code change. There is also nothing already running.
I'm developing a simple Rails application using Cloud 9.
Everytime I run the application I get this error in the Cloud 9 browser
No application seems to be running here!
I researched this and I can't figure out why. I used
rails s -b $IP -p $PORT
to launch the server. This was done in the root directory of the application. I have installed all the Rails gems/bundles needed.
When I run the application I'm getting a message in the terminal saying
my code is running at htttps://......... example
when I click the link is when I see the error.
This is the response from the terminal after I try start the server:
$ rails server –b $IP –p $PORT
Exiting
/usr/local/rvm/gems/ruby-2.3.0/gems/rack-1.6.4/lib/rack/handler.rb:78:in `require': cannot load such file -- rack/handler/–b (LoadError)
from /usr/local/rvm/gems/ruby-2.3.0/gems/rack-1.6.4/lib/rack/handler.rb:78:in `try_require'
from /usr/local/rvm/gems/ruby-2.3.0/gems/rack-1.6.4/lib/rack/handler.rb:16:in `get'
from /usr/local/rvm/gems/ruby-2.3.0/gems/rack-1.6.4/lib/rack/server.rb:290:in `server'
from /usr/local/rvm/gems/ruby-2.3.0/gems/railties-4.2.6/lib/rails/commands/server.rb:125:in `print_boot_information'
from /usr/local/rvm/gems/ruby-2.3.0/gems/railties-4.2.6/lib/rails/commands/server.rb:75:in `start'
from /usr/local/rvm/gems/ruby-2.3.0/gems/railties-4.2.6/lib/rails/commands/commands_tasks.rb:80:in `block in server'
from /usr/local/rvm/gems/ruby-2.3.0/gems/railties-4.2.6/lib/rails/commands/commands_tasks.rb:75:in `tap'
from /usr/local/rvm/gems/ruby-2.3.0/gems/railties-4.2.6/lib/rails/commands/commands_tasks.rb:75:in `server'
from /usr/local/rvm/gems/ruby-2.3.0/gems/railties-4.2.6/lib/rails/commands/commands_tasks.rb:39:in `run_command!'
from /usr/local/rvm/gems/ruby-2.3.0/gems/railties-4.2.6/lib/rails/commands.rb:17:in `<top (required)>'
from /home/ubuntu/workspace/dublinapp/bin/rails:9:in `require'
from /home/ubuntu/workspace/dublinapp/bin/rails:9:in `<top (required)>'
from /usr/local/rvm/gems/ruby-2.3.0/gems/spring-1.6.4/lib/spring/client/rails.rb:28:in `load'
from /usr/local/rvm/gems/ruby-2.3.0/gems/spring-1.6.4/lib/spring/client/rails.rb:28:in `call'
from /usr/local/rvm/gems/ruby-2.3.0/gems/spring-1.6.4/lib/spring/client/command.rb:7:in `call'
from /usr/local/rvm/gems/ruby-2.3.0/gems/spring-1.6.4/lib/spring/client.rb:28:in `run'
from /usr/local/rvm/gems/ruby-2.3.0/gems/spring-1.6.4/bin/spring:49:in `<top (required)>'
from /usr/local/rvm/gems/ruby-2.3.0/gems/spring-1.6.4/lib/spring/binstub.rb:11:in `load'
from /usr/local/rvm/gems/ruby-2.3.0/gems/spring-1.6.4/lib/spring/binstub.rb:11:in `<top (required)>'
from /home/ubuntu/workspace/dublinapp/bin/spring:13:in `require'
from /home/ubuntu/workspace/dublinapp/bin/spring:13:in `<top (required)>'
from bin/rails:3:in `load'
from bin/rails:3:in `<main>'
I am getting the following error when starting my rails application in developemnt
bundle exec rails s -e development 3010
error:
Exiting
/usr/local/rvm/gems/ruby-2.2.1/gems/activesupport-4.0.6/lib/active_support/dependencies.rb:229:in `require': cannot load such file -- rack/handler/3010 (LoadError)
from /usr/local/rvm/gems/ruby-2.2.1/gems/activesupport-4.0.6/lib/active_support/dependencies.rb:229:in `block in require'
from /usr/local/rvm/gems/ruby-2.2.1/gems/activesupport-4.0.6/lib/active_support/dependencies.rb:214:in `load_dependency'
from /usr/local/rvm/gems/ruby-2.2.1/gems/activesupport-4.0.6/lib/active_support/dependencies.rb:229:in `require'
from /usr/local/rvm/gems/ruby-2.2.1/gems/rack-1.5.5/lib/rack/handler.rb:76:in `try_require'
from /usr/local/rvm/gems/ruby-2.2.1/gems/rack-1.5.5/lib/rack/handler.rb:16:in `get'
from /usr/local/rvm/gems/ruby-2.2.1/gems/rack-1.5.5/lib/rack/server.rb:268:in `server'
from /usr/local/rvm/gems/ruby-2.2.1/gems/railties-4.0.6/lib/rails/commands/server.rb:63:in `start'
from /usr/local/rvm/gems/ruby-2.2.1/gems/railties-4.0.6/lib/rails/commands.rb:76:in `block in <top (required)>'
from /usr/local/rvm/gems/ruby-2.2.1/gems/railties-4.0.6/lib/rails/commands.rb:71:in `tap'
from /usr/local/rvm/gems/ruby-2.2.1/gems/railties-4.0.6/lib/rails/commands.rb:71:in `<top (required)>'
from bin/rails:4:in `require'
from bin/rails:4:in `<main>'
Can't figure out the problem.
Have you tried with:
rails s -p 3010
By default, it works in development environment.
And if you still want to run with this statement, then try:
bundle exec rails s -e development -p 3010
You are missing -p here.
You can be using the below comment,
rails s -p whatever_you_want
Here -p indigates the port number of the app
Example: rails s -p 8030 // Here 8030 is the port number
If you want to run the rails app means, execute the below URL,
bundle exec rails s -e development -p 8030
Here -e refers the environment you are going run the rails app.
I'd like to migrate database to production environment on Heroku.
I typed the following code, however I got error. I have no idea what to do. I'm looking forward to your advice. Thank you for your kindness.
$ heroku run rake db:migrate
Running `rake db:migrate --trace` attached to terminal... up, run.2338
rake aborted!
LoadError: libruby.so.2.2: cannot open shared object file: No such file or directory - /app/vendor/bundle/ruby/2.2.0/gems/pg-0.18.2/lib/pg_ext.so
/app/vendor/bundle/ruby/2.2.0/gems/activesupport-4.2.1/lib/active_support/dependencies.rb:274:in `require'
/app/vendor/bundle/ruby/2.2.0/gems/activesupport-4.2.1/lib/active_support/dependencies.rb:274:in `block in require'
/app/vendor/bundle/ruby/2.2.0/gems/activesupport-4.2.1/lib/active_support/dependencies.rb:240:in `load_dependency'
/app/vendor/bundle/ruby/2.2.0/gems/activesupport-4.2.1/lib/active_support/dependencies.rb:274:in `require'
/app/vendor/bundle/ruby/2.2.0/gems/pg-0.18.2/lib/pg.rb:4:in `<top (required)>'
/app/vendor/bundle/ruby/2.2.0/gems/bundler-1.9.7/lib/bundler/runtime.rb:76:in `require'
/app/vendor/bundle/ruby/2.2.0/gems/bundler-1.9.7/lib/bundler/runtime.rb:76:in `block (2 levels) in require'
/app/vendor/bundle/ruby/2.2.0/gems/bundler-1.9.7/lib/bundler/runtime.rb:72:in `each'
/app/vendor/bundle/ruby/2.2.0/gems/bundler-1.9.7/lib/bundler/runtime.rb:72:in `block in require'
/app/vendor/bundle/ruby/2.2.0/gems/bundler-1.9.7/lib/bundler/runtime.rb:61:in `each'
/app/vendor/bundle/ruby/2.2.0/gems/bundler-1.9.7/lib/bundler/runtime.rb:61:in `require'
/app/vendor/bundle/ruby/2.2.0/gems/bundler-1.9.7/lib/bundler.rb:134:in `require'
/app/config/application.rb:7:in `<top (required)>'
/app/Rakefile:4:in `require'
/app/Rakefile:4:in `<top (required)>'
/app/vendor/ruby-2.2.2/lib/ruby/2.2.0/rake/rake_module.rb:28:in `load'
/app/vendor/ruby-2.2.2/lib/ruby/2.2.0/rake/rake_module.rb:28:in `load_rakefile'
/app/vendor/ruby-2.2.2/lib/ruby/2.2.0/rake/application.rb:689:in `raw_load_rakefile'
/app/vendor/ruby-2.2.2/lib/ruby/2.2.0/rake/application.rb:94:in `block in load_rakefile'
/app/vendor/ruby-2.2.2/lib/ruby/2.2.0/rake/application.rb:176:in `standard_exception_handling'
/app/vendor/ruby-2.2.2/lib/ruby/2.2.0/rake/application.rb:93:in `load_rakefile'
/app/vendor/ruby-2.2.2/lib/ruby/2.2.0/rake/application.rb:77:in `block in run'
/app/vendor/ruby-2.2.2/lib/ruby/2.2.0/rake/application.rb:176:in `standard_exception_handling'
/app/vendor/ruby-2.2.2/lib/ruby/2.2.0/rake/application.rb:75:in `run'
/app/bin/rake:8:in `<main>'
Have you tried running migration directly from the bash inside the heroku server? If not, try the following...
heroku run bash --app your_app_name_goes_here
bundle exec rake db:migrate
First line of code opens the bash command terminal and the second one migrates the db as usual.
This would not be the suggested solution. But, in case you DO NOT care about losing data in the database, you can try and reset the database first and try again. Again, don't do this unless you are willing to lose existing data!
heroku pg:reset DATABASE
heroku run rake db:migrate
However you can perform this via bash as before.
Hope this helps you out.
You can run a dyno in the background using heroku run:detached. Unlike heroku run, these dynos will send their output to your logs instead of your console window. You can use heroku logs to view the output from these commands:$ heroku run:detached rake db:migrate
Running rake db:migrate... up, run.2
Use 'heroku logs -p run.2' to view the log output.
I am trying to start rails server as a daemon using the -d switch. I have installed thin server and working on Ubuntu. If it is started as a normal process, it works, but when using the -d switch, it complains of a server pid file /tmp/pids/server.pid
Even if I delete the file and try to start the server with -d switch, it won't start. Please help.
The error says:
/usr/lib/ruby/gems/1.9.1/gems/bundler-1.3.5/lib/bundler/runtime.rb:33:in `block in setup': You have already activated daemons 1.1.9, but your Gemfile requires daemons 1.1.8. Using bundle exec may solve this. (Gem::LoadError)
from /usr/lib/ruby/gems/1.9.1/gems/bundler-1.3.5/lib/bundler/runtime.rb:19:in `setup'
from /usr/lib/ruby/gems/1.9.1/gems/bundler-1.3.5/lib/bundler.rb:120:in `setup'
from /usr/lib/ruby/gems/1.9.1/gems/bundler-1.3.5/lib/bundler/setup.rb:17:in `<top (required)>'
from /usr/local/lib/site_ruby/1.9.1/rubygems/core_ext/kernel_require.rb:110:in `require'
from /usr/local/lib/site_ruby/1.9.1/rubygems/core_ext/kernel_require.rb:110:in `rescue in require'
from /usr/local/lib/site_ruby/1.9.1/rubygems/core_ext/kernel_require.rb:35:in `require'
from /home/ubuntu/deploys/releases/20131001113746/config/boot.rb:6:in `<top (required)>'
from /usr/local/lib/site_ruby/1.9.1/rubygems/core_ext/kernel_require.rb:45:in `require'
from /usr/local/lib/site_ruby/1.9.1/rubygems/core_ext/kernel_require.rb:45:in `require'
from /home/ubuntu/deploys/releases/20131001113746/config/application.rb:1:in `<top (required)>'
from /usr/local/lib/site_ruby/1.9.1/rubygems/core_ext/kernel_require.rb:45:in `require'
from /usr/local/lib/site_ruby/1.9.1/rubygems/core_ext/kernel_require.rb:45:in `require'
from /home/ubuntu/deploys/releases/20131001113746/config/environment.rb:2:in `<top (required)>'
from /usr/local/lib/site_ruby/1.9.1/rubygems/core_ext/kernel_require.rb:45:in `require'
from /usr/local/lib/site_ruby/1.9.1/rubygems/core_ext/kernel_require.rb:45:in `require'
from /home/ubuntu/deploys/releases/20131001113746/config.ru:3:in `block in <main>'
from /usr/lib/ruby/gems/1.9.1/gems/rack-1.4.5/lib/rack/builder.rb:51:in `instance_eval'
from /usr/lib/ruby/gems/1.9.1/gems/rack-1.4.5/lib/rack/builder.rb:51:in `initialize'
from /home/ubuntu/deploys/releases/20131001113746/config.ru:1:in `new'
from /home/ubuntu/deploys/releases/20131001113746/config.ru:1:in `<main>'
from /usr/lib/ruby/gems/1.9.1/gems/thin-1.5.1/lib/rack/adapter/loader.rb:33:in `eval'
from /usr/lib/ruby/gems/1.9.1/gems/thin-1.5.1/lib/rack/adapter/loader.rb:33:in `load'
from /usr/lib/ruby/gems/1.9.1/gems/thin-1.5.1/lib/rack/adapter/loader.rb:42:in `for'
from /usr/lib/ruby/gems/1.9.1/gems/thin-1.5.1/lib/thin/controllers/controller.rb:169:in `load_adapter'
from /usr/lib/ruby/gems/1.9.1/gems/thin-1.5.1/lib/thin/controllers/controller.rb:73:in `start'
from /usr/lib/ruby/gems/1.9.1/gems/thin-1.5.1/lib/thin/runner.rb:187:in `run_command'
from /usr/lib/ruby/gems/1.9.1/gems/thin-1.5.1/lib/thin/runner.rb:152:in `run!'
from /usr/lib/ruby/gems/1.9.1/gems/thin-1.5.1/bin/thin:6:in `<top (required)>'
from /usr/bin/thin:23:in `load'
from /usr/bin/thin:23:in `<main>'
run the server using 'bundle exec' in the start like:
bundle exec rails s -d
Alternatively, your exception trace is stating a mismatch for the activated daemons gem. To fix this, set the version of daemons gem to be greater than (instead of equal to) 1.1.8 and try.