I’m working on a Ruby on Rails application that used the Devise authentication system.
https://github.com/plataformatec/devise
I scoured the internet for a similar problem to my own but no no avail. I guess to give you a little background, it all started out with 2 separate applications. One of which was using devise. I’m currently attempting to mix both applications into one. Even after putting the model views and controllers where they needed to I wasn’t running into any problems. However, we needed to switch from a Sqlite3 database to a Postgresql one. As soon as I modified the database.yml file to point to the new Postgres database and restarted the server I started to get various to_sym errors all throughout the application and routing errors for the new functionality that was added to the application using Devise.
Before I switched to the Postgresql database I ran my developement.sqlite3 file through a database converter — this is something that I’ve done in the past with no problems.
I’m unsure of how to debug this application as these to_sym errors are occuring all throughout.
To give you an example here’s one of the pages that stopped working:
NoMethodError in Home#index
Showing C:/Users/chunter33/Desktop/devise_forem/app/views/layouts/application.html.haml where line #19 raised:
undefined method `to_sym’ for nil:NilClass
16: %a{:href => “#”}= t(“web-app-theme.profile”, :default => “Profile”) 17: %li 18: %a{:href => “#”}= t(“web-app-theme.settings”, :default => “Settings”) 19: – if signed_in? 20: %li 21: %a 22: = current_user.email Application Trace:
app/helpers/application_helper.rb:3:in `signed_in?’
app/views/layouts/application.html.haml:19:in
`_app_views_layouts_application_html_haml__944875441_29833656′
Note: If I switch back to SQLite I no longer get any of these errors.
I’m using Ruby 1.8.7 and Rails 3.1
Any ideas where I can start looking?
Let me know if there’s any additional information that you need.
I discovered the root of the problem. I used the ESF Database Migration toolkit to migrate my data from sqlite3 to Postgresql. The problem with this is that it doesn’t handle the conversion from sqlite3 to PostgreSQL properly and the auto incrementing nature of the rails generated id column doesn’t work in PostgreSQL as it does in Sqlite3. To fix this I simply needed to drop all the tables in my database, reset the database version to 0 and run a rake db:migrate while my database.yml is set to run off of the PostgreSQL database.