743 questions
1
vote
0
answers
68
views
I am trying to configure and setup and old rails project (2.3.8) in ubuntu 20.04
I am trying to setup rails 2.3.8 project in ubuntu 20.04
Ruby version is 1.8.7
I have installed ruby and and rails of these version successfully.
But when i try to run server using command script/...
0
votes
0
answers
113
views
Model method called in controller returning "undefined method"
Working on some legacy code and essentially copying/pasting some functionality, but getting an error that isn't making sense to me.
In my controller I have a CASE statement setup that checks the for ...
1
vote
1
answer
97
views
Ruby on Rails 2.3 app unable to load files in lib and vendor directories (built in Docker)
I have been handed the unfortunate task of attempting to maintain a Ruby on Rails version 2.3 application (with Ruby version 1.9.3). I've successfully managed to build the environment and get it ...
1
vote
1
answer
40
views
Having trouble passings params to embedded action in view
Working on some legacy code (Rails v2.3) and I've become stuck.
I have a view that uses the embed tag to run an action that produces a PDF.
Copying code from the other working view in my project, I ...
0
votes
2
answers
50
views
Code runs well inside an initializer but breaks when called from another class
I have a little monkey patch to deal with some ruby 2.7 warning that are not needed, when I execute the code directly from the an initializer file it works pretty well, but when I move the code to the ...
0
votes
1
answer
126
views
I generated Action Mailer when I access my method inside mailer then showing me this error
Showing /home/abidullah/.rvm/gems/ruby-2.7.0@eyesol/gems/railties-6.0.3.6/lib/rails/templates/rails/mailers/email.html.erb where line #102 raised:
Do not interpolate String in a tag. Instead of <...
0
votes
0
answers
515
views
generating presigned url shows AuthorizationQueryParametersError
While creating the presigned url for my private image.png file in my s3 bucket, i used the below template
require 'aws-sdk-s3'
s3 = Aws::S3::Client.new(
region: 'us-east-1',
access_key_id: ...
2
votes
1
answer
579
views
RVM install 1.8.7 on Monterey 12.0.1 Fails
Has anyone gotten ruby 1.8.7 working on Monterey with RVM?
I've tried every solution reported out there and nothing seems to work for me. I know 1.8.7 is totally deprecated and unsupported but there ...
1
vote
1
answer
64
views
Rails 5: How to convert this named_scope to a scope
Simple question I hope.
How do I convert this named_scope line from a rails 2 app into a scope line for rails 5
original...
named_scope :effective_on, lambda { |date|
{ :conditions => ['(...
0
votes
1
answer
169
views
Where can I find the gem package for simplecov that are supporting ruby 1.8
I have a rather old ruby 1.8.7 + Rails 2.3.8 project which I still need to support. In the project there is a lot of unit test which I use.
And, I would like to have a code coverage report as I had ...
0
votes
1
answer
642
views
Get old value in before_save or before_update using "_was'
I am using Rails 2.3 and trying to have the submission date of a form changed only the first time that all required fields are filled.
Here's what I tried, both in before_save and before_update:
if ((...
0
votes
1
answer
1k
views
cannot load such file -- rails/commands (LoadError)
I am trying to setup a project that uses rails 2.3.2. In my Gemfile I have gem "rails", "2.3.2". Running bundle install outputs Using rails 2.3.2. When I try to run any rails ...
0
votes
0
answers
49
views
Join MySQL tables in ruby on rails 2.3.3 only if all rows from one table are in another table
I need to select all rows from table Client where Service has all certificates the Client needs.
Client
client_id
Service
service_id
Certificate
certificate_id
ClienCertificate
client_id / ...
1
vote
1
answer
239
views
Are there any alternative ways for find_each method?
I have been using Rails 2.3.5.
I would like to use find_each method, but it is not in the version.
Are there any alternative ways to use find_each method for Active Record?
0
votes
1
answer
221
views
Search by select query(or alternative) using array
get_srv_id = Service.find_all_by_objt_id(page_records.collect(&:objt_id))
From this request, I'm getting ID's that I need to check:
[5152, 3876]
The next step is to compare and select only those ...
0
votes
1
answer
311
views
How to prevent error filtering the request via Rack Middleware
Hi I am having an issue in my current project, often we are receiving an error, Current application is running on Rails2.3.5 and Ruby 1.8.7
(ActionController::MethodNotAllowed) "Only getrequests are ...
0
votes
1
answer
1k
views
How to get ruby class name when an exception is thrown in Ruby
Cracking down an age-old ruby application written in version 1.8.7
to log all the unhandled exceptions overriding rescue_action_in_public by rescue_action_in_public_with_custom. I can see the error ...
3
votes
1
answer
104
views
Why does my Rails 2 ActionMailer fail intermittently?
I'm relatively inexperienced and trying to maintain a web app built with Rails 2.3.X and Ruby 1.8.7. Users who create accounts with the app are supposed to receive an automated email with an "...
-2
votes
1
answer
252
views
How to use lower version of rails
I am working on a project that requires Rails 2.3.3. I have Rails 5.2.2 already installed in my system.
I am asking how to install Rails 2.3.3 and work on that project. Any links would be much ...
0
votes
0
answers
116
views
Why doesn't the stripe customer token gets saved in my database?
I'm currently taking the upskill tutorial "The Essential Web Developer Course"(currently on lesson 162) where i try to connect Stripe with a payment for a premium membership. This tutorial is working ...
-1
votes
2
answers
317
views
create a new table with one-to-many relationshiop
I have an old rails project using Rails 2 . There is already model class Student. In database, there is a table students. Now, I need to implement that each student can have multiple courses. Which ...
0
votes
1
answer
41
views
Rails 2.2 not using active record session, even though it's defined
After moving an existing rails 2.2 app to a new server, the app is now using a cookie session instead of an active record session. The old server is still running using the same repo and an active ...
0
votes
1
answer
94
views
Why is a legitimate user getting logged out Involuntarily?
I have an application built on Rails 2. If the user opens two instances of the same application(dev, uat or any two), it logs out while the person is active. Also this behavior is inconsistent. ...
5
votes
1
answer
901
views
What happen if i use ruby version 2.5.1 with rails version 2.3.18?
What happen if i use ruby version 2.5.1 with rails version 2.3.18 ?
I had rails application built on rails 2.3.18 and ruby 1.9.2p320,
I want to upgrade version of ruby only not the rails is it ...
0
votes
1
answer
60
views
Unicorn (4.9.0) + Rails (2.2.2) gives me always the same session_id - Do you know how to fix that?
I try to get an old Rails app running with unicorn.
The session is set to :active_record_store
So far so good...
I get on my machine with any browser ALWAYS the same session_id if I go to the app. ...
0
votes
0
answers
101
views
Rails 2 rendering view from nested controller
So i'm having problems rendering a view from a nested resource. Using rails 2.2.2 (I know, I know, ...)
routes.rb
map.namespace :admin do |admin|
admin.resources :user
end
controllers/admin/...
0
votes
0
answers
40
views
Custom Environment in rails 2.3 - Fedena
I have created a custom environment in rails 2.3(Fedena) by copying the file content under config/environment/production.rb and also added env key in database and other ymls. Db creation and migration ...
4
votes
3
answers
3k
views
Failed to push to Heroku (Ruby 2.3.4)
I keep getting this error while trying to push to heroku. Didn't have any problem a couple of days ago and I made no changes to my gemfile.
Here is the error that I'm getting when I push to heroku. ...
1
vote
1
answer
725
views
Default the checkbox to unchecked in Rails 2.3
I am updating a Rails 2.3.18 legacy application. For some reason, the following code is giving me a checkbox that is checked instead of unchecked. This happens even when I turn off javascript, so I ...
1
vote
1
answer
2k
views
ROR - The Phusion Passenger application server encountered an error while starting your web application
When i upload my ROR code in server and run my website that time i face this type of error.
The Phusion Passenger application server encountered an error while starting your web application.
Because ...
1
vote
1
answer
340
views
NoMethodError (undefined method `new_payment_model' for nil:NilClass) in ROR Version 2
I have a face error in ROR version 2, NoMethodError (undefined method `new_payment_model' for nil:NilClass) here is my code
class Authorization < ActiveRecord::Base
belongs_to :franchisee
...
0
votes
0
answers
34
views
Is there a way to apply a method to the ones that follow it?
I'm a newbie working on making minor updates to a Rails 2 app. The StaticpageController is there to work with a content management system. Basically, there's a SQL database that holds a bunch of HTML ...
1
vote
1
answer
198
views
javascript_include_tag not working in rails 2?
The rails tag to include javascript , and for browser caching:
<%= javascript_include_tag '/skin/js/html5.js', :cache => true %>
forget about caching simple javascript_include tag is also ...
1
vote
0
answers
111
views
cannot load such file -- 2.3/bcrypt_ext which worked before in the file
I've started a project and I ran into a massive issue with bcrypt.
It worked perfectly fine before (it broke even on a backup file of a previous version).
Here's my error when I try to create a ...
0
votes
1
answer
466
views
Fetch records from multiple tables by JOIN in rails 2
I have my records set up as follows
UserKycScanResults: id, user_kyc_scan_id, match_name <- belongs to UserKycScan
UserKycScan: id, user_id, created_at <- belongs to User
User:...
0
votes
2
answers
41
views
Issue regarding fetching some records from table in rails
I have a User model. Now I have an array named id_array containing certain ids such as:
id_array=[123,145,229]
Now is there any rails way to get only those records from users table with these ...
0
votes
1
answer
666
views
Issue regarding automatic logout from all active sessions across all browser in rails 2
I have an existing rails 2 app where I need to introduce the following feature of automatic logout from all session of the logged in user after successful password reset. The devise gem is used over ...
0
votes
0
answers
192
views
Unable to process AJAX request, getting 404 (Not Found)
I am using rails 2.3.18 and I am calling a controller method via ajax from a partial page. My controller name where the target method resides is ReportsController. I just want to print the params in ...
2
votes
1
answer
834
views
Rails form field validation and click handler
I have a form_tag with some mandatory fields as below
<% form_tag url do %>
<%= text_field_tag "user[name]", user[:name], :required => true %>
<%= submit_tag 'Continue', :...
2
votes
1
answer
2k
views
ActiveRecord::SerializationTypeMismatch: attribute was supposed to be a Hash, but was a String
To get a hash I have this:
serialize :colors, Hash
But I have an error where it the result of this attribute looks like this:
To show this I took out the "Hash" from "serialize :colors, Hash" to see ...
1
vote
0
answers
157
views
Rails routing alias
I'm using Rails 2.3.16 and Ruby 1.8.7
I have the next routing:
map.namespace :controller1 do |c1|
c1.resources :controller2, :member => { :action1 => :get, :action2 => :get }
end
Now, I ...
0
votes
0
answers
218
views
Not able to start the delayed job in aws server for rails 2 application?
Due to some technical issues, we stopped the AWS server and when we started the server all delayed jobs are showing in the queue, none of the delayed jobs is running on the server, so I need to start ...
0
votes
1
answer
47
views
Sort the manualy created array of active records by created_at
there I am working with rails 2. I am having manually created array having different values of active records, I want to sort the array by created_at, but not getting any clue, I am stuck. Please help
...
0
votes
1
answer
412
views
Not Able to install gems in Rails 2.3.8 & Ruby 1.8.7?
First Of all Thanks in advance :)
When I try to install the gem in rails application so it shows error like below.
$ rake gems:install
Invalid gemspec in [/home/aspireedge/.rvm/gems/ruby-1.8.7-p374/...
0
votes
1
answer
167
views
Having with SMTP error in rails application
I am having the following error in rails while using the normal smtp:
Net::SMTPFatalError (554 Message rejected: Email address is not verified. The following identities failed the check in region US-...
0
votes
1
answer
261
views
Change Reset password url in Rails 2
Rails:2.3.7
Ruby:1.8.7
I want to change reset password URL. I set default URL in development.RB but it shows localhost.
def create
@user = User.find_by_email(params[:email])
if @user
@...
1
vote
1
answer
1k
views
How to call and Handle request third party API in Ruby on Rails 2.3.5
I want to use third party API and want to make a put and post request and get the response from API in my Rails Application
Ruby and Rails Version of My Application is Below -
Current Version of ...
0
votes
0
answers
245
views
ActiveRecord::ConnectionNotEstablished and load_missing_constant:NameError: uninitialized constant Rails::Railtie
I've spent the better part of two days on this, and things keep getting broken. It started when I added a couple environment variables to my .zshrc file, and then my installations of Rails stopped ...
1
vote
0
answers
618
views
Ruby on Rails - dependency injection conundrum
I'm working on a Rails 2 app and the lack of a dependency injection container has me wondering about dependencies and their impact on unit testing. I have the following:
Controller
def some_action
...
0
votes
6
answers
67
views
Ruby query need to update
Relationship:
account has_many users
user has_one sima
primary_partner_id is "account_id" which is passing as params.
User.where(primary_partner_id: 2).map{|a| a.sima}.reject{ |e| e.to_s....