Skip to content

Troubleshooting

Brian Riley edited this page Mar 6, 2018 · 22 revisions

Installation:

Bundler fails on libv8

An error occurred while installing libv8 (3.11.8.17), and Bundler cannot continue.

Make sure that `gem install libv8 -v '3.11.8.17'` succeeds before bundling. 

If you are installing on a system that already has v8 installed then you may need to install the libv8 gem manually using your system's current v8 engine. If you're using homebrew to manage your packages you should run 'brew update' and 'brew upgrade' to make sure you have the latest packages

> gem uninstall -a libv8
> gem install libv8 -v '<<VERSION>>' -- --with-system-v8
> bundle install

Bundler fails on json

Example:

An error occurred while installing json (1.8.3), and Bundler cannot continue.
Make sure that `gem install json -v '1.8.3'` succeeds before bundling.

If running the suggested gem installation fails as well, you can try to have bundler update that specific gem.

 > bundle update pg

If you run into Build Errors when installing gem json -v 1.8.3 on OSX(v10.12), make sure for the following are installed:

  • xcode-select --install [active developer directory for Xcode and BSD tools]
  • brew install coreutils

Bundler fails on pg or mysql2

Example:

An error occurred while installing pg (0.19.0), and Bundler cannot continue.
Make sure that `gem install pg -v '0.19.0'` succeeds before bundling.

You must install the database you want to use before running bundler!

Follow the installation instructions for the database you prefer to use (note that you may need root access to install these dependencies on your server):

If Bundler fails on mysql2 but you're not using MySQL or it fails on pg and you're not using PostgreSQL, just comment out the corresponding gem in the Gemfile and then rerun bundler.

# ------------------------------------------------
#    DATABASE/SERVER
gem 'mysql2', '~> 0.3.18'
# gem 'pg'
gem 'flag_shih_tzu'  # Allows for bitfields in activereccord

Post Installation Issues

I installed the system and migrated my legacy DMPOnline data into the database but none of my users are able to login!

This happens when the 'pepper' key defined in config/initializers/devise.rb does not match the one on your old server. Simply update the pepper and restart the application.


I am getting an undefined method 'devise' on the app/modles/user.rb object when running tests or trying to start the service.

This happens when you have not created a copy of the devise.rb.example initializer file. To correct it copy the file and update its parameters accordingly:

> cp config/initializers/devise.rb.example config/initializers/devise.rb

Some or all of the CSS/JS/Image files are missing when I view the site in my browser

This typically occurs when Webpack has either not properly bundled your assets or there is an issue with the way it is bundling your assets.

  • Make sure Webpack is running npm run bundle (or npm run bundle -- -p to daemonize Webpack)

If Webpack is running, check your browser to determine what file(s) are missing and then look in the public/ directory for those files.

  • If the files exist in the directory, try restarting your rails server. It may not have refreshed and loaded the latest asset files
  • If the browser is looking for a fingerprinted asset (e.g. images/246b1bb5382010260210d60f286d03c8.jpg) but your public/images directory contains my_image.jpg instead or vice versa. Then there is a configuration issue with your application. By default the application only fingerprints assets in production. Refer to the app/helpes/application_helper.rb to see if you need to adjust this default configuration:
  def fingerprinted_asset(name)
    Rails.env.production? ? "#{name}-#{ASSET_FINGERPRINT}" : name
  end

Undefined public_key for Recaptcha

NoMethodError: undefined method `public_key=' for #<Recaptcha::Configuration:0x007fb1375b8930>
/Users/briley/Documents/workspace/roadmap/config/initializers/recaptcha.rb:2:in `block in <top (required)>'
/Users/briley/Documents/workspace/roadmap/config/initializers/recaptcha.rb:1:in `<top (required)>'
/Users/briley/Documents/workspace/roadmap/config/environment.rb:9:in `<top (required)>'
Tasks: TOP => db:migrate => environment

This can happen during the upgrade/migration process from DMPOnline4 to DMPRoadmap. The recaptcha initializer is present but the gem is out of date or not configured correctly. To bypass the issue and continue with the upgrade just comment out the 3 Recaptcha config lines in the config/initializers/recaptcha.rb:

Recaptcha.configure do |config|
#  config.public_key  = 'replace_this_with_your_public_key'
#  config.private_key = 'replace_this_with_your_private_key'
#  config.proxy = 'http://someproxy.com:port'
end

When I run a rake or rails task it tells me I have a version conflict

rake aborted!
Gem::LoadError: You have already activated rake 12.0.0, but your Gemfile requires rake 11.3.0. Prepending `bundle exec` to your command may solve this.
/Users/name/Documents/workspace/roadmap/config/boot.rb:6:in `<top (required)>'
/Users/name/Documents/workspace/roadmap/config/application.rb:1:in `<top (required)>'
/Users/name/Documents/workspace/roadmap/Rakefile:5:in `<top (required)>'

Use the suggested advise and prepend your command with bundle exec (e.g. bundle exec rake db:migrate)


A lot of the tests are failing but I haven't made any changes to the code.

This could be due to your test database (SQLite) being out of date. The test database uses the data in db/seeds.rb by default but those records will only be inserted if they do not already exist. So, if an update added/removed a field from a table you may not have data for it in your test database.

Try the following to rebuild your test database:

rake db:drop RAILS_ENV=test
rake db:create RAILS_ENV=test
rake db:schema:load RAILS_ENV=test
rake test

Do NOT forget to include the environment specification!!


All of the Omniauth controller tests are failing

NoMethodError: undefined method `provider' for #<Hash:0x0000000bff0400>

This happens when you have a provider defined in the identifier_schemes table but they do not have an entry in your config/initializers/devise.rb file. Just add the appropriate omniauth config in that file and the issue should get resolved.

Clone this wiki locally