error Undefinded method load_defaults when trying to deploy app on Heroku
Well, first I'll apologize for going as far as to having to make a question and finding the solution by myself 20 mins later.
While I'm not sure exactly what was malfunctioning, I did narrow it down to differing versions of Rails and other gems, as I was using old specific versions that said book , railstutorial.org/book , indicated me to use.
What I did was use all the default gems given by the command rails new for my Gemfile, without specifiying versions or anything other than the production group for the pg gem.
Gemfile code that fixed it:
source 'https://rubygems.org'
git_source(:github) do |repo_name|
repo_name = "#{repo_name}/#{repo_name}" unless repo_name.include?("/")
"https://github.com/#{repo_name}.git"
end
# Bundle edge Rails instead: gem 'rails', github: 'rails/rails'
gem 'rails', '~> 5.1.0'
# Use Puma as the app server
gem 'puma', '~> 3.7'
# Use SCSS for stylesheets
gem 'sass-rails', '~> 5.0'
# Use Uglifier as compressor for JavaScript assets
gem 'uglifier', '>= 1.3.0'
# See https://github.com/rails/execjs#readme for more supported runtimes
# gem 'therubyracer', platforms: :ruby
# Use CoffeeScript for .coffee assets and views
gem 'coffee-rails', '~> 4.2'
# 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
group :production do
gem 'pg'
end
group :development, :test do
# Use sqlite3 as the database for Active Record
gem 'sqlite3'
# Call 'byebug' anywhere in the code to stop execution and get a debugger console
gem 'byebug', platforms: [:mri, :mingw, :x64_mingw]
# Adds support for Capybara system testing and selenium driver
gem 'capybara', '~> 2.13.0'
gem 'selenium-webdriver'
end
group :development do
# Access an IRB console on exception pages or by using <%= console %> anywhere in the code.
gem 'web-console', '>= 3.3.0'
gem 'listen', '>= 3.0.5', '< 3.2'
# 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]
Bundle fails, undefined method `ruby' when deploying to heroku
The log says Fetching custom git buildpack
– it looks like you’re using a custom buildpack, which might explain why the old version of Bundler is being used.
Does
heroku config:get BUILDPACK_URL
show anything? You might just need to stop using the custom buildpack, try
heroku config:unset BUILDPACK_URL
to clear the config var and revert to the normal buildpack.
Heroku ruby-on-rails deployment undefined method `info' for nil:NilClass
Run the following (if you haven't already):
heroku run rake db:migrate
What does your UsersController look like?
What's the output of rake routes
?
Rails app working locally but not deploying to Heroku due to new method definition
This error:
ActiveRecord::RecordNotFound (Couldn't find Booth with 'id'=3):
does not indicate a problem with your code necessarily, but that something in your application is looking for a Booth with id 3, and your database (probably Heroku Postgres or similar) does not have a booth
record with id
of 3.
If I had to guess, I'd say you probably want to find a booth by it's user id, not a booth that has the same id as the user in session (which is what your method is doing).
Something like :
Booth.find_by_user(session[:user_id])
or similar (my Rails is rusty)
Rails Deployed on Heroku undefined method `[]' for nil:NilClass dealing with params
I'm terribly sorry I bothered you with this. For whatever reason, I had two controllers named very similarly. It was using the wrong one and I didn't realize it. I switched the code and now it works. Thanks for the input!
heroku error - NoMethodError (undefined method `updated?'
I googled the error message. Have you had a look at this thread: http://ruby-forum.com/topic/81719 They had a similar problem and have posted their solution/hack. Might be worth a try.
Related Topics
Rails - Aciverecord Use :Dependent => :Destroy on Condition
Rails: How to Check If a Column Has a Value
How to Render a String as an Erb File
Running into Issues with Rvm During Ruby Install (1.9.2)
Problems Keeping an Object in an Array, Ruby Issues and Rails Issues
Why Is Bigdecimal Returning a Weird Value
How to Use Variables in a Yaml File
How to Interleave Arrays of Different Length in Ruby
Ruby 1.9.2 - Read and Parse a Remote CSV
What Do 'Def +@' and 'Def -@' Mean
Check If Array of Integers Increments in Ruby
Rvm System-Wide Install Script Url Broken -- What Is Replacement
Displaying a Polygon with Gmaps4Rails
How to Update to Ruby 2.1.2 Using Rails 3.2.3
Activeadmin Custom Views Which Retain the Activeadmin Layout