ActiveAdmin Rails 3.1 Install Issue - ruby-on-rails

I am trying to use ActiveAdmin with rails 3.1, but I get the following error during rails generate active_admin:install I get the following:
gems/activeadmin-0.3.0/lib/active_admin/namespace.rb:176:in `eval': uninitialized constant InheritedResources::Base (NameError)
This happens with any generate/destroy commands now. I have made sure that I have added the required 3.1 gems (sass-rails and meta_search) per the install instruction on the github wiki. Does anyone have any ideas?

I ran into this too. Jose Valim released a new version 1.3.0 of the inherited_resources gem, and ActiveAdmin didn't pin the gem to the previous version 1.2.2. I was able to fix this issue by adding the following line to my gemfile:
gem "inherited_resources", "1.2.2"

Related

Spree Commerce Setup Error: "Unknown Version...(Runtime Error)"

I am going through the open-source Spree commerce tutorial. I am new to Ruby, so I just installed Ruby 2.7.2 and Rails 6.1. Unfortunately, Spree doesn't support Rails 6.1 yet, as described here: Bundler could not find compatible versions for gem “rails”.... So, I followed the solutions provided on that SO post and modified my Gemfile to set rails (and railties) to 6.0.3. That seemed to fix the error mentioned on that SO post...
But now when trying to run the command from the tutorial
"bundle exec rails g spree:install --user_class=Spree::User", I'm getting the error:
C:/Program Files/Ruby27-x64/lib/ruby/gems/2.7.0/gems/railties-6.0.3/lib/rails/application/configuration.rb:156:in `load_defaults': Unknown version "6.1" (RuntimeError)
Why is this happening, and how do I resolve this error?
Thank you in advance!
Get to the config/application.rb file in your app's folder and set the line with
config.load_defaults 6.1
to the below
config.load_defaults 6.0
The problem is, when you initially ran rails new command, the generators set the rails version to 6.1, which doesn't change when you specified 6.0.0 as version in Gemfile.

Bootstrap::FrameworkNotFound on heroku?

I am using rails 3.2 and have built an application on my development server and it is working fine. But when I deploy the same application to my heroku account I get this error:
/app/vendor/bundle/ruby/1.9.1/gems/bootstrap-sass-2.3.0.1/lib/bootstrap-sass.rb:18:in `load!': bootstrap-sass requires either Rails > 3.1 or Compass, neither of which are loaded (Bootstrap::FrameworkNotFound)
Does anyone know how to fix it. The bootstrap-sass gem is a dependency for the rails_admin gem.
Add this to your gemfile
gem 'less-rails'
Try this,it might work for you.I got somewhat similar error and i resolved using this.

Can't Reinstall Devise

I installed devise 1.1.rc0 and haven't been able to get it to work in my existing application.
I changed the gem file to gem 'devise' without specifying the version. Ran bundle install. Then ran rail destroy devise_install since that's the command I used to install it.
*Then when I tried to reintall with rails generate devise:install it gives me this error:
gems/activerecord-3.2.8/lib/active_record/dynamic_matchers.rb:50:in method_missing': undefined methoddevise' for # (NoMethodError)*
Ryan Bigg helped me figure out the above error was caused by the user model making a reference to devise, which after the uninstall causes an error. So I removed that reference.
Now I have this error.
gems/activesupport-3.2.8/lib/active_support/inflector/methods.rb:230:in `block in constantize': uninitialized constant User (NameError)
What is this referring to?
You're getting this error because Devise isn't configured, yet your model references it. Remove the call to the devise method (or comment it out) in any model that references it.
I found the same issue when upgrading from 1.8.7 and Rails 3.0.7 to 1.9.3 and Rails 3.2.8. The solution involves removing:
gem 'active_reload'

Rails 3.2.7 and Spree 1.1.2. When I try to access CART, there is debug info show that "undefined method `password_salt=' .."

I installed rails on Windows7 using RailsInstaller (v2.1.0). I found the original rails was v3.2.1. After that, I "gem install spree". It seems the installation upgrades rails to v3.2.7. I mentioned that because before yesterday it was just 3.2.6. Every thing goes well under rails 3.2.6, but if I "spree install" a rails 3.2.7 app, I failed to access the default store's Cart. And get the error like this:
NoMethodError in Spree::OrdersController#edit
undefined method `password_salt=' for #<Spree::User:0x68438d0>
As I checking the database, yes, there is no "password_salt" but only "salt" in spree_users table.
Is there anyone else encountered this problem? I had taken almost half day on this problem. Did I miss something in the Spree path?
Thanks very much.
I think I had the exact same issue before, see if specifying spree gem version (assuming is 1.1.2) in the Gemfile and then running bundle update works
#Gemfile
gem 'spree', '1.1.2'
and later run
bundle update
See if it works!

authlogic not working with rails 2.3

I am using authlogic gem. I was following the railscasts video for help
http://railscasts.com/episodes/160-authlogic?autoplay=true
I run into a problem when I do the
sudo rake gems:install
it gives me an error :
at /usr/lib/ruby/gems/1.8/gems/rake-0.9.2.2/lib/rake/rdoctask.rb
rake aborted!
(eval):1:in `define_callbacks': compile error
(eval):1: syntax error, unexpected tEQ, expecting '\n' or ';'
... def self.terminatorresult == false(*methods, &block) ...
^
I tried uninstalling the rake gem and installing it again.
I tried going to a lower version of rake and that also did not work.
What should I do here?
Do I need to edit the rake gem
and include this in there..
base.define_callbacks :persist, :terminator => "result == true"
I found the above on
http://pastebin.com/Q3eL53ZJ
If yes then how?
If there is a better solution then please guide me.
Make sure you are not trying to use the master branch with Rails 2.x it is only compatible with Rails 3.x.
Use the rails2 branch if you are on Rails 2.x, I actually just used an older version since I wanted to just maintain some legacy site without too much concern about upgrading gems. I used version 2.1.5 and it worked fine.
Good luck!
To fix this, I first removed all my authlogic gems:
gem uninstall authlogic
I'm using rails 2.3.15 because that is what hostgator is using. The authlogic version that matches is 2.1.3, so I added this to config/environment.rb:
config.gem "authlogic", :version => '2.1.3'
Then did rake gems:install. Afterwards, a script/generate controller user_sessions command actually generated the user_session.rb in model.

Resources