vestal_versions GEM error -Cannot define multiple 'included' blocks? - ruby-on-rails

I am trying to use the GEM "vestal_versions" for version control in my Ruby on Rails application,
ruby 2.1.2p95 (2014-05-08 revision 45877)and Rails 4.1.1 with postgresql as back end.I followed the steps mentioned in
enter link description here
but am getting some error while doing data base operations.ActiveSupport::Concern::MultipleIncludedBlocks: Cannot define multiple 'included' blocks for a Concern
.how to rectify this error?

That repository needs updating. The pull request is here with the fix. You can find a working version at https://github.com/altagem/vestal_versions/tree/rails-4_1
Add this line of code to your gemfile and you should be good to go.
gem 'vestal_versions', :github => 'altagem/vestal_versions', branch: 'rails-4_1'

Related

What's the replacement for acts_as_commentable in Rails 6, Ruby 3.0.2?

I upgraded our app to Rails 6.1.4.4 and Ruby 3.0.2. I have this old gem
gem 'acts_as_commentable'
Locked at version 4.0.2. The gem does not appear to be supported anymore, which is a shame because when I start up my app or console, I now get this error
$ rails c
Your Gemfile lists the gem rspec-rails (>= 0) more than once.
You should probably keep only one of them.
Remove any duplicate entries and specify the gem only once.
While it's not a problem now, it could cause errors if you change the version of one of them later.
/Users/myuser/.rvm/gems/ruby-3.0.2/gems/hash_dot-2.5.0/lib/hash.rb:19:in `method_missing': undefined method `arity' for {:as=>:commentable, :dependent=>:destroy}:Hash (NoMethodError)
from /Users/myuser/.rvm/gems/ruby-3.0.2/gems/activerecord-6.1.4.4/lib/active_record/associations/builder/association.rb:53:in `build_scope'
from /Users/myuser/.rvm/gems/ruby-3.0.2/gems/activerecord-6.1.4.4/lib/active_record/associations/builder/association.rb:47:in `create_reflection'
from /Users/myuser/.rvm/gems/ruby-3.0.2/gems/activerecord-6.1.4.4/lib/active_record/associations/builder/association.rb:32:in `build'
from /Users/myuser/.rvm/gems/ruby-3.0.2/gems/activerecord-6.1.4.4/lib/active_record/associations.rb:1458:in `has_many'
from /Users/myuser/.rvm/gems/ruby-3.0.2/gems/acts_as_commentable-4.0.2/lib/commentable_methods.rb:58:in `acts_as_commentable'
…
Is there any simple replacement for this gem or way to monkey-patch this error so I can start up the app?
Looking over the forks, I found this one that appears to work for me using Rails 6.0.6 and Ruby 3.0.5.
https://github.com/alazycoder101/acts_as_commentable.git
I have not tested it extensively yet, but at least the basic functionality seems to be working for me. Hope this helps.
For clarity, to use that fork you would use the following line in your Gemfile:
gem 'acts_as_commentable', git: 'https://github.com/alazycoder101/acts_as_commentable.git'

problems with ruby gem ns-api

I am trying to build an app in Rails. For my app I need to use the ns-api (dutch railways) in order to get from them the trains timetables. It exists as a gem (https://github.com/zilverline/ns-api) I use the bundler and I get the message that all the gems are ok, but when I am trying to create a controller it gives me the error that it does not recognise NSclient . This happens also when I use "require 'ns_client'" in my controller or in my configuration file. I think that although the bundler seems to work , the gem is not compatible with my Rails (ver 5.0.0) or my ruby version. Any way that I could solve this ?

Does RUBY on RAILS 4.0.2 work with MS SQL Server Express?

I've googled this to death and I'm just going around in circles.
I'm on a Windows Server 2008r
I installed and put the following in my Gemfile
gem 'ruby-odbc' # I think the version is the.9999 one?
gem 'tiny_tds', "~> 0.6.1"
gem 'activerecord-sqlserver-adapter' # I've tried a few versions of this 3.2.8 and 4.0
I get varying errors depending on how many times i've bundle installed or updated
Errors include activesupport and activerecord versions not found. They are installed
Or I get alias_method errors.
Can someone just point me in the right direction of what I should do. Some discussions seem to think that there is nothing that works at the moment. Would downgrading to an older Rails work? If so how and which version?
activerecord-sqlserver-adapter hasn't been released for Rails 4.0 yet but the gem is 95% ready. You can use put it in your Gemfile like this:
gem 'activerecord-sqlserver-adapter', github: 'rails-sqlserver/activerecord-sqlserver-adapter'
For a description of the outstanding work take a look at Failed Tests & Segfault on this pull request.

EventCalendar table bulider is not installing in rails 4

I am having problem in full_calendar table builder.and i am using rails 4.I have used following command . **rails plugin install git://github.com/p8/table_builder.git
** I got error like **/usr/local/rvm/gems/ruby-2.0.0-p247#ruby2/gems/activesupport-4.0.0/lib/active_support/dependencies.rb:228:in `require': cannot load such file -- rails/commands/plugin (LoadError)
**
And My view look like
It won't showing in table format. Please help me....
Use the gem instead of the plugin. Also I don't think that repository is active anymore, there is an alternative listed on the readme; and it doesn't look like table_builder has been updated for rails 4 so you might encounter other issues.
This is the updated repo: https://github.com/watu/table_builder
Add it to your gemfile & run bundle install:
gem "watu_table_builder", :require => "table_builder"
If you're using a tutorial for an older version of rails note that there are some things that will bite you -- (plugins, strong paramenters, Model.all, etc)

gem version dilemma with rails 3.1

I want to use ebayapi gem (https://github.com/codyfauser/ebay) with my rails 3.1 application.
If I add the gem in the Gemfile, rails doesn't run.
/Users/ssk/.rvm/gems/ree-1.8.7-2011.03/gems/money-1.7.1/lib/support/cattr_accessor.rb:7:in `cattr_reader': undefined method `id2name' for {:instance_writer=>true}:Hash (NoMethodError)
I removed the ebayapi gem and tried "require 'ebay'" but it said that "no such file to load".
Ebayapi gem works only with money 1.7.1 and I think that conflicts with rails 3.1 (maybe 3.0 as well).
Is there a way to workaround?
Thanks.
Sam
If it's truly incompatible, and you're up to fixing it yourself, then fork the projects in question on github, and update your Gemfile to point to your git repo (or even a local path to make editing a lot easier).
Here's an example:
gem 'money', :path => "~/dev/ruby/gems/money"
# or
gem 'money', :git => "git://github.com/my_account/money.git"
Once you've fixed it, send a pull request to the original project so they can include the fix.

Resources