Here is Heroku logs
Local everything work just fine
2016-02-21T21:48:36.961997+00:00 app[web.1]: from /app/vendor/bundle/ruby/2.1.0/gems/railties-4.1.8/lib/rails.rb:11:in `<top (required)>'
2016-02-21T21:48:36.961999+00:00 app[web.1]: from /app/vendor/bundle/ruby/2.1.0/gems/railties-4.1.8/lib/rails/commands/server.rb:4:in `<top (required)>'
2016-02-21T21:48:36.962004+00:00 app[web.1]: from /app/vendor/bundle/ruby/2.1.0/gems/railties-4.1.8/lib/rails/commands/commands_tasks.rb:74:in `server'
2016-02-21T21:48:36.962000+00:00 app[web.1]: from /app/vendor/bundle/ruby/2.1.0/gems/railties-4.1.8/lib/rails/commands/commands_tasks.rb:128:in `require'
2016-02-21T21:48:36.962006+00:00 app[web.1]: from /app/vendor/bundle/ruby/2.1.0/gems/railties-4.1.8/lib/rails/commands/commands_tasks.rb:40:in `run_command!'
2016-02-21T21:48:37.595114+00:00 heroku[web.1]: State changed from starting to crashed
Ruby -v 2.1.5
Rails -v 4.1.8
Gemfile
source 'https://rubygems.org'
ruby '2.1.5'
# Bundle edge Rails instead: gem 'rails', github: 'rails/rails'
gem 'rails', '4.1.8'
# Use sqlite3 as the database for Active Record
group :development, :test do
gem 'sqlite3'
gem 'rspec-rails', '~> 3.0'
gem 'factory_girl_rails', '~> 4.0'
gem 'guard'
gem 'guard-rspec', require: false
gem 'spork-rails'
gem 'guard-spork'
gem 'wdm'
end
gem 'active_link_to'
# 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 'will_paginate', '~> 3.0.6'
# 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]
group :production do
gem 'rails_12factor'
gem 'pg'
end
gem 'devise'
gem 'cancancan'
gem 'stripe'
gem 'jruby-openssl'
gem 'highline', '~> 1.7', '>= 1.7.8'
gem 'byebug'
gem 'brakeman'
I'm new for Ror, So any help will be great
Working from Windows
StackOverflow asking me to add more details, but I have no idea what to add here, so I'm just writing this text
You certainly resently switch from sqlite to pg.
[heroku doc sayz] A crashed web dyno or a boot timeout on the web dyno will present this error.
Sqlite is a "dummy" db , it's permissive as hell you may have make tiny mistakes here and there , is it workin with pg locally?
Related
I am having trouble getting rails to run on my mac. This is the output that I get. It seems to be a problem with my packages or the Ruby or rvm version, but I don't know how to resolve it. I end up having to deploy to Heroku every time to test something.
Pauls-MacBook-Pro:heroku paulyang$ rails console
/Users/paulyang/.rvm/gems/ruby-2.3.3/gems/spring-2.0.1/lib/spring/application.rb:108:in `ensure in preload': undefined method `application' for Rails:Module (NoMethodError)
from /Users/paulyang/.rvm/gems/ruby-2.3.3/gems/spring-2.0.1/lib/spring/application.rb:112:in `preload'
from /Users/paulyang/.rvm/gems/ruby-2.3.3/gems/spring-2.0.1/lib/spring/application.rb:143:in `serve'
from /Users/paulyang/.rvm/gems/ruby-2.3.3/gems/spring-2.0.1/lib/spring/application.rb:131:in `block in run'
from /Users/paulyang/.rvm/gems/ruby-2.3.3/gems/spring-2.0.1/lib/spring/application.rb:125:in `loop'
from /Users/paulyang/.rvm/gems/ruby-2.3.3/gems/spring-2.0.1/lib/spring/application.rb:125:in `run'
from /Users/paulyang/.rvm/gems/ruby-2.3.3/gems/spring-2.0.1/lib/spring/application/boot.rb:19:in `<top (required)>'
from /usr/local/lib/ruby/site_ruby/2.3.0/rubygems/core_ext/kernel_require.rb:55:in `require'
from /usr/local/lib/ruby/site_ruby/2.3.0/rubygems/core_ext/kernel_require.rb:55:in `require'
from -e:1:in `<main>'
This is the gemfile I'm using for my Rails app:
source 'https://rubygems.org'
ruby '2.3.3'
gem 'sinatra'
# sinatra needs old tilt version: http://stackoverflow.com/questions/20648394/moduletemplates-uninitialized-constant-tiltcompilesite-nameerror-using
#https://groups.google.com/forum/#!topic/sinatrarb/mAtn7AZBVmY
gem 'tilt', '~> 1.4.1', group: :production
gem 'rest-client'
gem 'sequel'
gem 'sqlite3', group: :development
gem 'pg', '~> 0.18', group: :development
gem 'cowsay'
# Bundle edge Rails instead: gem 'rails', github: 'rails/rails'
gem 'rails', '4.2.5'
# Use postgresql as the database for Active Record
gem 'pg', '~> 0.18', group: :production
gem 'rails_12factor', group: :production
# Use SCSS for stylesheets
gem 'sass-rails', '~> 5.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
# Spring speeds up development by keeping your application running in the background. Read more: https://github.com/rails/spring
gem 'spring', group: :development
# Use ActiveModel has_secure_password
# gem 'bcrypt', '~> 3.1.7'
gem 'puma'
# Use Capistrano for deployment
# gem 'capistrano-rails', group: :development
# for auto-renewable subscription validation
# https://github.com/gabrielgarza/monza/blob/master/README.md
gem 'monza'
gem 'itunes-receipt'
Any help would be great.
I have a rails app that works on my development box, i am putting it up on heroku and everything works fine except whenever I run a rake db.. command it does the command but at the end it gives me the following error:
/app/vendor/bundle/ruby/2.4.0/gems/activesupport-5.0.2/lib/active_support/dependencies.rb:293:in require': cannot load such file -- /app/db:version (LoadError)
from /app/vendor/bundle/ruby/2.4.0/gems/activesupport-5.0.2/lib/active_support/dependencies.rb:293:inblock in require'
from /app/vendor/bundle/ruby/2.4.0/gems/activesupport-5.0.2/lib/active_support/dependencies.rb:259:in load_dependency'
from /app/vendor/bundle/ruby/2.4.0/gems/activesupport-5.0.2/lib/active_support/dependencies.rb:293:inrequire'
from /app/vendor/bundle/ruby/2.4.0/gems/railties-5.0.2/lib/rails/test_unit/test_requirer.rb:11:in
block in require_files'
from /app/vendor/bundle/ruby/2.4.0/gems/railties-5.0.2/lib/rails/test_unit/test_requirer.rb:10:in
each'
from /app/vendor/bundle/ruby/2.4.0/gems/railties-5.0.2/lib/rails/test_unit/test_requirer.rb:10:in
require_files'
from /app/vendor/bundle/ruby/2.4.0/gems/railties-5.0.2/lib/rails/test_unit/minitest_plugin.rb:86:inplugin_rails_init'
from /app/vendor/bundle/ruby/2.4.0/gems/minitest-5.10.1/lib/minitest.rb:80:in
block in init_plugins'
from /app/vendor/bundle/ruby/2.4.0/gems/minitest-5.10.1/lib/minitest.rb:78:in
each'
from /app/vendor/bundle/ruby/2.4.0/gems/minitest-5.10.1/lib/minitest.rb:78:in
init_plugins'
from /app/vendor/bundle/ruby/2.4.0/gems/minitest-5.10.1/lib/minitest.rb:129:in
run'
from /app/vendor/bundle/ruby/2.4.0/gems/railties-5.0.2/lib/rails/test_unit/minitest_plugin.rb:72:in run'
from /app/vendor/bundle/ruby/2.4.0/gems/minitest-5.10.1/lib/minitest.rb:62:in
block in autorun'
I have tried adding the gems railties and minitest into my gem file. I have deleted my heroku app and started from scratch again.
I have deleted the gemlock file and ran bundle install and bundle check
I have specified the ruby version in my gem file
Below is my gem file
source 'https://rubygems.org'
ruby "2.4.0"
gem 'rake', '~> 12.0'
gem 'railties', '~> 5.0', '>= 5.0.0.1'
gem 'minitest', '~> 5.10', '>= 5.10.1'
# Bundle edge Rails instead: gem 'rails', github: 'rails/rails'
gem 'rails', '~> 5.0.0', '>= 5.0.0.1'
# Use mysql as the database for Active Record
#gem 'mysql2', '>= 0.3.18', '< 0.5'
gem 'pg'
# Use Puma as the app server
gem 'puma', '~> 3.0'
# 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.2'
# 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 navigating your web application faster. Read more: https://github.com/turbolinks/turbolinks
gem 'turbolinks', '~> 5'
# Build JSON APIs with ease. Read more: https://github.com/rails/jbuilder
gem 'jbuilder', '~> 2.5'
# Use Redis adapter to run Action Cable in production gem 'redis', '~> 3.0' Use ActiveModel has_secure_password gem 'bcrypt', '~> 3.1.7' Use Capistrano for deployment gem 'capistrano-rails', group: :development
gem 'peddler', '~> 1.4.1'
gem 'nokogiri', '~> 1.6', '>= 1.6.8'
gem "pry-rails", group:"development"
gem 'chartkick', '~> 2.1', '>= 2.1.1'
gem "groupdate"
gem 'devise', '~> 4.2'
gem 'omniauth', '~> 1.3', '>= 1.3.1'
#required for devise
gem 'jquery-turbolinks'
#gem 'foundation-rails'
gem 'whenever', require: false
# export to excel
gem 'axlsx_rails', '~> 0.4.0'
gem 'axlsx', '2.1.0.pre'
gem 'roo'
gem 'rubyzip', '~> 1.1.0'
#gem 'zip-zip' #
#gem 'will_paginate', '~> 3.1.0'
#gem 'foundation-datepicker-rails'
gem 'will_paginate', '~> 3.1', '>= 3.1.5'
gem "wysiwyg-rails"
gem "font-awesome-rails"
gem 'stripe'
gem 'stripe_event', '~> 1.5', '>= 1.5.1'
#gem 'koudoku'
gem 'bootstrap-sass', '~> 3.3.6'
gem 'bootstrap-datepicker-rails'
gem "bootstrap-switch-rails"
gem 'elasticemail', git: "git://github.com/klebervirgilio/elasticemail.git"
gem 'rails_admin', '~> 1.1.1'
gem 'cancancan', '~> 1.10'
gem 'ransack', github: 'activerecord-hackery/ransack'
gem 'sidekiq'
#gem 'sinatra', github: 'sinatra/sinatra'
gem 'rails_12factor', group: :production
group :development, :test do
# Call 'byebug' anywhere in the code to stop execution and get a debugger console
gem 'byebug', platform: :mri
end
group :development do
# Access an IRB console on exception pages or by using <%= console %> anywhere in the code.
gem 'web-console'
gem 'listen', '~> 3.0.5' # was causing an error https://github.com/rails/rails/issues/24063 moved outside development group
# Spring speeds up development by keeping your application running in the background. Read more: https://github.com/rails/spring
gem 'spring'
gem 'spring-watcher-listen', '~> 2.0.0'
end
# Windows does not include zoneinfo files, so bundle the tzinfo-data gem
gem 'tzinfo-data', platforms: [:mingw, :mswin, :x64_mingw, :jruby]
I am at a loss, thank you
The corrent syntax to run rake tasks on Heroku is heroku run rake db:migrate. In your command you missed run
As I can see you are using rails 5 and have 12factor gem. rails_12factor gem is not required for rails 5 deployment on heroku.
Follow heroku rails 5 deployment documentation and it should solve the issue.
Hope it helps.
I'm trying to create a ruby on rails app which can be hosted on Openshift, but i encounter the following error when i try to use the rails g mongoid:config command through terminal. I've tried everything i found on stackoverflow but the error still persists! what am i doing wrong?
here is the error:
/home/themis/.rvm/gems/ruby-2.3.0/gems/activesupport-4.0.3/lib/active_support/values/time_zone.rb:282: warning: circular argument reference - now
/home/themis/rails4/config/application.rb:6:in `require': cannot load such file -- active_job/railtie (LoadError)
from /home/themis/rails4/config/application.rb:6:in `<top (required)>'
from /home/themis/.rvm/gems/ruby-2.3.0/gems/spring-1.7.2/lib/spring/application.rb:82:in `require'
from /home/themis/.rvm/gems/ruby-2.3.0/gems/spring-1.7.2/lib/spring/application.rb:82:in `preload'
from /home/themis/.rvm/gems/ruby-2.3.0/gems/spring-1.7.2/lib/spring/application.rb:143:in `serve'
from /home/themis/.rvm/gems/ruby-2.3.0/gems/spring-1.7.2/lib/spring/application.rb:131:in `block in run'
from /home/themis/.rvm/gems/ruby-2.3.0/gems/spring-1.7.2/lib/spring/application.rb:125:in `loop'
from /home/themis/.rvm/gems/ruby-2.3.0/gems/spring-1.7.2/lib/spring/application.rb:125:in `run'
from /home/themis/.rvm/gems/ruby-2.3.0/gems/spring-1.7.2/lib/spring/application/boot.rb:19:in `<top (required)>'
from /home/themis/.rvm/rubies/ruby-2.3.0/lib/ruby/site_ruby/2.3.0/rubygems/core_ext/kernel_require.rb:55:in `require'
from /home/themis/.rvm/rubies/ruby-2.3.0/lib/ruby/site_ruby/2.3.0/rubygems/core_ext/kernel_require.rb:55:in `require'
from -e:1:in `<main>'
and my Gemfile
source 'https://rubygems.org'
# Bundle edge Rails instead: gem 'rails', github: 'rails/rails'
gem 'rails', '4.0.3'
gem 'mongoid', git: 'https://github.com/mongoid/mongoid.git'
gem 'twitter-bootstrap-rails'
gem 'less-rails'
# Use Puma as the app server
gem 'puma', '~> 3.0'
# Use SCSS for stylesheets
gem 'sass-rails', '~> 4.0.0'
# Use Uglifier as compressor for JavaScript assets
gem 'uglifier', '>= 1.3.0'
# Use CoffeeScript for .coffee assets and views
gem 'coffee-rails', '~> 4.2'
# 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 navigating your web application faster. Read more: https://github.com/turbolinks/turbolinks
gem 'turbolinks', '~> 5'
# Build JSON APIs with ease. Read more: https://github.com/rails/jbuilder
gem 'jbuilder', '~> 2.5'
gem "rspec"
# Use Redis adapter to run Action Cable in production
# gem 'redis', '~> 3.0'
# Use ActiveModel has_secure_password
# gem 'bcrypt', '~> 3.1.7'
# 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', platform: :mri
end
group :development do
# Access an IRB console on exception pages or by using <%= console %> anywhere in the code.
gem 'web-console'
gem 'listen', '~> 3.0.5'
# Spring speeds up development by keeping your application running in the background. Read more: https://github.com/rails/spring
gem 'spring'
gem 'spring-watcher-listen', '~> 2.0.0'
end
# Windows does not include zoneinfo files, so bundle the tzinfo-data gem
gem 'tzinfo-data', platforms: [:mingw, :mswin, :x64_mingw, :jruby]
This is an ActiveSupport bug (thus a Rails bug).
Line 282 at activesupport-4.0.3/lib/active_support/values/time_zone.rb is
def parse(str, now=now)
# ...
end
And line 308 of the same file is
def now
# ...
end
The problem is at the default param now=now, which ruby struggles to understand whether the latter now is a method call or is just a local variable (the param itself).
If you modify the now=now to now=now(), then all is fine.
This bug is fixed in Rails 4.0.6.
I see many answers for this error when ruby version is =>2.2, but in my computer installed ruby version is [ruby 2.1.8p440]
I get this error when starting a server ( rails server ).
Gemfile
source 'http://rubygems.org'
# Bundle edge Rails instead: gem 'rails', github: 'rails/rails'
gem 'rails', '4.1.8'
# Use sqlite3 as the database for Active Record
#gem 'sqlite3'
gem 'pg', '0.18.2'
# Use SCSS for stylesheets
#gem 'sass-rails', '~> 4.0.3'
gem 'rails_12factor', group: :production
# 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
# 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]
gem 'sass-rails', '>= 3.3.4'
gem 'bootstrap-sass', '~> 3.3.6'
gem 'ckeditor', '4.1.6'
gem 'carrierwave', '0.10.0'
gem 'fog', '~> 1.3.1'
gem 'mini_magick', '4.5.1'
gem 'will_paginate', '3.1.0'
gem 'nokogiri', '>= 1.5.0'
# Windows does not include zoneinfo files, so bundle the tzinfo-data gem
gem 'tzinfo-data', platforms: [:mingw, :mswin]
You need to run bundle (or bundle install, but bundle does the same thing), to install the gems that are necessary for the app to run.
My ruby on rails server suddenly stopped working (Cloud9, Mac OS). This is the error msg I keep getting:
/usr/local/rvm/gems/ruby-2.2.1/gems/activesupport-4.1.0/lib/active_support/values/time_zone.rb:285: warning: circular argument reference - now
/usr/local/rvm/gems/ruby-2.2.1/gems/railties-4.1.0/lib/rails/commands/server.rb:34:in `parse!': missing argument: -p (OptionParser::MissingArgument)
from /usr/local/rvm/gems/ruby-2.2.1/gems/rack-1.5.5/lib/rack/server.rb:293:in `parse_options'
from /usr/local/rvm/gems/ruby-2.2.1/gems/rack-1.5.5/lib/rack/server.rb:184:in `options'
from /usr/local/rvm/gems/ruby-2.2.1/gems/railties-4.1.0/lib/rails/commands/server.rb:60:in `set_environment'
from /usr/local/rvm/gems/ruby-2.2.1/gems/railties-4.1.0/lib/rails/commands/server.rb:44:in `initialize'
from /usr/local/rvm/gems/ruby-2.2.1/gems/railties-4.1.0/lib/rails/commands/commands_tasks.rb:76:in `new'
from /usr/local/rvm/gems/ruby-2.2.1/gems/railties-4.1.0/lib/rails/commands/commands_tasks.rb:76:in `server'
from /usr/local/rvm/gems/ruby-2.2.1/gems/railties-4.1.0/lib/rails/commands/commands_tasks.rb:40:in `run_command!'
from /usr/local/rvm/gems/ruby-2.2.1/gems/railties-4.1.0/lib/rails/commands.rb:17:in `<top (required)>'
from bin/rails:4:in `require'
from bin/rails:4:in `<main>'
I've tried everything I could find on here but no luck. Apologies if this solution is on here somewhere. Here's my Gem file
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 the database for production
group :production do
gem 'pg'
gem 'rails_12factor'
end
# Use SCSS for stylesheets
gem 'sass-rails', '4.0.3'
# Use bootstrap library for styles
gem 'bootstrap-sass', '3.3.1'
# Use font awesome library for icons
gem 'font-awesome-sass', '4.2.0'
# 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
# Spring speeds up development by keeping your application running in the background. Read more: https://github.com/rails/spring
gem 'spring', group: :development
# Use devise for user auth
gem 'devise', '~>3.4.1'
# Use stripe for handling payments
gem 'stripe', '1.16.1'
# Use figaro to hide secret keys
gem 'figaro', '1.0.0'
# 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]
In cloud9 (as opposed to nitrous ;) you start your server with rails s -b $IP -p $PORT