I'm having an issue with upgrading an old rails app to the latest one. My knowledge of rails is limited. As far as i'm aware, i'm running ruby 3.1 with rails 7.
ArgumentError: unknown keyword: :klass
/home/dan/.rvm/gems/ruby-3.1.2/gems/arel-9.0.0/lib/arel/table.rb:15:in `initialize'
I've looked around and found this problem mentioned here however i'm already running the latest version of it i thought? I'm not 100% sure on where i'm supposed to look at this point.
Arel is now a part of ActiveRecord so you no longer need the arel gem in your Gemfile. Removing that should get past this problem
Related
An application I work on is using Rails 3.2.18 and Active Record 3.2.18. It was using Ruby 2.0.0, but someone from DevOps needed to upgrade to Ruby 2.2.4 today. Once users started making traffic on the site, everything started to explode. The administrators can't even access Active Admin.
After digging into this for quite some time, I realized I was thrown off by an error I was constantly seeing:
NoMethodError: undefined method `name' for nil:NilClass
Since some of my models have a name attribute, I assumed this was the culprit.
Long story short, the issue is with calling size on an Active Record has_many relation that has not yet been loaded into memory. Here is how I can demonstrate this in Rails' console:
model_instance = MyModel.find(12345)
model_instance.some_relations.size
# the error from above will be thrown (nomethoderror on name: for nil)
model_instance.some_relations
model_instance.some_relations.size
# it works fine and produces expected output
Also, model_instance.some_relations.count will always work (though I do understand the differences between count and size).
I have found surprisingly little on this issue. There is a related GitHub issue here, but I can't prove it's the same issue I am having.
I am going to rollback my release which upgrades to Ruby 2.2.4 for now, but was wondering if anyone can shed some light on this. Is there a bug between Active Record 3.2.18 and Ruby 2.2.* ? Is the only solution, assuming I need to upgrade to Ruby 2.2.4, to upgrade Rails as well?
This is indeed a conflict between Rails 3.2.18 (and a few other patch versions) and Ruby 2.2.*. It is documented here.
Aside from updating to a supported version of Rails, which may not be viable solution for some production applications, the Rails version could be updated to branch: 3-2-stable.
I've recently upgraded to Rails 4.2.0 and MiniTest ~> 5, and that broke the Turn gem. I noticed that it is no longer being maintained due to the developers getting fed up with API changes https://github.com/turn-project/turn , so I pulled it out of my project.
I'm really missing the better test output that Turn provided. What are some great alternatives to get customizable, colorized, well-structured MiniTest output?
Take a look at minitap and tapout - it's not a simple plug-and-play gem like turn was, but you can get it very nice with a bit of trial and error.
Attempting to run migration for my Rails app pixel_paisan is getting an error reading; NoMethodError: undefined method `boolean_label_class=' for SimpleForm:Module. Gist for the trace at https://gist.github.com/nbarnes/9796454dc28be9792284. Source code for error-production app at https://github.com/nbarnes/pixel_paisan.
I've tried uninstalling and reinstalling simple_form, doesn't help. Update entire gemset, doesn't help. Different ruby versions via RVM, doesn't help. Plain vanilla Rails app, created in an attempt to reproduce the bug works fine. Google doesn't know about my issue.
Does anybody know anything about this? I'm rapidly running out of angles to attack it from.
Short answer: update your simple_form gem to 3.1.0+. You have simple_form (3.0.2)
Longer answer: See https://github.com/rafaelfranca/simple_form-bootstrap/issues/44 which seems to be someone who had the same issue where the answer is to upgrade to simple_form 3.1.0+ whereas your Gemfile has simple_form (3.0.2)
I am using I18n with Redis store, and have a strange behavior after updating to Rails 3.2.13
[6] pry(main)> I18n.t("my_website_field")
=> "M"
[7] pry(main)> $redis.get("en.my_website_field")
=> "\"My website\""
I am getting only the first letters of the translations
To my knowledge I believe that redis-store has issues with certain versions of Rails (3.2.13 happens to be one of those).
Since I was really curious about why this would be happening I opened up the Github change log and took a look at the logic they changed in the 3.2.12 -> 3.2.13 update.
The main change that I noticed was the dependency chain in ActiveSupport for i18n.
The code was changed FROM
s.add_dependency('i18n', '~> 0.6')
TO
s.add_dependency('i18n', '= 0.6.1')
The only other changes were (from the changelog):
Add i18n scope to `distance_of_time_in_words
So if I had to take an educated guess I would say that the forcing of the use of i18n to 0.6.1 created some type of conflict with redis-store.
Note: I will continue to look into the issue with the change logs to i18n and post if I have any more information on the subject.
Can't find the specific issue in commit history and they don't keep a changelog (havent for 3 years :/) but I'd be curious to see if forcing the old version control would allow i18n to function properly.
I've been following ryan baytes screencast #170 and adding ruby-openid, authlogic and authlogic-oid to an existing authlogic authentication system.
However, I keep getting the following stack of errors:
NameError (uninitialized constant OpenIdAuthentication::InvalidOpenId):
/Library/Ruby/Gems/1.8/gems/authlogic-oid-1.0.4/lib/authlogic_openid/session.rb:53:in openid_identifier='
/Library/Ruby/Gems/1.8/gems/authlogic-oid-1.0.4/lib/authlogic_openid/session.rb:47:incredentials='
authlogic (2.1.2) lib/authlogic/session/foundation.rb:28:in initialize'
authlogic (2.1.2) lib/authlogic/session/password.rb:140:ininitialize'
authlogic (2.1.2) lib/authlogic/session/activation.rb:48:in initialize'
authlogic (2.1.2) lib/authlogic/session/klass.rb:61:ininitialize'
authlogic (2.1.2) lib/authlogic/session/scopes.rb:79:in initialize'
app/controllers/user_sessions_controller.rb:10:innew'
app/controllers/user_sessions_controller.rb:10:in `create'
Is there anyone who's facing the same kind of problem? I'm using rails 2.3.4
I've tried binary's example app which is working perfectly well (rails 2.1.2), I've tried the code provided by Ryan Bates and it is working well too (rails 2.3.2). So, the libraries are working with previous versions of rails.
Any clues?
rails/open_id_authentication plugin has been updated a few days ago and it breaks compatibility with the authlogic_openid gem (v=1.0.4).
Youl'll have to wait until someone fix the authlogic_openid gem (the issue)
I have found this:
http://futureadapter.com/2009/11/13/authlogic-plugin-errorfix/
But I don't know how to apply this code ( were to I put it ? ) so that it fixes the authlogic_oid problem.
Can anyone check it out and see how to apply it?
Thanks.
Check this out:
http://testingauth.heroku.com/
Authlogic setup with openid and jquery selector.
Source:
http://github.com/shripadk/authlogic_openid_selector_example
Briefly... no
i guess there are too many dependent libraries and debugging the problem took a bit of time, so we shifted to using masquerade, making the app itself an openid provider.