First Heroku Push of Application to Heroku leads to Application Error - ruby-on-rails

I am relatively new to Heroku and Rails. I have pushed a small "app" to Heroku before which worked fine.
Now I have developed a bit of a larger application on my desktop pc, which runs fine using my rails server as localhost.
When I try migrating it to Heroku I get the following message:
Application Error
=================
An error occurred in the application and your page could not be served. Please try again in a few moments.
If you are the application owner, check your logs for details.
I started looking at the log files, but they don't really tell me anything. Can someone please give me a hint on how to interpret them. I think the last to logfile lines are the ones that crash the application:
2013-08-12T17:54:56.944875+00:00 app[web.1]: /app/vendor/bundle/ruby/2.0.0/gems/bundler-1.3.2/lib/bundler/rubygems_integration.rb:224:in `block in replace_gem': can't activate bcrypt-ruby (~> 3.0.0), already activated bcrypt-ruby-3.1.1. Make sure all dependencies are added to Gemfile. (Gem::LoadError)
EDIT: I've now added the complete 'heroku logs' prompt output. Any suggestions on what to look for. I'm very unfamiliar with the log output, don't really know where to start.
EDIT 2: Thanks for all the help so far! I've got the app working now. The following was the problem
In my gem file I had ByCrypt linked in like this:
gem 'bcrypt-ruby', :require => 'bcrypt'
Since the Heroku logs said something about
can't activate bcrypt-ruby (~> 3.0.0), already activated bcrypt-ruby-3.1.1.
I changed my Gemfile to
gem 'bcrypt-ruby', '~> 3.0.0'
This helped! The app is now running on heroku. But I think I now have a problem with the methods using bcrypt... but I will have to investigate this seperately. Thanks for the help!

have you migrated the database?
like this: heroku run rake db:migrate
if that dosn't work use this:
run heroku logs, and paste the log here
2013-08-12T17:54:56.944875+00:00 app[web.1]: /app/vendor/bundle/ruby/2.0.0/gems/bundler-1.3.2/lib/bundler/rubygems_integration.rb:224:in `block in replace_gem': can't activate bcrypt-ruby (~> 3.0.0), already activated bcrypt-ruby-3.1.1. Make sure all
dependencies are added to Gemfile. (Gem::LoadError)
maybe you forgot to add a gem explicity in your gemfile,

Related

Deleted gem 'webpack' but keeps giving error on Heroku

I have installed gem 'webpacker' and then, commited to the server. However, when I deleted the gem, the new setting haven't been updated on Heroku.
When I run the app:
/app/vendor/bundle/ruby/2.5.0/gems/railties-5.1.6/lib/rails/railtie/configuration.rb:95:in method_missing': undefined methodwebpacker' for # (NoMethodError)
Someone knows how to re-do gem process in the server? Thank you!
More than likely you still have some config items leftover. Search your application for webpack and webpacker. You may find a webpack folder in your config, at least.
https://github.com/rails/webpacker
I would recommend going through the setup again, to make sure you removed everything.
From the error it seems that your Gemfile.lock is not being updated.
First delete the Gemfile.lock on local system
Then remove the gem from Gemfile on local system.
Then bundle on local system with the gem in Gemfile removed.
Commit and Push to Heroku.
Hope it helps!!

Hirb doesn't work in console

I have hirb in my Gemfile, bundle installed it, edited irbrc file according to the document I found online, even tried installing it from the console, but it still doesn't work. I also did gem list and know for a fact that gem 'hirb' is in there. I'm very new to being a programmer. Can anyone help? Thanks :)

Bootstrap Devise Cancan Rails - Rspec Failure

I just installed Rails3 Bootstrap Device Cancan in my local machine and ran rake spec but I'm getting all test failures with below error in common:
undefined local variable or method 'postgresql_version' for #<ActiveRecord::ConnectionAdaptors::SQLite3Adaptor:0x489dff8>
I'm not sure why I'm getting this since I followed the instructions on https://github.com/RailsApps/rails3-bootstrap-devise-cancan carefully.
I'm currently running this on Windows 8 and used Bitnami RubyStack to run CMD
I ran into the same problem and this is how I resolved it.
It looks like there is a problem with version 1.1.0 of database_cleaner. See "database_cleaner >= 1.1.0 is broken for SQLite" (https://github.com/gregbell/active_admin/issues/2388). I updated my Gemfile to set
gem 'database_cleaner', '< 1.1.0'
then ran "bundle install" and after it completed, "rake spec" ran cleanly.
Double-check your database.yml. Refer to Configuring Rails Applications, Section 3.12, Configuring a Database.
Did you intend to use sqlite3? Is sqlite3 in your Gemfile? Naturally, SQLite3Adaptor will not respond to postgresql_version! Can you include a few more lines of the stack trace?
I doubt this has anything to do with devise or cancan.

exception_notification gem raises ActionView::Template::Error (code converter not found (UTF-8 to UTF-16)) only on Heroku production mode

I create rails app deployed on Heroku.
also, exception_notification gem enabled.
when it is on development setup ActionMailer to Gmail,
everything is fine and sends a notification from Gmail address.
but when it comes to production environment on Heroku,
I get following error when server trying to send a email.
ActionView::Template::Error (code converter not found (UTF-8 to UTF-16))
Could anyone tell me what's happening here?
The issue was raised on the main repository (see here), but so far was not addressed.
You might want to take a look at this fork to the exception_notification gem, specifically this commit which tries to deal with the problem:
https://github.com/alanjds/exception_notification/commit/048fc6be972189e62ca3b9453d19233ec5773016
To use this fork I pointed the gem to it, like so:
Gemfile:
gem 'exception_notification', git: 'git://github.com/alanjds/exception_notification.git'
This solved the issue for me.
Quick adjustment to solution by hananamar, otherwise you'll get an error:
gem 'exception_notification', :git => 'git://github.com/alanjds/exception_notification.git', :require => 'exception_notifier'
I know this is an old post but since I got the same issue some days ago, I wanted to share here that I solved it by forcing the latest version of the gem on my Heroku app.
gem 'exception_notification', '3.0.1'
I guess the problem was with version 3.0.0 and it is fixed on 3.0.1.

Problem installing googlecharts gem?

I am trying to use the googlecharts gem to create some quick charts. Here are the rubyforge and github sites:
http://googlecharts.rubyforge.org/
http://github.com/mattetti/googlecharts/tree/master
After installing, I keep getting an error saying "no such file to load -- googlecharts" even though when I do a "gem list", the gem is listed. I have restarted my server. Anyone know what could be going on here?
Thanks!
According to the docs, you need to
require 'gchart'
but it sounds like you might be doing
require 'googlecharts'
instead.
You must do a gem install googlecharts first and then add gem "googlecharts" to your gemfile, then run bundle install. You should be free from the error afterwards.

Resources