I just installed carrierwave and have set my rails 4 app up to store images on Amazon s3 through fog. The app was working and deploying to Heroku with Carrierwave (but images were getting purged with dyno). After some initial issues I got it working on my localhost (as far as I could tell).
Now I am having trouble pushing the new version to Heroku. I have reset the DATABASE. Precompiled the assets and now trying to migrate the database. Below is the error I'm getting.
Running `rake db:migrate` attached to terminal... up, run.6517
rake aborted!
uninitialized constant Sprockets::Helpers
/app/app/uploaders/image_uploader.rb:12:in `<class:ImageUploader>'
/app/app/uploaders/image_uploader.rb:4:in `<top (required)>'
/app/vendor/bundle/ruby/2.0.0/gems/railties-4.0.0/lib/rails/engine.rb:465:in `block (2 levels) in eager_load!'
/app/vendor/bundle/ruby/2.0.0/gems/railties-4.0.0/lib/rails/engine.rb:464:in `each'
/app/vendor/bundle/ruby/2.0.0/gems/railties-4.0.0/lib/rails/engine.rb:464:in `block in eager_load!'
/app/vendor/bundle/ruby/2.0.0/gems/railties-4.0.0/lib/rails/engine.rb:462:in `each'
/app/vendor/bundle/ruby/2.0.0/gems/railties-4.0.0/lib/rails/engine.rb:462:in `eager_load!'
/app/vendor/bundle/ruby/2.0.0/gems/railties-4.0.0/lib/rails/engine.rb:347:in `eager_load!'
/app/vendor/bundle/ruby/2.0.0/gems/railties-4.0.0/lib/rails/application/finisher.rb:56:in `each'
/app/vendor/bundle/ruby/2.0.0/gems/railties-4.0.0/lib/rails/application/finisher.rb:56:in `block in <module:Finisher>'
/app/vendor/bundle/ruby/2.0.0/gems/railties-4.0.0/lib/rails/initializable.rb:30:in `instance_exec'
/app/vendor/bundle/ruby/2.0.0/gems/railties-4.0.0/lib/rails/initializable.rb:30:in `run'
/app/vendor/bundle/ruby/2.0.0/gems/railties-4.0.0/lib/rails/initializable.rb:55:in `block in run_initializers'
/app/vendor/bundle/ruby/2.0.0/gems/railties-4.0.0/lib/rails/initializable.rb:54:in `run_initializers'
/app/vendor/bundle/ruby/2.0.0/gems/railties-4.0.0/lib/rails/application.rb:215:in `initialize!'
/app/vendor/bundle/ruby/2.0.0/gems/railties-4.0.0/lib/rails/railtie/configurable.rb:30:in `method_missing'
/app/config/environment.rb:5:in `<top (required)>'
/app/vendor/bundle/ruby/2.0.0/gems/railties-4.0.0/lib/rails/application.rb:189:in `require_environment!'
/app/vendor/bundle/ruby/2.0.0/gems/railties-4.0.0/lib/rails/application.rb:249:in `block in run_tasks_blocks'
Tasks: TOP => db:migrate => environment
I have tried to include and not include Sprockets in the Uploader file and get the same error either way. I understand that Sprockets is no longer included in the master for Rails 4. I have now installed the sprockets-rails and sprockets-helper gems. I have also tried to require them at the top of the file (I don't understand this completely, but following this suggestion https://github.com/petebrowne/sprockets-helpers). Nothing has worked. Any suggestions about how I can go about resolving this. How do I initialize Sprockets::Helpers. Thanks.
I was making a pretty silly mistake. I had corrected files in my app and as committing the changes to the master, but I kept running the heroku run rake db:migrate command and getting the same error, so I didn't think I have resolved it yet. I had forgotten to push the new version to heroku! Hence the reason for still getting the same error.
Also, in case anyone else has a similar issue. Make sure you have fixed this:
https://github.com/carrierwaveuploader/carrierwave/issues/1020
Related
I am using Heroku Pipeline. My staging app is the parent app for my review apps so the environment variables are the same.
My staging app builds every time, no issues there. But, all of my review apps fail to build. The issue seems to be that the review app is missing the encryption key.
I've run heroku config:set RAILS_MASTER_KEY=##### -a my-app-staging-pr-99 to set the master key for the review app, but I still get the same build error.
Note:
- I'm using Rails 5.2.3 with credentials
- I have config.read_encrypted_secrets = true in my production.rb
- I have my `secret_key_base set in my credentials.yml
See the logs below:
Logs:
-----> Preparing app for Rails asset pipeline
Running: rake assets:precompile
rake aborted!
ActiveSupport::EncryptedFile::MissingKeyError: Missing encryption key to decrypt file with. Ask your team for your master key and write it to /tmp/build_0ef8f846f0fdc1456a3e91ed8dc095e6/config/master.key or put it in the ENV['RAILS_MASTER_KEY'].
/tmp/build_0ef8f846f0fdc1456a3e91ed8dc095e6/vendor/bundle/ruby/2.6.0/gems/activesupport-5.2.3/lib/active_support/encrypted_file.rb:96:in `handle_missing_key'
/tmp/build_0ef8f846f0fdc1456a3e91ed8dc095e6/vendor/bundle/ruby/2.6.0/gems/activesupport-5.2.3/lib/active_support/encrypted_file.rb:37:in `key'
/tmp/build_0ef8f846f0fdc1456a3e91ed8dc095e6/vendor/bundle/ruby/2.6.0/gems/activesupport-5.2.3/lib/active_support/encrypted_file.rb:41:in `read'
/tmp/build_0ef8f846f0fdc1456a3e91ed8dc095e6/vendor/bundle/ruby/2.6.0/gems/activesupport-5.2.3/lib/active_support/encrypted_configuration.rb:21:in `read'
/tmp/build_0ef8f846f0fdc1456a3e91ed8dc095e6/vendor/bundle/ruby/2.6.0/gems/activesupport-5.2.3/lib/active_support/encrypted_configuration.rb:33:in `config'
/tmp/build_0ef8f846f0fdc1456a3e91ed8dc095e6/vendor/bundle/ruby/2.6.0/gems/activesupport-5.2.3/lib/active_support/encrypted_configuration.rb:38:in `options'
/tmp/build_0ef8f846f0fdc1456a3e91ed8dc095e6/vendor/bundle/ruby/2.6.0/gems/activesupport-5.2.3/lib/active_support/core_ext/module/delegation.rb:271:in `method_missing'
/tmp/build_0ef8f846f0fdc1456a3e91ed8dc095e6/config/environments/production.rb:102:in `block in <main>'
/tmp/build_0ef8f846f0fdc1456a3e91ed8dc095e6/vendor/bundle/ruby/2.6.0/gems/railties-5.2.3/lib/rails/railtie.rb:216:in `instance_eval'
/tmp/build_0ef8f846f0fdc1456a3e91ed8dc095e6/vendor/bundle/ruby/2.6.0/gems/railties-5.2.3/lib/rails/railtie.rb:216:in `configure'
/tmp/build_0ef8f846f0fdc1456a3e91ed8dc095e6/config/environments/production.rb:1:in `<main>'
/tmp/build_0ef8f846f0fdc1456a3e91ed8dc095e6/vendor/bundle/ruby/2.6.0/gems/bootsnap-1.4.4/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:22:in `require'
/tmp/build_0ef8f846f0fdc1456a3e91ed8dc095e6/vendor/bundle/ruby/2.6.0/gems/bootsnap-1.4.4/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:22:in `block in require_with_bootsnap_lfi'
/tmp/build_0ef8f846f0fdc1456a3e91ed8dc095e6/vendor/bundle/ruby/2.6.0/gems/bootsnap-1.4.4/lib/bootsnap/load_path_cache/loaded_features_index.rb:92:in `register'
/tmp/build_0ef8f846f0fdc1456a3e91ed8dc095e6/vendor/bundle/ruby/2.6.0/gems/bootsnap-1.4.4/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:21:in `require_with_bootsnap_lfi'
/tmp/build_0ef8f846f0fdc1456a3e91ed8dc095e6/vendor/bundle/ruby/2.6.0/gems/bootsnap-1.4.4/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:30:in `require'
/tmp/build_0ef8f846f0fdc1456a3e91ed8dc095e6/vendor/bundle/ruby/2.6.0/gems/activesupport-5.2.3/lib/active_support/dependencies.rb:291:in `block in require'
/tmp/build_0ef8f846f0fdc1456a3e91ed8dc095e6/vendor/bundle/ruby/2.6.0/gems/activesupport-5.2.3/lib/active_support/dependencies.rb:257:in `load_dependency'
/tmp/build_0ef8f846f0fdc1456a3e91ed8dc095e6/vendor/bundle/ruby/2.6.0/gems/activesupport-5.2.3/lib/active_support/dependencies.rb:291:in `require'
/tmp/build_0ef8f846f0fdc1456a3e91ed8dc095e6/vendor/bundle/ruby/2.6.0/gems/railties-5.2.3/lib/rails/engine.rb:602:in `block (2 levels) in <class:Engine>'
/tmp/build_0ef8f846f0fdc1456a3e91ed8dc095e6/vendor/bundle/ruby/2.6.0/gems/railties-5.2.3/lib/rails/engine.rb:601:in `each'
/tmp/build_0ef8f846f0fdc1456a3e91ed8dc095e6/vendor/bundle/ruby/2.6.0/gems/railties-5.2.3/lib/rails/engine.rb:601:in `block in <class:Engine>'
/tmp/build_0ef8f846f0fdc1456a3e91ed8dc095e6/vendor/bundle/ruby/2.6.0/gems/railties-5.2.3/lib/rails/initializable.rb:32:in `instance_exec'
/tmp/build_0ef8f846f0fdc1456a3e91ed8dc095e6/vendor/bundle/ruby/2.6.0/gems/railties-5.2.3/lib/rails/initializable.rb:32:in `run'
/tmp/build_0ef8f846f0fdc1456a3e91ed8dc095e6/vendor/bundle/ruby/2.6.0/gems/railties-5.2.3/lib/rails/initializable.rb:61:in `block in run_initializers'
/tmp/build_0ef8f846f0fdc1456a3e91ed8dc095e6/vendor/bundle/ruby/2.6.0/gems/railties-5.2.3/lib/rails/initializable.rb:50:in `each'
/tmp/build_0ef8f846f0fdc1456a3e91ed8dc095e6/vendor/bundle/ruby/2.6.0/gems/railties-5.2.3/lib/rails/initializable.rb:50:in `tsort_each_child'
/tmp/build_0ef8f846f0fdc1456a3e91ed8dc095e6/vendor/bundle/ruby/2.6.0/gems/railties-5.2.3/lib/rails/initializable.rb:60:in `run_initializers'
/tmp/build_0ef8f846f0fdc1456a3e91ed8dc095e6/vendor/bundle/ruby/2.6.0/gems/railties-5.2.3/lib/rails/application.rb:361:in `initialize!'
/tmp/build_0ef8f846f0fdc1456a3e91ed8dc095e6/config/environment.rb:5:in `<main>'
/tmp/build_0ef8f846f0fdc1456a3e91ed8dc095e6/vendor/bundle/ruby/2.6.0/gems/bootsnap-1.4.4/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:22:in `require'
/tmp/build_0ef8f846f0fdc1456a3e91ed8dc095e6/vendor/bundle/ruby/2.6.0/gems/bootsnap-1.4.4/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:22:in `block in require_with_bootsnap_lfi'
/tmp/build_0ef8f846f0fdc1456a3e91ed8dc095e6/vendor/bundle/ruby/2.6.0/gems/bootsnap-1.4.4/lib/bootsnap/load_path_cache/loaded_features_index.rb:92:in `register'
/tmp/build_0ef8f846f0fdc1456a3e91ed8dc095e6/vendor/bundle/ruby/2.6.0/gems/bootsnap-1.4.4/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:21:in `require_with_bootsnap_lfi'
/tmp/build_0ef8f846f0fdc1456a3e91ed8dc095e6/vendor/bundle/ruby/2.6.0/gems/bootsnap-1.4.4/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:30:in `require'
/tmp/build_0ef8f846f0fdc1456a3e91ed8dc095e6/vendor/bundle/ruby/2.6.0/gems/activesupport-5.2.3/lib/active_support/dependencies.rb:291:in `block in require'
/tmp/build_0ef8f846f0fdc1456a3e91ed8dc095e6/vendor/bundle/ruby/2.6.0/gems/activesupport-5.2.3/lib/active_support/dependencies.rb:257:in `load_dependency'
/tmp/build_0ef8f846f0fdc1456a3e91ed8dc095e6/vendor/bundle/ruby/2.6.0/gems/activesupport-5.2.3/lib/active_support/dependencies.rb:291:in `require'
/tmp/build_0ef8f846f0fdc1456a3e91ed8dc095e6/vendor/bundle/ruby/2.6.0/gems/railties-5.2.3/lib/rails/application.rb:337:in `require_environment!'
/tmp/build_0ef8f846f0fdc1456a3e91ed8dc095e6/vendor/bundle/ruby/2.6.0/gems/railties-5.2.3/lib/rails/application.rb:520:in `block in run_tasks_blocks'
/tmp/build_0ef8f846f0fdc1456a3e91ed8dc095e6/vendor/bundle/ruby/2.6.0/gems/sprockets-rails-3.2.1/lib/sprockets/rails/task.rb:62:in `block (2 levels) in define'
/tmp/build_0ef8f846f0fdc1456a3e91ed8dc095e6/vendor/bundle/ruby/2.6.0/gems/rake-12.3.2/exe/rake:27:in `<top (required)>'
Tasks: TOP => environment
(See full trace by running task with --trace)
!
! Precompiling assets failed.
!
! Push rejected, failed to compile Ruby app.
! Push failed
app.json
{
"scripts": {
"postdeploy": "rails db:migrate"
}
}
I've been trying to fix this issue for weeks now and I've not been able to figure it out. I'm a newbie, so I apologise if I've missed something obvious here.
One way would be to Add RAILS_MASTER_KEY to environment variables of
your staging app. Then in your review apps, you can inherit it from
staging app.
Generate the key by executing
rake secret
in your project directory
You can use the following command to set the config variable on your staging app
heroku config:set RAILS_MASTER_KEY=<KEY GENERATED BY rake secret> -a my-app-staging
Now in your app.json, you can add
"env": {
"RAILS_MASTER_KEY": {
"required": true
}
In this way, every newly created review app will take its RAILS_MASTER_KEY from staging app.
Hope it helps.
Im trying to deploy my application in heroku. My app uses mongohq for the database. I have added the respective add-on to my app.
When deploying the app i get this error.
Cleaning up the bundler cache.
-----> Writing config/database.yml to read from DATABASE_URL
-----> Preparing app for Rails asset pipeline
Running: rake assets:precompile
** Notice: The native BSON extension was not loaded. **
For optimal performance, use of the BSON extension is recommended.
To enable the extension make sure ENV['BSON_EXT_DISABLED'] is not set
and run the following command:
gem install bson_ext
If you continue to receive this message after installing, make sure that
the bson_ext gem is in your load path.
rake aborted!
Invalid DATABASE_URL
(erb):9:in `rescue in <main>'
(erb):6:in `<main>'
/tmp/build_3o2y20a7ewhl/vendor/bundle/ruby/2.0.0/gems/railties-4.0.0/lib/rails/application/configuration.rb:106:in `database_configuration'
/tmp/build_3o2y20a7ewhl/vendor/bundle/ruby/2.0.0/gems/activerecord-4.0.0/lib/active_record/railtie.rb:174:in `block (2 levels) in <class:Railtie>'
/tmp/build_3o2y20a7ewhl/vendor/bundle/ruby/2.0.0/gems/activesupport-4.0.0/lib/active_support/lazy_load_hooks.rb:38:in `instance_eval'
/tmp/build_3o2y20a7ewhl/vendor/bundle/ruby/2.0.0/gems/activesupport-4.0.0/lib/active_support/lazy_load_hooks.rb:38:in `execute_hook'
/tmp/build_3o2y20a7ewhl/vendor/bundle/ruby/2.0.0/gems/activesupport-4.0.0/lib/active_support/lazy_load_hooks.rb:28:in `block in on_load'
/tmp/build_3o2y20a7ewhl/vendor/bundle/ruby/2.0.0/gems/activesupport-4.0.0/lib/active_support/lazy_load_hooks.rb:27:in `each'
/tmp/build_3o2y20a7ewhl/vendor/bundle/ruby/2.0.0/gems/activesupport-4.0.0/lib/active_support/lazy_load_hooks.rb:27:in `on_load'
/tmp/build_3o2y20a7ewhl/vendor/bundle/ruby/2.0.0/gems/activerecord-4.0.0/lib/active_record/railtie.rb:173:in `block in <class:Railtie>'
/tmp/build_3o2y20a7ewhl/vendor/bundle/ruby/2.0.0/gems/railties-4.0.0/lib/rails/initializable.rb:30:in `instance_exec'
/tmp/build_3o2y20a7ewhl/vendor/bundle/ruby/2.0.0/gems/railties-4.0.0/lib/rails/initializable.rb:30:in `run'
/tmp/build_3o2y20a7ewhl/vendor/bundle/ruby/2.0.0/gems/railties-4.0.0/lib/rails/initializable.rb:55:in `block in run_initializers'
/tmp/build_3o2y20a7ewhl/vendor/bundle/ruby/2.0.0/gems/railties-4.0.0/lib/rails/initializable.rb:54:in `run_initializers'
/tmp/build_3o2y20a7ewhl/vendor/bundle/ruby/2.0.0/gems/railties-4.0.0/lib/rails/application.rb:215:in `initialize!'
/tmp/build_3o2y20a7ewhl/vendor/bundle/ruby/2.0.0/gems/railties-4.0.0/lib/rails/railtie/configurable.rb:30:in `method_missing'
/tmp/build_3o2y20a7ewhl/config/environment.rb:5:in `<top (required)>'
/tmp/build_3o2y20a7ewhl/vendor/bundle/ruby/2.0.0/gems/activesupport-4.0.0/lib/active_support/dependencies.rb:228:in `require'
/tmp/build_3o2y20a7ewhl/vendor/bundle/ruby/2.0.0/gems/activesupport-4.0.0/lib/active_support/dependencies.rb:228:in `block in require'
/tmp/build_3o2y20a7ewhl/vendor/bundle/ruby/2.0.0/gems/activesupport-4.0.0/lib/active_support/dependencies.rb:213:in `load_dependency'
/tmp/build_3o2y20a7ewhl/vendor/bundle/ruby/2.0.0/gems/activesupport-4.0.0/lib/active_support/dependencies.rb:228:in `require'
/tmp/build_3o2y20a7ewhl/vendor/bundle/ruby/2.0.0/gems/railties-4.0.0/lib/rails/application.rb:189:in `require_environment!'
/tmp/build_3o2y20a7ewhl/vendor/bundle/ruby/2.0.0/gems/railties-4.0.0/lib/rails/application.rb:249:in `block in run_tasks_blocks'
/tmp/build_3o2y20a7ewhl/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.
!
! Push rejected, failed to compile Ruby/Rails app
It looks like is trying to write the DATABASE_URL in database.yml but i don't use one. I just use monogoid.yml and set the proper ENV var MONGOHQ_URL.
Do i need to setup any configuration so heroku can detect i'm using mongo as my database?
EDIT:
My mongoid.yml file looks like this.
production:
sessions:
default:
uri: <%= ENV['MONGOHQ_URL'] %>
I have read that article, i'm following those steps.
In case anyone is going through the same, i had in my application.rb a reference to active record that i needed to take away:
#require "active_record/railtie"
Also double check your environments files, in some cases you could have some active_record configuration code.
Hope it helps.
I can't seem to overcome the above error on heroku. I am running rails 3 with the mysql2 gem locally just fine, but this seems to break when moving to heroku.
First, I am using ClearDB.
Second, when I deploy and try to run heroku run rake db:migrate, heroku tells me I need to add the mysql gem and the activerecord-mysql-adapter. Why on earth would this happen when I am using mysql2?
Third, when I add mysql and the adapter to my project, and I get past the issue of heroku telling me I need those gems in my project. So, I run rake db:migrate again, and, now I get different error...
rake aborted!
database configuration specifies nonexistent mysql adapter
/app/vendor/bundle/ruby/1.9.1/gems/activerecord-3.2.9/lib/active_record/connection_adapters/abstract/connection_specification.rb:133:in `establish_connection'
/app/vendor/bundle/ruby/1.9.1/gems/activerecord-3.2.9/lib/active_record/railtie.rb:82:in `block (2 levels) in <class:Railtie>'
/app/vendor/bundle/ruby/1.9.1/gems/activesupport-3.2.9/lib/active_support/lazy_load_hooks.rb:36:in `instance_eval'
/app/vendor/bundle/ruby/1.9.1/gems/activesupport-3.2.9/lib/active_support/lazy_load_hooks.rb:36:in `execute_hook'
/app/vendor/bundle/ruby/1.9.1/gems/activesupport-3.2.9/lib/active_support/lazy_load_hooks.rb:26:in `block in on_load'
/app/vendor/bundle/ruby/1.9.1/gems/activesupport-3.2.9/lib/active_support/lazy_load_hooks.rb:25:in `each'
/app/vendor/bundle/ruby/1.9.1/gems/activesupport-3.2.9/lib/active_support/lazy_load_hooks.rb:25:in `on_load'
/app/vendor/bundle/ruby/1.9.1/gems/activerecord-3.2.9/lib/active_record/railtie.rb:74:in `block in <class:Railtie>'
/app/vendor/bundle/ruby/1.9.1/gems/railties-3.2.9/lib/rails/initializable.rb:30:in `instance_exec'
/app/vendor/bundle/ruby/1.9.1/gems/railties-3.2.9/lib/rails/initializable.rb:30:in `run'
/app/vendor/bundle/ruby/1.9.1/gems/railties-3.2.9/lib/rails/initializable.rb:55:in `block in run_initializers'
/app/vendor/bundle/ruby/1.9.1/gems/railties-3.2.9/lib/rails/initializable.rb:54:in `each'
/app/vendor/bundle/ruby/1.9.1/gems/railties-3.2.9/lib/rails/initializable.rb:54:in `run_initializers'
/app/vendor/bundle/ruby/1.9.1/gems/railties-3.2.9/lib/rails/application.rb:136:in `initialize!'
/app/vendor/bundle/ruby/1.9.1/gems/railties-3.2.9/lib/rails/railtie/configurable.rb:30:in `method_missing'
/app/config/environment.rb:5:in `<top (required)>'
/app/vendor/bundle/ruby/1.9.1/gems/activesupport-3.2.9/lib/active_support/dependencies.rb:251:in `require'
/app/vendor/bundle/ruby/1.9.1/gems/activesupport-3.2.9/lib/active_support/dependencies.rb:251:in `block in require'
/app/vendor/bundle/ruby/1.9.1/gems/activesupport-3.2.9/lib/active_support/dependencies.rb:236:in `load_dependency'
/app/vendor/bundle/ruby/1.9.1/gems/activesupport-3.2.9/lib/active_support/dependencies.rb:251:in `require'
/app/vendor/bundle/ruby/1.9.1/gems/railties-3.2.9/lib/rails/application.rb:103:in `require_environment!'
/app/vendor/bundle/ruby/1.9.1/gems/railties-3.2.9/lib/rails/application.rb:297:in `block (2 levels) in initialize_tasks'
When I check out my database.yml, I see that heroku has injected postgresql as the adapter, however the error outputed clearly states mysql... If anybody can help me on this issue I would really appreciate it. I don't know what to do with heroku...
Heroku injected postgresql because you failed to specify the heroku config property DATABASE_URL.
I give detailed instructions in this post - https://stackoverflow.com/a/17815729/1626020
But in a nutshell you need to set it using something like this:
heroku config:set DATABASE_URL=mysql2://bb06ca765fb123:71b6d123#us-cdbr-east-04.cleardb.com/heroku_703eded6aebc123?reconnect=true
Remember your database.yml is completely ignored by Heroku. That's right, ignored. The DATABASE_URL is all that matters.
Heroku uses Postgresql.
You could use mysql2 in your dev/test environments and postgresql in production (i.e. on Heroku).
group :development, :test do
gem 'mysql2'
end
group :production do
gem 'pg'
end
I'm trying to deploy my app on a Heroku server, but for some reason I can neither start my app nor run console. When I try to execute heroku run console, I get the following:
MacBook:threexortwo lander$ heroku run console
Running `console` attached to terminal... up, run.1
Rubber[ERROR]: Unable to read rubber configuration from /app/config/rubber/rubber.yml
(erb):301:in `<main>': undefined local variable or method `rubber_env' for main:Object (NameError)
from /usr/local/lib/ruby/1.9.1/erb.rb:753:in `eval'
from /usr/local/lib/ruby/1.9.1/erb.rb:753:in `result'
from /app/vendor/bundle/ruby/1.9.1/gems/rubber-2.1.2/lib/rubber/environment.rb:39:in `read_config'
from /app/vendor/bundle/ruby/1.9.1/gems/rubber-2.1.2/lib/rubber/environment.rb:30:in `block in initialize'
from /app/vendor/bundle/ruby/1.9.1/gems/rubber-2.1.2/lib/rubber/environment.rb:30:in `each'
from /app/vendor/bundle/ruby/1.9.1/gems/rubber-2.1.2/lib/rubber/environment.rb:30:in `initialize'
from /app/vendor/bundle/ruby/1.9.1/gems/rubber-2.1.2/lib/rubber/configuration.rb:37:in `new'
from /app/vendor/bundle/ruby/1.9.1/gems/rubber-2.1.2/lib/rubber/configuration.rb:37:in `initialize'
from /app/vendor/bundle/ruby/1.9.1/gems/rubber-2.1.2/lib/rubber/configuration.rb:14:in `new'
from /app/vendor/bundle/ruby/1.9.1/gems/rubber-2.1.2/lib/rubber/configuration.rb:14:in `get_configuration'
from /app/vendor/bundle/ruby/1.9.1/gems/rubber-2.1.2/lib/rubber/configuration.rb:22:in `rubber_env'
from /app/vendor/bundle/ruby/1.9.1/gems/rubber-2.1.2/lib/rubber.rb:53:in `config'
from /app/vendor/bundle/ruby/1.9.1/gems/rubber-2.1.2/lib/rubber.rb:31:in `initialize'
from /app/vendor/bundle/ruby/1.9.1/gems/rubber-2.1.2/lib/rubber/railtie.rb:9:in `block in <class:Railtie>'
from /app/vendor/bundle/ruby/1.9.1/gems/activesupport-3.2.6/lib/active_support/lazy_load_hooks.rb:34:in `call'
from /app/vendor/bundle/ruby/1.9.1/gems/activesupport-3.2.6/lib/active_support/lazy_load_hooks.rb:34:in `execute_hook'
from /app/vendor/bundle/ruby/1.9.1/gems/activesupport-3.2.6/lib/active_support/lazy_load_hooks.rb:43:in `block in run_load_hooks'
from /app/vendor/bundle/ruby/1.9.1/gems/activesupport-3.2.6/lib/active_support/lazy_load_hooks.rb:42:in `each'
from /app/vendor/bundle/ruby/1.9.1/gems/activesupport-3.2.6/lib/active_support/lazy_load_hooks.rb:42:in `run_load_hooks'
from /app/vendor/bundle/ruby/1.9.1/gems/railties-3.2.6/lib/rails/application.rb:67:in `inherited'
from /app/config/application.rb:13:in `<module:Threexortwo>'
from /app/config/application.rb:12:in `<top (required)>'
from /app/vendor/bundle/ruby/1.9.1/gems/railties-3.2.6/lib/rails/commands.rb:39:in `require'
from /app/vendor/bundle/ruby/1.9.1/gems/railties-3.2.6/lib/rails/commands.rb:39:in `<top (required)>'
from script/rails:6:in `require'
from script/rails:6:in `<main>'
Previously, I was playing with an Amazon EC2 server, and was using rubber. Before doing anything with rubber, I created a backup (pretty much just zipped the project), then afterwards deleted the vulcanized version, restored the old one, and uninstalled `rubber. When I run my server app locally, I don't encounter this issue, and I only get it when messing with Heroku.
It looks like rubber is still in your gemfile. Heroku reads in your gemfile and installs all of the gems listed.
Try removing it.
I made some changes in my local development version of my app.
Then I uploaded everything using git the usual thing.
To push my changes to the database I used:
heroku db:push
I get this error on my terminal:
Sending schema
/Users/AM/.rvm/gems/ruby-1.9.2-p290/gems/sequel-3.20.0/lib/sequel/adapters/postgres.rb:175:in `async_exec': PG::Error: ERROR: permission denied for relation temp_listings (Sequel::DatabaseError)
from /Users/AM/.rvm/gems/ruby-1.9.2-p290/gems/sequel-3.20.0/lib/sequel/adapters/postgres.rb:175:in `block (2 levels) in execute'
from /Users/AM/.rvm/gems/ruby-1.9.2-p290/gems/sequel-3.20.0/lib/sequel/database/logging.rb:28:in `log_yield'
from /Users/AM/.rvm/gems/ruby-1.9.2-p290/gems/sequel-3.20.0/lib/sequel/adapters/postgres.rb:175:in `block in execute'
from /Users/AM/.rvm/gems/ruby-1.9.2-p290/gems/sequel-3.20.0/lib/sequel/adapters/postgres.rb:158:in `check_disconnect_errors'
from /Users/AM/.rvm/gems/ruby-1.9.2-p290/gems/sequel-3.20.0/lib/sequel/adapters/postgres.rb:175:in `execute'
from /Users/AM/.rvm/gems/ruby-1.9.2-p290/gems/sequel-3.20.0/lib/sequel/adapters/postgres.rb:240:in `block (2 levels) in execute'
from /Users/AM/.rvm/gems/ruby-1.9.2-p290/gems/sequel-3.20.0/lib/sequel/connection_pool/threaded.rb:84:in `hold'
from /Users/AM/.rvm/gems/ruby-1.9.2-p290/gems/sequel-3.20.0/lib/sequel/database/connecting.rb:226:in `synchronize'
from /Users/AM/.rvm/gems/ruby-1.9.2-p290/gems/sequel-3.20.0/lib/sequel/adapters/postgres.rb:240:in `block in execute'
from /Users/AM/.rvm/gems/ruby-1.9.2-p290/gems/sequel-3.20.0/lib/sequel/adapters/postgres.rb:261:in `check_database_errors'
from /Users/AM/.rvm/gems/ruby-1.9.2-p290/gems/sequel-3.20.0/lib/sequel/adapters/postgres.rb:238:in `execute'
from /Users/AM/.rvm/gems/ruby-1.9.2-p290/gems/sequel-3.20.0/lib/sequel/dataset/actions.rb:541:in `execute'
from /Users/AM/.rvm/gems/ruby-1.9.2-p290/gems/sequel-3.20.0/lib/sequel/adapters/postgres.rb:319:in `fetch_rows'
from /Users/AM/.rvm/gems/ruby-1.9.2-p290/gems/sequel-3.20.0/lib/sequel/dataset/actions.rb:123:in `each'
from /Users/AM/.rvm/gems/ruby-1.9.2-p290/gems/sequel-3.20.0/lib/sequel/dataset/actions.rb:449:in `single_record'
from /Users/AM/.rvm/gems/ruby-1.9.2-p290/gems/sequel-3.20.0/lib/sequel/dataset/actions.rb:457:in `single_value'
from /Users/AM/.rvm/gems/ruby-1.9.2-p290/gems/sequel-3.20.0/lib/sequel/dataset/actions.rb:202:in `get'
from /Users/AM/.rvm/gems/ruby-1.9.2-p290/gems/sequel-3.20.0/lib/sequel/dataset/actions.rb:96:in `count'
from /Users/AM/.rvm/gems/ruby-1.9.2-p290/gems/taps-0.3.24/lib/taps/operation.rb:570:in `block in fetch_local_tables_info'
from /Users/AM/.rvm/gems/ruby-1.9.2-p290/gems/taps-0.3.24/lib/taps/operation.rb:569:in `each'
from /Users/AM/.rvm/gems/ruby-1.9.2-p290/gems/taps-0.3.24/lib/taps/operation.rb:569:in `fetch_local_tables_info'
from /Users/AM/.rvm/gems/ruby-1.9.2-p290/gems/taps-0.3.24/lib/taps/operation.rb:551:in `local_tables_info'
from /Users/AM/.rvm/gems/ruby-1.9.2-p290/gems/taps-0.3.24/lib/taps/operation.rb:556:in `tables'
from /Users/AM/.rvm/gems/ruby-1.9.2-p290/gems/taps-0.3.24/lib/taps/operation.rb:439:in `push_schema'
from /Users/AM/.rvm/gems/ruby-1.9.2-p290/gems/taps-0.3.24/lib/taps/operation.rb:407:in `block in run'
from /Users/AM/.rvm/gems/ruby-1.9.2-p290/gems/taps-0.3.24/lib/taps/operation.rb:203:in `call'
from /Users/AM/.rvm/gems/ruby-1.9.2-p290/gems/taps-0.3.24/lib/taps/operation.rb:203:in `catch_errors'
from /Users/AM/.rvm/gems/ruby-1.9.2-p290/gems/taps-0.3.24/lib/taps/operation.rb:405:in `run'
from /Users/AM/.rvm/gems/ruby-1.9.2-p290/gems/taps-0.3.24/lib/taps/cli.rb:172:in `clientxfer'
from /Users/AM/.rvm/gems/ruby-1.9.2-p290/gems/heroku-2.25.0/lib/heroku/command/db.rb:194:in `taps_client'
from /Users/AM/.rvm/gems/ruby-1.9.2-p290/gems/heroku-2.25.0/lib/heroku/command/db.rb:35:in `push'
from /Users/AM/.rvm/gems/ruby-1.9.2-p290/gems/heroku-2.25.0/lib/heroku/command.rb:148:in `run'
from /Users/AM/.rvm/gems/ruby-1.9.2-p290/gems/heroku-2.25.0/lib/heroku/cli.rb:9:in `start'
from /Users/AM/.rvm/gems/ruby-1.9.2-p290/gems/heroku-2.25.0/bin/heroku:16:in `<top (required)>'
from /Users/AM/.rvm/gems/ruby-1.9.2-p290/bin/heroku:19:in `load'
from /Users/AM/.rvm/gems/ruby-1.9.2-p290/bin/heroku:19:in `<main>'
Any idea how to fix this or what Im doing wrong?
I already tried running the following:
heroku pg:reset
then tried again
heroku db:push
that didnt work so I tried this
heroku run rake db:migrate
that didnt work either
so I created a new instance of my app and pushed it. Getting the same error
While convenient, using taps (what db:push/pull uses) may not replicate your data exactly and may run into errors for larger transfers. To import or export data from your production system, we highly recommend using pgbackups instead. http://devcenter.heroku.com/articles/pgbackups