Rails 3.2 - Unable to load modules of initializers files - ruby-on-rails

Environment
Ruby [1.9.3p547]
Rails [3.2.22.5]
Devise [3.0.4]
When i run any rails or rake command for this application it is giving me below error
/config/initializers/devise.rb:3:in <top (required)>': undefined
methodsetup' for Devise:Module (NoMethodError)
If i comment file devise.rb and run rails command again.
/config/initializers/doorkeeper.rb:1:in `':
uninitialized constant Doorkeeper (NameError)
And so on if i comment doorkeeper.rb file it is giving me error for
/config/initializers/kaminari_config.rb:1:in `':
uninitialized constant Kaminari (NameError)
i can't get what is issue with my application i am unable to perform any rake or rails. its directly giving me error of uninitialized constant .
The ruby and rails version is very old. I don't want to upgrade it. Earlier i though it was issue of devise gem. but it must not be issue of devise gem.
Please help me if any one has idea about this type of error.
Thanks in advance

I think you have some installation issues. Please try to install from scratch.
Follow these steps.
Find version of bundler from Gemfile.lock
Install bundler with that version and continue with bundle install
Check for API_KEY and values in your initializers.
Check for Gem support for your Ruby version (as it is too old)

Related

bundle install does not work and says undefined methods (trying to install ruby on rails on ubuntu)

I'm trying to install Ruby on rails on my ubuntu, I've installed everything for Ruby on rails to work, I've created my ruby on rails project but when I run ruby server they say "run bundle install" but whenever I run it I get :
/snap/ruby/247/lib/ruby/3.1.0/rubygems.rb:1340:in `rescue in <top (required)>': undefined method `rubyforge_project=' for class `Gem::Specification' (NameError)
Loading the rubygems/defaults/operating_system.rb file caused an error.
Try to install ruby manually, rbenv, rvm and update RubyGems manually
Here is a good guide to walk you through the proccess
https://gorails.com/setup/ubuntu/21.04

rake failure ruby 2.7.0 "undefined method extend_object for class Singleton

I'm attempting to install Ruby on Rails version 5.0.0 using Ruby 2.7.0 on Ubuntu. Executing any rake command (eg, "rake --tasks") results in a large number of messages about already initialized constants (Etc::VERSION, Etc::SC_AIO_LISTIO_MAX, etc.) followed by
rake aborted!
NameError: undefined method `extend_object' for class `Singleton'
Did you mean? extended
The answer to Error when running rake db:create: undefined method `extend_object' for class `Singleton' suggests removing Gemfile.lock and re-executing bundle install, but this had no effect for me. Are there other fixes?
I had the same problem today, updating ruby to 3.0.0 seems to solve this problem. Ubuntu for some reason downloads version 2.7.0, I used this article to help me install ruby 3.0.0
https://linoxide.com/how-to-install-ruby-on-ubuntu-20-04/
You will obviously also need to change the version in Gemfile and ruby-version file.

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'

Install Redmine using ROR error?

I tried to install redmine in my localhost. I installed Railsintaller then i dowload svn code from redmine. I found steps to install redmine in localhost in the below link http://www.youtube.com/watch?v=ethtaYKdl9g.
I got following error in the middle of installation. I am new to this environment.
Kindly check the below screen shoot and help to fix this.
UPDATED MY QUESTION
C:\redmine>rake db:migrate RAILS_ENV="production"
WARNING: 'require 'rake/rdoctask'' is deprecated. Please use 'require 'rdoc/tas
k' (in RDoc 2.4.2+)' instead.
at C:/RailsInstaller/Ruby1.9.2/lib/ruby/gems/1.9.1/gems/rake-0.9.2.2/lib/rak
e/rdoctask.rb
C:/RailsInstaller/Ruby1.9.2/lib/ruby/1.9.1/rdoc/task.rb:30: warning: already ini
tialized constant Task
rake aborted!
uninitialized constant Gem::SyckDefaultKey
Tasks: TOP => db:migrate => environment
(See full trace by running task with --trace)
Redmine requires Rails 2.3.14, and by the looks of it you've installed Rails 3.1.1.
You must install Rails 2.3.14 using this command:
gem install rails -v 2.3.14
Regarding your second issue, the uninitialized constant Gem::SyckDefaultKeyerror has been fixed in http://github.com/rubygems/rubygems/pull/250. So you might want to update your package manager:
gem update --system
Before launching again your command.

generate migration error

I try to create a standalone migration file by executing the following command:
rails generate migration LoadData
But I got the following error:
PATH-TO/gems/activesupport-2.3.2/lib/active_support/dependencies.rb:55: uninitialized constant ActiveSupport::Dependencies::Mutex (NameError)
PATH-TO/.rvm/rubies/ree-1.8.7-2011.03/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:55:in `gem_original_require'
...
I am using Rails v2.3 and ruby Enterprise edition. Why I got this error, how to get rid of it?
This is an incompatibility between some version of Rails 2.3.xx and recent versions of RubyGems. I got this error with Rails 2.3.4 and then used a more recent version of Rails 2.3.11 as of now to get rid of this error.
In case it is not possible to update the Rails version, then in your RakeFile add in the beginning.
require "thread"
Downgrading the RubyGems version will also help. Afaik Rubygems version 1.3.5 is compatible with Rails 2.3.4 and 2.3.5.
Hope this helps.

Resources