activeadmin formatting error on rails 3 app - ruby-on-rails-3

I recently migrated a rails 3 app from a Mac OS X environment to a Debian server. The migration succeeded, the app is running through the WEBrick server but the formatting that had originally come with the activeadmin gem has disappeared from most views. The form is still accessible and functioning but it is in the default html formatting.
However http://domainexample.com:3000/admin still has the custom formatting, any ideas of why this has happened?
In my troubleshooting:
reinstalled activeadmin with
rails generate active_admin:install
When I run
rake db:migrate
got devise errors so dropped the databases and ran
rake db:create
rails s still works and boots the server but
rake db:migrate throws an error:
Mysql2::Error: Table 'admin_users' already exists
UPDATE:
This fixed the problem, but I don't understand why.
had to copy the active_admin.css as active_admin.css.dup.css file from my local and upload it to the server version in app/assets/stylesheets. The server version was implementing namespaces for some reason.

Related

I can't migrate the database of my Rails app on Heroku with sqlite

I'm following this tutorial on creating Ruby on Rail apps, and I've hit a roadblock. I am trying to migrate its database to Heroku, only to be told this:
c:\Sites\railsbridge\test_app>heroku run rails db:migrate
Running rails db:migrate on floating-ocean-40882... up, run.5709 (Free)
rails aborted!
Gem::LoadError: Specified 'sqlite3' for database adapter, but the gem is not
loaded. Add `gem 'sqlite3'` to your Gemfile (and ensure its version is at the
minimum required by ActiveRecord).
I already have sqlite3 listed in my Gemfile, what am I doing wrong?
Heroku does not support sqlite and it is suggested to use postgresql for production
Please look into the following posts
Heroku deployment failed because of sqlite3 gem error
Deploying RoR app to Heroku with Sqlite3 fails
You can use Postgresql for production and the change should be simple. Just a change of gem in Gemfile and change in database.yml will do.
Heroku doesn't support SQLite it only support PostgresSQL here is full documentation for deployment on Heroku

How to convert rails 4 app's database from sqlite3 to postgresql?

I have tried multiple ways to convert my existing rails app's database from sqlite3 to postgresql. i tried converting my database.yml file's adapter to postgresql and running rake db:create and migrate but that did not work i tried adding gem 'pg' instead of sqlite3 but still does not work. I am not able to push my projects to heroku i always get an "application error" when i run my heroku web site.
Make sure that you have removed sqlite3 from your Gemfile, and run bundle.
You may need to do a heroku migration.
heroku run rake db:migrate

Pushing new Rails 3.1 app to Heroku causing problems with Sorcery mod (requiring bson-1.4.1)

I have an app that runs great locally. Everything seems to be set up correctly to transfer over to Heroku, including the Postgres gem (and dev was done using a postgres server).
The problem is, when I try to push it up, I get error messages surrounding the three currently problematic dependencies, bson_ext, bson, and mongoid, 1.4.1. It seems that Sorcery requires these (at 1.4.1) to run. I got them installed locally by downloading the manually, but they were yanked from the online sources. So when Heroku tries to find them, it can't, and it aborts. I tried specifying to use 1.4.0 for all of them, and the app then installs fine (and does the database setup stuff for the Cedar stack, etc).
The problem is that when I load the app on their server, I get the generic "oops, there's been a problem" Heroku message. Upon checking the actual heroku log, I can't really find anything wrong. What is the way to make this work?
Thanks for your help.
I ran into the same problem, and I was able to get past it by specifying version 1.3.1 for the mongo, bson, and bson_ext gems. I just put this in my Gemfile:
gem 'mongo', '1.3.1'
gem 'bson', '1.3.1'
gem 'bson_ext', '1.3.1'

"uninitialized constant ActionView::CompiledTemplates::GMap" error when using ym4r_gm plugin

So I am somewhat new to Rails 3, and I am trying to integrate Google Maps with my Rails application.
I installed ym4r_gm from git://github.com/rorcraft.ym4r_gm.git, and I followed the tutorial on http://blog.brijeshshah.com/google-maps-in-ruby-on-rails/, and http://blog.brijeshshah.com/google-maps-in-rails-3/ .
After following the tutorial, I tried to run my application but I get an error that says "uninitialized constant ActionView::CompiledTemplates::GMap" regarding the "<%= raw Gmap.header %>" line. I have already installed the ym4r_gm-0.2.0 gem, and the ym4r-0.6.1 gem. Any suggestions on how to solve this problem?
Make sure that the gems you're trying to use in your Rails app are actually included in your Gemfile as well as being installed on your local machine.
Check out Ruby Gems for the exact line to include in your Gemfile. In this case, it's:
gem "ym4r_gm", "~> 0.2.0"
When you push your code to a production server like Heroku, the Gemfile tells Heroku which gems to pull down and install on the server. Also run this command when you're done.
bundle install

Jruby 1.6.0.RC2 + Rails3 + Glassfish-gem = big fail

Having problems getting glassfish to even run on my server. jRuby is absoutely maddening to begin with, but this is killing me.
I have a pretty complex app, so I won't go into too many details, other than to say the Rails2 version is working under jRuby 1.5.1.
When I start and do the first hit on the server I get the following error:
Feb 19, 2011 12:20:14 AM com.sun.grizzly.jruby.RackGrizzlyAdapter dispatchRequest
WARNING: (NoMethodError) undefined method `call' for nil:NilClass
org.jruby.exceptions.RaiseException: (NoMethodError) undefined method `call' for nil:NilClass
at Rack::Handler::Grizzly.call(/usr/local/rvm/gems/jruby-1.6.0.RC2/gems/glassfish-1.0.3.dev-universal-java/lib/rack/handler/grizzly.rb:55)
I have tried starting glassfish every way since sunday and have also swapped out various gems. It seems bundler 1.0.10 also has some issues. It broke my Rails2 app.
Any insite anywhere as to where to even start looking would be appreciated.
The app works just fine when running webrick.
The jRuby stack still has a long way to go. Finally figured this debacle out. Turns out the rackup.rb file pulled into glassfish from an as yet unidentified source (I hacked it for now and moved on) has logic that only supports rack in development, test or production. I was using a multistage environment so I could test things out. I had a, shocker, staging environment. So this all worked fine under the old glassfish that detected and ran rails separately but created a host of issues for the rails3 application running with a config.ru rack file.
I will post an update to my blog when I get this nailed down correctly. You can't monkey patch this because glassfish loads from the installed gem location not your own project or even bundle repository.