Hello developers I am trouble
When I write the command:
bundle exec rake assets:precompile
the command return me :
DEPRECATION WARNING: You have Rails 2.3-style plugins in vendor/plugins! Support for these plugins will be removed in Rails 4.0. Move them out and bundle them in your Gemfile, or fold them in to your app as lib/myplugin/* and config/initializers/myplugin.rb. See the release notes for more on this: http://weblog.rubyonrails.org/2012/1/4/rails-3-2-0-rc2-has-been-released. (called from <top (required)> at /var/www/nubedianWebSite/Rakefile:7)
/usr/local/rvm/rubies/ruby-1.9.3-p392/bin/ruby /var/www/nubedianWebSite/vendor/bundle/ruby/1.9.1/bin/rake assets:precompile:all RAILS_ENV=production RAILS_GROUPS=assets
DEPRECATION WARNING: You have Rails 2.3-style plugins in vendor/plugins! Support for these plugins will be removed in Rails 4.0. Move them out and bundle them in your Gemfile, or fold them in to your app as lib/myplugin/* and config/initializers/myplugin.rb. See the release notes for more on this: http://weblog.rubyonrails.org/2012/1/4/rails-3-2-0-rc2-has-been-released. (called from <top (required)> at /var/www/nubedianWebSite/Rakefile:7)
rake aborted!
Please install the sqlite3 adapter: `gem install activerecord-sqlite3-adapter` (sqlite3 is not part of the bundle. Add it to Gemfile.)
/usr/local/rvm/gems/ruby-1.9.3-p392/gems/bundler-1.3.4/lib/bundler/rubygems_integration.rb:214:in `block in replace_gem'
/var/www/nubedianWebSite/vendor/bundle/ruby/1.9.1/gems/activerecord-3.2.6/lib/active_record/connection_adapters/sqlite3_adapter.rb:3:in `<top (required)>'
/var/www/nubedianWebSite/vendor/bundle/ruby/1.9.1/gems/activesupport-3.2.6/lib/active_support/dependencies.rb:251:in `require'
/var/www/nubedianWebSite/vendor/bundle/ruby/1.9.1/gems/activesupport-3.2.6/lib/active_support/dependencies.rb:251:in `block in require'
/var/www/nubedianWebSite/vendor/bundle/ruby/1.9.1/gems/activesupport-3.2.6/lib/active_support/dependencies.rb:236:in `load_dependency'
/var/www/nubedianWebSite/vendor/bundle/ruby/1.9.1/gems/activesupport-3.2.6/lib/active_support/dependencies.rb:251:in `require'
/var/www/nubedianWebSite/vendor/bundle/ruby/1.9.1/gems/activerecord-3.2.6/lib/active_record/connection_adapters/abstract/connection_specification.rb:48:in `resolve_hash_connection'
/var/www/nubedianWebSite/vendor/bundle/ruby/1.9.1/gems/activerecord-3.2.6/lib/active_record/connection_adapters/abstract/connection_specification.rb:39:in `resolve_string_connection'
/var/www/nubedianWebSite/vendor/bundle/ruby/1.9.1/gems/activerecord-3.2.6/lib/active_record/connection_adapters/abstract/connection_specification.rb:23:in `spec'
/var/www/nubedianWebSite/vendor/bundle/ruby/1.9.1/gems/activerecord-3.2.6/lib/active_record/connection_adapters/abstract/connection_specification.rb:127:in `establish_connection'
/var/www/nubedianWebSite/vendor/bundle/ruby/1.9.1/gems/activerecord-3.2.6/lib/active_record/railtie.rb:82:in `block (2 levels) in <class:Railtie>'
/var/www/nubedianWebSite/vendor/bundle/ruby/1.9.1/gems/activesupport-3.2.6/lib/active_support/lazy_load_hooks.rb:36:in `instance_eval'
/var/www/nubedianWebSite/vendor/bundle/ruby/1.9.1/gems/activesupport-3.2.6/lib/active_support/lazy_load_hooks.rb:36:in `execute_hook'
/var/www/nubedianWebSite/vendor/bundle/ruby/1.9.1/gems/activesupport-3.2.6/lib/active_support/lazy_load_hooks.rb:26:in `block in on_load'
/var/www/nubedianWebSite/vendor/bundle/ruby/1.9.1/gems/activesupport-3.2.6/lib/active_support/lazy_load_hooks.rb:25:in `each'
/var/www/nubedianWebSite/vendor/bundle/ruby/1.9.1/gems/activesupport-3.2.6/lib/active_support/lazy_load_hooks.rb:25:in `on_load'
/var/www/nubedianWebSite/vendor/bundle/ruby/1.9.1/gems/activerecord-3.2.6/lib/active_record/railtie.rb:74:in `block in <class:Railtie>'
/var/www/nubedianWebSite/vendor/bundle/ruby/1.9.1/gems/railties-3.2.6/lib/rails/initializable.rb:30:in `instance_exec'
/var/www/nubedianWebSite/vendor/bundle/ruby/1.9.1/gems/railties-3.2.6/lib/rails/initializable.rb:30:in `run'
/var/www/nubedianWebSite/vendor/bundle/ruby/1.9.1/gems/railties-3.2.6/lib/rails/initializable.rb:55:in `block in run_initializers'
/var/www/nubedianWebSite/vendor/bundle/ruby/1.9.1/gems/railties-3.2.6/lib/rails/initializable.rb:54:in `each'
/var/www/nubedianWebSite/vendor/bundle/ruby/1.9.1/gems/railties-3.2.6/lib/rails/initializable.rb:54:in `run_initializers'
/var/www/nubedianWebSite/vendor/bundle/ruby/1.9.1/gems/railties-3.2.6/lib/rails/application.rb:136:in `initialize!'
/var/www/nubedianWebSite/vendor/bundle/ruby/1.9.1/gems/railties-3.2.6/lib/rails/railtie/configurable.rb:30:in `method_missing'
/var/www/nubedianWebSite/config/environment.rb:6:in `<top (required)>'
/var/www/nubedianWebSite/vendor/bundle/ruby/1.9.1/gems/activesupport-3.2.6/lib/active_support/dependencies.rb:251:in `require'
/var/www/nubedianWebSite/vendor/bundle/ruby/1.9.1/gems/activesupport-3.2.6/lib/active_support/dependencies.rb:251:in `block in require'
/var/www/nubedianWebSite/vendor/bundle/ruby/1.9.1/gems/activesupport-3.2.6/lib/active_support/dependencies.rb:236:in `load_dependency'
/var/www/nubedianWebSite/vendor/bundle/ruby/1.9.1/gems/activesupport-3.2.6/lib/active_support/dependencies.rb:251:in `require'
/var/www/nubedianWebSite/vendor/bundle/ruby/1.9.1/gems/railties-3.2.6/lib/rails/application.rb:103:in `require_environment!'
/var/www/nubedianWebSite/vendor/bundle/ruby/1.9.1/gems/railties-3.2.6/lib/rails/application.rb:292:in `block (2 levels) in initialize_tasks'
/var/www/nubedianWebSite/vendor/bundle/ruby/1.9.1/gems/actionpack-3.2.6/lib/sprockets/assets.rake:93:in `block (2 levels) in <top (required)>'
/var/www/nubedianWebSite/vendor/bundle/ruby/1.9.1/gems/actionpack-3.2.6/lib/sprockets/assets.rake:60:in `block (3 levels) in <top (required)>'
Tasks: TOP => environment
(See full trace by running task with --trace)
rake aborted!
Command failed with status (1): [/usr/local/rvm/rubies/ruby-1.9.3-p392/bin/...]
/var/www/nubedianWebSite/vendor/bundle/ruby/1.9.1/gems/actionpack-3.2.6/lib/sprockets/assets.rake:12:in `ruby_rake_task'
/var/www/nubedianWebSite/vendor/bundle/ruby/1.9.1/gems/actionpack-3.2.6/lib/sprockets/assets.rake:21:in `invoke_or_reboot_rake_task'
/var/www/nubedianWebSite/vendor/bundle/ruby/1.9.1/gems/actionpack-3.2.6/lib/sprockets/assets.rake:29:in `block (2 levels) in <top (required)>'
Tasks: TOP => assets:precompile
(See full trace by running task with --trace)
I don´t know how I can fix it.
I hope yours answers soon.
thanks for all.
Antonio
Your output says
Please install the sqlite3 adapter: `gem install activerecord-sqlite3-adapter` (sqlite3 is not part of the bundle. Add it to Gemfile.)
Have you got sqlite3 in your Gemfile?
If not - edit your "Gemfile" and add the line:
gem 'sqlite3'
Make sure to run "bundle install" after adding it.
answer is mentioned in your log, Please install the sqlite3 adapter, run the following command
gem install activerecord-sqlite3-adapter
Related
I'm trying to install the Redmine Agile plugin on a server running Ubuntu 16.04.4. I have a setup with mod_passenger and Apache similar to what's described in this Stack Overflow answer. I seem to be playing error whack-a-mole and have asked a question previously on this. I'm executing these comamnds as www-data.
Here's my console output.
www-data#host:/usr/share/redmine/public/plugins/redmine_agile$ bundle exec rake redmine:plugins NAME=redmine_agile RAILS_ENV=production
`/home/ubuntu` is not writable.
Bundler will use `/tmp/bundler/home/ubuntu' as your home directory temporarily.
(in /usr/share/redmine)
rake aborted!
NameError: uninitialized constant ActionDispatch::XmlParamsParser
/usr/share/redmine/config/application.rb:55:in `<class:Application>'
/usr/share/redmine/config/application.rb:8:in `<module:RedmineApp>'
/usr/share/redmine/config/application.rb:7:in `<top (required)>'
/usr/share/redmine/Rakefile:4:in `require'
/usr/share/redmine/Rakefile:4:in `<top (required)>'
/var/lib/gems/2.3.0/gems/rake-12.3.2/exe/rake:27:in `<top (required)>'
(See full trace by running task with --trace)
If I try to run the command from /usr/share/redmine per this answer, I get a different error.
www-data#host:/usr/share/redmine/public$ bundle exec rake redmine:plugins NAME=redmine_agile RAILS_ENV=production
`/home/ubuntu` is not writable.
Bundler will use `/tmp/bundler/home/ubuntu' as your home directory temporarily.
(in /usr/share/redmine)
rake aborted!
Gem::LoadError: Specified 'mysql2' for database adapter, but the gem is not loaded. Add `gem 'mysql2'` to your Gemfile (and ensure its version is at the minimum required by ActiveRecord).
/usr/share/redmine/lib/plugins/acts_as_activity_provider/init.rb:2:in `block in <top (required)>'
/usr/share/redmine/config/initializers/00-core_plugins.rb:12:in `eval'
/usr/share/redmine/config/initializers/00-core_plugins.rb:12:in `block in <top (required)>'
/usr/share/redmine/config/initializers/00-core_plugins.rb:2:in `each'
/usr/share/redmine/config/initializers/00-core_plugins.rb:2:in `<top (required)>'
/usr/share/redmine/config/environment.rb:14:in `<top (required)>'
/usr/share/redmine/lib/tasks/redmine.rake:52:in `block (2 levels) in <top (required)>'
/var/lib/gems/2.3.0/gems/rake-12.3.2/exe/rake:27:in `<top (required)>'
Caused by:
Gem::LoadError: mysql2 is not part of the bundle. Add it to your Gemfile.
/var/lib/gems/2.3.0/gems/bundler-1.16.2/lib/bundler/rubygems_integration.rb:408:in `block (2 levels) in replace_gem'
/usr/share/redmine/lib/plugins/acts_as_activity_provider/init.rb:2:in `block in <top (required)>'
/usr/share/redmine/config/initializers/00-core_plugins.rb:12:in `eval'
/usr/share/redmine/config/initializers/00-core_plugins.rb:12:in `block in <top (required)>'
/usr/share/redmine/config/initializers/00-core_plugins.rb:2:in `each'
/usr/share/redmine/config/initializers/00-core_plugins.rb:2:in `<top (required)>'
/usr/share/redmine/config/environment.rb:14:in `<top (required)>'
/usr/share/redmine/lib/tasks/redmine.rake:52:in `block (2 levels) in <top (required)>'
/var/lib/gems/2.3.0/gems/rake-12.3.2/exe/rake:27:in `<top (required)>'
Tasks: TOP => redmine:plugins:migrate => environment
(See full trace by running task with --trace)
In both directories, gem list mysql gives the same output.
www-data#host:/usr/share/redmine/public/plugins/redmine_agile$ gem list mysql
*** LOCAL GEMS ***
mysql2 (0.5.2, 0.4.3)
www-data#host:/usr/share/redmine/public/plugins/redmine_agile$ cd ../..
www-data#host:/usr/share/redmine/public$ gem list mysql
*** LOCAL GEMS ***
mysql2 (0.5.2, 0.4.3)
Here's the Gemfile in the plugin directory.
www-data#host:/usr/share/redmine/public/plugins/redmine_agile$ cat Gemfile
gem "redmine_crm"
gem "mysql2"
How can I resolve this exception and get the agile plugin working? Thanks!
I just upgraded my OS X from 10.7.5 to 10.9.3.
I've done the following:
- Upgraded ruby to 2.1.2 (and using it)
- bundle install succeeded
- installed postgres, server running.
$rails server -p 5000
works (the server runs)
However, when I do
$rake db:migrate
It gives me the following error:
rake aborted!
NameError: uninitialized constant AbstractController::Error
/Users/ppd/.rvm/gems/ruby-2.1.2/gems/actionpack-4.1.1/lib/abstract_controller/rendering.rb:8:in `<module:AbstractController>'
/Users/ppd/.rvm/gems/ruby-2.1.2/gems/actionpack-4.1.1/lib/abstract_controller/rendering.rb:7:in `<top (required)>'
/Users/ppd/.rvm/gems/ruby-2.1.2/gems/haml-3.1.6/lib/haml/helpers/rails_323_textarea_fix.rb:1:in `<top (required)>'
/Users/ppd/.rvm/gems/ruby-2.1.2/gems/haml-3.1.6/lib/haml/helpers/action_view_mods.rb:260:in `<top (required)>'
/Users/ppd/.rvm/gems/ruby-2.1.2/gems/haml-3.1.6/lib/haml/template.rb:3:in `<top (required)>'
/Users/ppd/.rvm/gems/ruby-2.1.2/gems/haml-3.1.6/lib/haml.rb:41:in `block in init_rails'
/Users/ppd/.rvm/gems/ruby-2.1.2/gems/haml-3.1.6/lib/haml.rb:41:in `each'
/Users/ppd/.rvm/gems/ruby-2.1.2/gems/haml-3.1.6/lib/haml.rb:41:in `init_rails'
/Users/ppd/.rvm/gems/ruby-2.1.2/gems/haml-3.1.6/lib/haml/railtie.rb:16:in `block (2 levels) in <top (required)>'
/Users/ppd/.rvm/gems/ruby-2.1.2/gems/activesupport-4.1.1/lib/active_support/lazy_load_hooks.rb:38:in `instance_eval'
/Users/ppd/.rvm/gems/ruby-2.1.2/gems/activesupport-4.1.1/lib/active_support/lazy_load_hooks.rb:38:in `execute_hook'
/Users/ppd/.rvm/gems/ruby-2.1.2/gems/activesupport-4.1.1/lib/active_support/lazy_load_hooks.rb:28:in `block in on_load'
/Users/ppd/.rvm/gems/ruby-2.1.2/gems/activesupport-4.1.1/lib/active_support/lazy_load_hooks.rb:27:in `each'
/Users/ppd/.rvm/gems/ruby-2.1.2/gems/activesupport-4.1.1/lib/active_support/lazy_load_hooks.rb:27:in `on_load'
/Users/ppd/.rvm/gems/ruby-2.1.2/gems/haml-3.1.6/lib/haml/railtie.rb:15:in `block in <top (required)>'
/Users/ppd/.rvm/gems/ruby-2.1.2/gems/activesupport-4.1.1/lib/active_support/lazy_load_hooks.rb:38:in `instance_eval'
/Users/ppd/.rvm/gems/ruby-2.1.2/gems/activesupport-4.1.1/lib/active_support/lazy_load_hooks.rb:38:in `execute_hook'
/Users/ppd/.rvm/gems/ruby-2.1.2/gems/activesupport-4.1.1/lib/active_support/lazy_load_hooks.rb:45:in `block in run_load_hooks'
/Users/ppd/.rvm/gems/ruby-2.1.2/gems/activesupport-4.1.1/lib/active_support/lazy_load_hooks.rb:44:in `each'
/Users/ppd/.rvm/gems/ruby-2.1.2/gems/activesupport-4.1.1/lib/active_support/lazy_load_hooks.rb:44:in `run_load_hooks'
/Users/ppd/.rvm/gems/ruby-2.1.2/gems/railties-4.1.1/lib/rails/application/bootstrap.rb:76:in `block in <module:Bootstrap>'
/Users/ppd/.rvm/gems/ruby-2.1.2/gems/railties-4.1.1/lib/rails/initializable.rb:30:in `instance_exec'
/Users/ppd/.rvm/gems/ruby-2.1.2/gems/railties-4.1.1/lib/rails/initializable.rb:30:in `run'
/Users/ppd/.rvm/gems/ruby-2.1.2/gems/railties-4.1.1/lib/rails/initializable.rb:55:in `block in run_initializers'
/Users/ppd/.rvm/gems/ruby-2.1.2/gems/railties-4.1.1/lib/rails/initializable.rb:54:in `run_initializers'
/Users/ppd/.rvm/gems/ruby-2.1.2/gems/railties-4.1.1/lib/rails/application.rb:288:in `initialize!'
/Users/ppd/.rvm/gems/ruby-2.1.2/gems/railties-4.1.1/lib/rails/railtie.rb:194:in `public_send'
/Users/ppd/.rvm/gems/ruby-2.1.2/gems/railties-4.1.1/lib/rails/railtie.rb:194:in `method_missing'
/Users/ppd/Academics/Research/git/teapot/config/environment.rb:5:in `<top (required)>'
/Users/ppd/.rvm/gems/ruby-2.1.2/gems/railties-4.1.1/lib/rails/application.rb:264:in `require_environment!'
/Users/ppd/.rvm/gems/ruby-2.1.2/gems/railties-4.1.1/lib/rails/application.rb:367:in `block in run_tasks_blocks'
/Users/ppd/.rvm/gems/ruby-2.1.2/bin/ruby_executable_hooks:15:in `eval'
/Users/ppd/.rvm/gems/ruby-2.1.2/bin/ruby_executable_hooks:15:in `<main>'
Tasks: TOP => db:migrate => environment
(See full trace by running task with --trace)
I can't seem to find anything on this on google/SO. I'd really appreciate help with it!
I haven't figured out the details of it, but apparently Haml is the culprit here.
Remove gem 'haml-rails' from your Gemfile if you have it, and replace it with:
gem 'haml', '~> 4.0.0'
Then run bundle update and boot up the Rails server again.
I have set in the application.rb according with heroku docs about "Precompiling assets failed".
config.assets.initialize_on_precompile = false
Assets were precompiled successfully locally by run
RAILS_ENV=production bundle exec rake assets:precompile
I work with Rails 3.2.13. I have squlite3 in the gemfile.
When I try to push app on heroku I have such problem:
Running: rake assets:precompile
DEPRECATION WARNING: You have Rails 2.3-style plugins...
...
rake aborted!
Please install the sqlite3 adapter: `gem install activerecord-sqlite3-adapter` (sqlite3 is not part of the bundle. Add it to Gemfile.)
/tmp/build_256ed4cc-34a4-4fed-8fdb-d5d5c459a1df/vendor/bundle/ruby/2.0.0/gems/bundler-1.5.2/lib/bundler/rubygems_integration.rb:240:in `block in replace_gem'
/tmp/build_256ed4cc-34a4-4fed-8fdb-d5d5c459a1df/vendor/bundle/ruby/2.0.0/gems/activerecord-3.2.13/lib/active_record/connection_adapters/sqlite3_adapter.rb:3:in `<top (required)>'
/tmp/build_256ed4cc-34a4-4fed-8fdb-d5d5c459a1df/vendor/bundle/ruby/2.0.0/gems/activesupport-3.2.13/lib/active_support/dependencies.rb:251:in `require'
/tmp/build_256ed4cc-34a4-4fed-8fdb-d5d5c459a1df/vendor/bundle/ruby/2.0.0/gems/activesupport-3.2.13/lib/active_support/dependencies.rb:251:in `block in require'
/tmp/build_256ed4cc-34a4-4fed-8fdb-d5d5c459a1df/vendor/bundle/ruby/2.0.0/gems/activesupport-3.2.13/lib/active_support/dependencies.rb:236:in `load_dependency'
/tmp/build_256ed4cc-34a4-4fed-8fdb-d5d5c459a1df/vendor/bundle/ruby/2.0.0/gems/activesupport-3.2.13/lib/active_support/dependencies.rb:251:in `require'
/tmp/build_256ed4cc-34a4-4fed-8fdb-d5d5c459a1df/vendor/bundle/ruby/2.0.0/gems/activerecord-3.2.13/lib/active_record/connection_adapters/abstract/connection_specification.rb:50:in `resolve_hash_connection'
/tmp/build_256ed4cc-34a4-4fed-8fdb-d5d5c459a1df/vendor/bundle/ruby/2.0.0/gems/activerecord-3.2.13/lib/active_record/connection_adapters/abstract/connection_specification.rb:41:in `resolve_string_connection'
/tmp/build_256ed4cc-34a4-4fed-8fdb-d5d5c459a1df/vendor/bundle/ruby/2.0.0/gems/activerecord-3.2.13/lib/active_record/connection_adapters/abstract/connection_specification.rb:27:in `spec'
/tmp/build_256ed4cc-34a4-4fed-8fdb-d5d5c459a1df/vendor/bundle/ruby/2.0.0/gems/activerecord-3.2.13/lib/active_record/connection_adapters/abstract/connection_specification.rb:130:in `establish_connection'
/tmp/build_256ed4cc-34a4-4fed-8fdb-d5d5c459a1df/vendor/bundle/ruby/2.0.0/gems/activerecord-3.2.13/lib/active_record/railtie.rb:82:in `block (2 levels) in <class:Railtie>'
/tmp/build_256ed4cc-34a4-4fed-8fdb-d5d5c459a1df/vendor/bundle/ruby/2.0.0/gems/activesupport-3.2.13/lib/active_support/lazy_load_hooks.rb:36:in `instance_eval'
/tmp/build_256ed4cc-34a4-4fed-8fdb-d5d5c459a1df/vendor/bundle/ruby/2.0.0/gems/activesupport-3.2.13/lib/active_support/lazy_load_hooks.rb:36:in `execute_hook'
/tmp/build_256ed4cc-34a4-4fed-8fdb-d5d5c459a1df/vendor/bundle/ruby/2.0.0/gems/activesupport-3.2.13/lib/active_support/lazy_load_hooks.rb:26:in `block in on_load'
/tmp/build_256ed4cc-34a4-4fed-8fdb-d5d5c459a1df/vendor/bundle/ruby/2.0.0/gems/activesupport-3.2.13/lib/active_support/lazy_load_hooks.rb:25:in `each'
/tmp/build_256ed4cc-34a4-4fed-8fdb-d5d5c459a1df/vendor/bundle/ruby/2.0.0/gems/activesupport-3.2.13/lib/active_support/lazy_load_hooks.rb:25:in `on_load'
/tmp/build_256ed4cc-34a4-4fed-8fdb-d5d5c459a1df/vendor/bundle/ruby/2.0.0/gems/activerecord-3.2.13/lib/active_record/railtie.rb:74:in `block in <class:Railtie>'
/tmp/build_256ed4cc-34a4-4fed-8fdb-d5d5c459a1df/vendor/bundle/ruby/2.0.0/gems/railties-3.2.13/lib/rails/initializable.rb:30:in `instance_exec'
/tmp/build_256ed4cc-34a4-4fed-8fdb-d5d5c459a1df/vendor/bundle/ruby/2.0.0/gems/railties-3.2.13/lib/rails/initializable.rb:30:in `run'
/tmp/build_256ed4cc-34a4-4fed-8fdb-d5d5c459a1df/vendor/bundle/ruby/2.0.0/gems/railties-3.2.13/lib/rails/initializable.rb:55:in `block in run_initializers'
/tmp/build_256ed4cc-34a4-4fed-8fdb-d5d5c459a1df/vendor/bundle/ruby/2.0.0/gems/railties-3.2.13/lib/rails/initializable.rb:54:in `each'
/tmp/build_256ed4cc-34a4-4fed-8fdb-d5d5c459a1df/vendor/bundle/ruby/2.0.0/gems/railties-3.2.13/lib/rails/initializable.rb:54:in `run_initializers'
/tmp/build_256ed4cc-34a4-4fed-8fdb-d5d5c459a1df/vendor/bundle/ruby/2.0.0/gems/railties-3.2.13/lib/rails/application.rb:136:in `initialize!'
/tmp/build_256ed4cc-34a4-4fed-8fdb-d5d5c459a1df/vendor/bundle/ruby/2.0.0/gems/railties-3.2.13/lib/rails/railtie/configurable.rb:30:in `method_missing'
/tmp/build_256ed4cc-34a4-4fed-8fdb-d5d5c459a1df/config/environment.rb:5:in `<top (required)>'
/tmp/build_256ed4cc-34a4-4fed-8fdb-d5d5c459a1df/vendor/bundle/ruby/2.0.0/gems/activesupport-3.2.13/lib/active_support/dependencies.rb:251:in `require'
/tmp/build_256ed4cc-34a4-4fed-8fdb-d5d5c459a1df/vendor/bundle/ruby/2.0.0/gems/activesupport-3.2.13/lib/active_support/dependencies.rb:251:in `block in require'
/tmp/build_256ed4cc-34a4-4fed-8fdb-d5d5c459a1df/vendor/bundle/ruby/2.0.0/gems/activesupport-3.2.13/lib/active_support/dependencies.rb:236:in `load_dependency'
/tmp/build_256ed4cc-34a4-4fed-8fdb-d5d5c459a1df/vendor/bundle/ruby/2.0.0/gems/activesupport-3.2.13/lib/active_support/dependencies.rb:251:in `require'
/tmp/build_256ed4cc-34a4-4fed-8fdb-d5d5c459a1df/vendor/bundle/ruby/2.0.0/gems/railties-3.2.13/lib/rails/application.rb:103:in `require_environment!'
/tmp/build_256ed4cc-34a4-4fed-8fdb-d5d5c459a1df/vendor/bundle/ruby/2.0.0/gems/railties-3.2.13/lib/rails/application.rb:297:in `block (2 levels) in initialize_tasks'
/tmp/build_256ed4cc-34a4-4fed-8fdb-d5d5c459a1df/vendor/bundle/ruby/2.0.0/gems/actionpack-3.2.13/lib/sprockets/assets.rake:93:in `block (2 levels) in <top (required)>'
/tmp/build_256ed4cc-34a4-4fed-8fdb-d5d5c459a1df/vendor/bundle/ruby/2.0.0/gems/actionpack-3.2.13/lib/sprockets/assets.rake:60:in `block (3 levels) in <top (required)>'
/tmp/build_256ed4cc-34a4-4fed-8fdb-d5d5c459a1df/vendor/bundle/ruby/2.0.0/gems/actionpack-3.2.13/lib/sprockets/assets.rake:23:in `invoke_or_reboot_rake_task'
/tmp/build_256ed4cc-34a4-4fed-8fdb-d5d5c459a1df/vendor/bundle/ruby/2.0.0/gems/actionpack-3.2.13/lib/sprockets/assets.rake:29:in `block (2 levels) in <top (required)>'
Tasks: TOP => environment
(See full trace by running task with --trace)
!
! Precompiling assets failed.
!
! Push rejected, failed to compile Ruby app
You haven't set sqlite3 from your gemfile.
Please install the sqlite3 adapter: `gem install activerecord-sqlite3-adapter` (sqlite3 is not part of the bundle. Add it to Gemfile.)
However, it will still not work because sqlite3 isn't supported by heroku.
You can set postgresql which is supported by Heroku (gem 'pg' in your gemfile) instead.
You can follow this official guide to see how you can procede.
add sqlite3 in your Gemfile
gem 'sqlite3'
I cloned an app folder from a GitHub repository, and after bundle install the gems, I tried to use the rake db:reset and rake db:migrate commands, neither worked, and here is my error message:
>[app_folder]rake db:reset
rake aborted!
Could not load database configuration. No such file - /Users/harry/Dropbox/apps/app_folder/config/database.yml
/usr/local/rvm/gems/ruby-2.0.0-p353#railstutorial_rails_4_0/gems/railties-4.0.0/lib/rails/application/configuration.rb:110:in `database_configuration'
/usr/local/rvm/gems/ruby-2.0.0-p353#railstutorial_rails_4_0/gems/activerecord-4.0.0/lib/active_record/railtie.rb:174:in `block (2 levels) in <class:Railtie>'
/usr/local/rvm/gems/ruby-2.0.0-p353#railstutorial_rails_4_0/gems/activesupport-4.0.0/lib/active_support/lazy_load_hooks.rb:38:in `instance_eval'
/usr/local/rvm/gems/ruby-2.0.0-p353#railstutorial_rails_4_0/gems/activesupport-4.0.0/lib/active_support/lazy_load_hooks.rb:38:in `execute_hook'
/usr/local/rvm/gems/ruby-2.0.0-p353#railstutorial_rails_4_0/gems/activesupport-4.0.0/lib/active_support/lazy_load_hooks.rb:28:in `block in on_load'
/usr/local/rvm/gems/ruby-2.0.0-p353#railstutorial_rails_4_0/gems/activesupport-4.0.0/lib/active_support/lazy_load_hooks.rb:27:in `each'
/usr/local/rvm/gems/ruby-2.0.0-p353#railstutorial_rails_4_0/gems/activesupport-4.0.0/lib/active_support/lazy_load_hooks.rb:27:in `on_load'
/usr/local/rvm/gems/ruby-2.0.0-p353#railstutorial_rails_4_0/gems/activerecord-4.0.0/lib/active_record/railtie.rb:173:in `block in <class:Railtie>'
/usr/local/rvm/gems/ruby-2.0.0-p353#railstutorial_rails_4_0/gems/railties-4.0.0/lib/rails/initializable.rb:30:in `instance_exec'
/usr/local/rvm/gems/ruby-2.0.0-p353#railstutorial_rails_4_0/gems/railties-4.0.0/lib/rails/initializable.rb:30:in `run'
/usr/local/rvm/gems/ruby-2.0.0-p353#railstutorial_rails_4_0/gems/railties-4.0.0/lib/rails/initializable.rb:55:in `block in run_initializers'
/usr/local/rvm/gems/ruby-2.0.0-p353#railstutorial_rails_4_0/gems/railties-4.0.0/lib/rails/initializable.rb:54:in `run_initializers'
/usr/local/rvm/gems/ruby-2.0.0-p353#railstutorial_rails_4_0/gems/railties-4.0.0/lib/rails/application.rb:215:in `initialize!'
/usr/local/rvm/gems/ruby-2.0.0-p353#railstutorial_rails_4_0/gems/railties-4.0.0/lib/rails/railtie/configurable.rb:30:in `method_missing'
/Users/harry/Dropbox/apps/app_folder/config/environment.rb:5:in `<top (required)>'
/usr/local/rvm/gems/ruby-2.0.0-p353#railstutorial_rails_4_0/gems/activesupport-4.0.0/lib/active_support/dependencies.rb:228:in `require'
/usr/local/rvm/gems/ruby-2.0.0-p353#railstutorial_rails_4_0/gems/activesupport-4.0.0/lib/active_support/dependencies.rb:228:in `block in require'
/usr/local/rvm/gems/ruby-2.0.0-p353#railstutorial_rails_4_0/gems/activesupport-4.0.0/lib/active_support/dependencies.rb:213:in `load_dependency'
/usr/local/rvm/gems/ruby-2.0.0-p353#railstutorial_rails_4_0/gems/activesupport-4.0.0/lib/active_support/dependencies.rb:228:in `require'
/usr/local/rvm/gems/ruby-2.0.0-p353#railstutorial_rails_4_0/gems/railties-4.0.0/lib/rails/application.rb:189:in `require_environment!'
/usr/local/rvm/gems/ruby-2.0.0-p353#railstutorial_rails_4_0/gems/railties-4.0.0/lib/rails/application.rb:249:in `block in run_tasks_blocks'
/usr/local/rvm/gems/ruby-2.0.0-p353#railstutorial_rails_4_0/bin/ruby_executable_hooks:15:in `eval'
/usr/local/rvm/gems/ruby-2.0.0-p353#railstutorial_rails_4_0/bin/ruby_executable_hooks:15:in `<main>'
Tasks: TOP => db:reset => environment
(See full trace by running task with --trace)
[app_folder]
I get similar errors when I try to run rails server or rails console. Would really appreciate any help!! Thanks a lot!
Usually rails apps have config/database.yml.example, copy this file to config/database.yml and overwrite database connection settings if necessary.
I am trying to deploy a rails application using activerecord-postgis-adapter to heroku, however I keep getting this error.
ruby 2.0.0p0 (2013-02-24 revision 39474) [x86_64-darwin12.3.0]
Rails 3.2.13
$ heroku run rake db:schema:load
Running `rake db:schema:load` attached to terminal... up, run.9233
DEPRECATION WARNING: You have Rails 2.3-style plugins in vendor/plugins! Support for these plugins will be removed in Rails 4.0. Move them out and bundle them in your Gemfile, or fold them in to your app as lib/myplugin/* and config/initializers/myplugin.rb. See the release notes for more on this: http://weblog.rubyonrails.org/2012/1/4/rails-3-2-0-rc2-has-been-released. (called from <top (required)> at /app/Rakefile:7)
DEPRECATION WARNING: You have Rails 2.3-style plugins in vendor/plugins! Support for these plugins will be removed in Rails 4.0. Move them out and bundle them in your Gemfile, or fold them in to your app as lib/myplugin/* and config/initializers/myplugin.rb. See the release notes for more on this: http://weblog.rubyonrails.org/2012/1/4/rails-3-2-0-rc2-has-been-released. (called from <top (required)> at /app/Rakefile:7)
-- create_table("active_admin_comments", {:force=>true})
...
-- create_table("locations", {:force=>true})
rake aborted!
undefined method `spatial' for #<ActiveRecord::ConnectionAdapters::PostgreSQLAdapter::TableDefinition:0x007f6051920618>
/app/vendor/bundle/ruby/2.0.0/gems/rgeo-activerecord-0.5.0/lib/rgeo/active_record/common_adapter_elements.rb:107:in `method_missing'
/app/db/schema.rb:85:in `block (2 levels) in <top (required)>'
/app/vendor/bundle/ruby/2.0.0/gems/activerecord-3.2.13/lib/active_record/connection_adapters/abstract/schema_statements.rb:160:in `create_table'
/app/vendor/bundle/ruby/2.0.0/gems/activerecord-3.2.13/lib/active_record/migration.rb:466:in `block in method_missing'
/app/vendor/bundle/ruby/2.0.0/gems/activerecord-3.2.13/lib/active_record/migration.rb:438:in `block in say_with_time'
/app/vendor/bundle/ruby/2.0.0/gems/activerecord-3.2.13/lib/active_record/migration.rb:438:in `say_with_time'
/app/vendor/bundle/ruby/2.0.0/gems/activerecord-3.2.13/lib/active_record/migration.rb:458:in `method_missing'
/app/db/schema.rb:80:in `block in <top (required)>'
/app/vendor/bundle/ruby/2.0.0/gems/activerecord-3.2.13/lib/active_record/schema.rb:50:in `instance_eval'
/app/vendor/bundle/ruby/2.0.0/gems/activerecord-3.2.13/lib/active_record/schema.rb:50:in `define'
/app/db/schema.rb:14:in `<top (required)>'
/app/vendor/bundle/ruby/2.0.0/gems/activesupport-3.2.13/lib/active_support/dependencies.rb:245:in `load'
/app/vendor/bundle/ruby/2.0.0/gems/activesupport-3.2.13/lib/active_support/dependencies.rb:245:in `block in load'
/app/vendor/bundle/ruby/2.0.0/gems/activesupport-3.2.13/lib/active_support/dependencies.rb:236:in `load_dependency'
/app/vendor/bundle/ruby/2.0.0/gems/activesupport-3.2.13/lib/active_support/dependencies.rb:245:in `load'
/app/vendor/bundle/ruby/2.0.0/gems/activerecord-3.2.13/lib/active_record/railties/databases.rake:402:in `block (3 levels) in <top (required)>'
/app/vendor/bundle/ruby/2.0.0/gems/rake-10.0.4/lib/rake/task.rb:246:in `call'
/app/vendor/bundle/ruby/2.0.0/gems/rake-10.0.4/lib/rake/task.rb:246:in `block in execute'
/app/vendor/bundle/ruby/2.0.0/gems/rake-10.0.4/lib/rake/task.rb:241:in `each'
/app/vendor/bundle/ruby/2.0.0/gems/rake-10.0.4/lib/rake/task.rb:241:in `execute'
/app/vendor/bundle/ruby/2.0.0/gems/rake-10.0.4/lib/rake/task.rb:184:in `block in invoke_with_call_chain'
/app/vendor/bundle/ruby/2.0.0/gems/rake-10.0.4/lib/rake/task.rb:177:in `invoke_with_call_chain'
/app/vendor/bundle/ruby/2.0.0/gems/rake-10.0.4/lib/rake/task.rb:170:in `invoke'
/app/vendor/bundle/ruby/2.0.0/gems/rake-10.0.4/lib/rake/application.rb:143:in `invoke_task'
/app/vendor/bundle/ruby/2.0.0/gems/rake-10.0.4/lib/rake/application.rb:101:in `block (2 levels) in top_level'
/app/vendor/bundle/ruby/2.0.0/gems/rake-10.0.4/lib/rake/application.rb:101:in `each'
/app/vendor/bundle/ruby/2.0.0/gems/rake-10.0.4/lib/rake/application.rb:101:in `block in top_level'
/app/vendor/bundle/ruby/2.0.0/gems/rake-10.0.4/lib/rake/application.rb:110:in `run_with_threads'
/app/vendor/bundle/ruby/2.0.0/gems/rake-10.0.4/lib/rake/application.rb:95:in `top_level'
/app/vendor/bundle/ruby/2.0.0/gems/rake-10.0.4/lib/rake/application.rb:73:in `block in run'
/app/vendor/bundle/ruby/2.0.0/gems/rake-10.0.4/lib/rake/application.rb:160:in `standard_exception_handling'
/app/vendor/bundle/ruby/2.0.0/gems/rake-10.0.4/lib/rake/application.rb:70:in `run'
Tasks: TOP => db:schema:load
(See full trace by running task with --trace)
As a temporary fix I simply changed DATABASE_URL by replacing postgres:// to postgis:// as follows:
heroku config:set DATABASE_URL='postgis://user:password#host.compute-1.amazonaws.com:port/dbname'
This is where I found that work around:
https://groups.google.com/forum/#!msg/rgeo-users/SDRhEeMZLWc/nue2sFRV6qwJ
I hear it creates other problems in terms of backing up, etc, according to:
https://github.com/dazuma/activerecord-postgis-adapter/issues/14
This happened to me when I switched to using unicorn as my web server. I found that I had to add a special bit of code to config/unicorn.rb to make it work:
# in config/unicorn.rb
after_fork do |server, worker|
if defined?(ActiveRecord::Base)
config = Rails.application.config.database_configuration[Rails.env]
config['adapter'] = 'postgis'
ActiveRecord::Base.establish_connection(config)
end
end
Found the answer here: https://devcenter.heroku.com/articles/postgis
To fix this issue all I had to do was change my adapter in config/database.yml to 'postgis' from 'postgresql'.
This was what I was supposed to do per my tutorial but I forgot to do it. After than all was well.
So, Heroku Rails will use some database.yml params but not all. For Rails 4.1+ https://devcenter.heroku.com/articles/rails-database-connection-behavior#configuring-connections-in-rails-4-1 states that adapter is ignored.
https://devcenter.heroku.com/articles/rails-database-connection-behavior#active-record-4-1-escape-valve states that it will accept url (so that you can host your database somewhere other than Heroku). No need to hardcode it, do a substitution.
production:
url: <%= ENV.fetch('DATABASE_URL', '').sub(/^postgres/, "postgis") %>