Rails 4 and gem (will_paginate) not deploying correctly - ruby-on-rails

I am working with Rails 4 and I am using this library for my pagination, but I have a problem when I deploy to production, I see this error:
/home/deployer/apps/app/shared/bundle/ruby/1.9.1/gems/activesupport-4.0.0.rc1/lib/active_support/dependencies.rb:228:in
require'/home/deployer/apps/app/shared/bundle/ruby/1.9.1/gems/activesupport-4.0.0.rc1/lib/active_support/dependencies.rb:228:inrequire':
No such file to load -- will_paginate/array (LoadError)
In development this library is working but in production I have this error, I was searching for this error on Google but I can't find a solution.
Do you have any idea what may be wrong? Let me know when you find out please.
Thanks for you help.

First things first, check that the will_paginate gem is enabled for production in your Gemfile. It may be under the :development group only.

Related

Getting error cannot load such file -- dry/types/compat/form_types (LoadError) while updating bundle in my project

Getting error
/home/sachin/.rvm/gems/ruby-2.3.4/gems/activesupport-4.2.11.1/lib/active_support/dependencies.rb:274:in `require': cannot load such file -- dry/types/compat/form_types (LoadError)
While trying 'bundle update' in one of my project.
i have gem 'dry-validation' in my Gemfile
please let me know what is causing this issue because before bundle update it was working fine but now i can not start my rails project.
After commenting the below code it's working fine.
require 'reform/form/dry'
Reform::Form.class_eval do
include Reform::Form::Dry
end
I'm not entirely sure what versions of the gems you are using but this might be your problem.
https://github.com/trailblazer/reform/issues/500
I used the following in my gemfile, to solve the issue i had. Hopefully version 2.3.0 will be released soon.
gem 'reform', github: 'trailblazer/reform', branch: 'v2.3.0.rc2'
Also as a side note, when using 'dry-validation' make sure NOT to use the gem reform-rails as stated in the readme

Gem NameError when called from other gem

I'm trying to get PartyFoul set up on a Rails project I collaborate on and am running into a weird issue when I run the install generator.
~/.rvm/gems/.../party_foul-1.5.4/lib/generators/party_foul/install_generator.rb:21:in `rescue in create_initializer_file': uninitialized constant PartyFoul::InstallGenerator::Octokit (NameError)
from ~/.rvm/gems/.../gems/party_foul-1.5.4/lib/generators/party_foul/install_generator.rb:17:in `create_initializer_file'
The script is having trouble finding the Octokit gem so if I put require 'octokit' at the top of install_generator.rb, everything is happy. The weird part is that I can't replicate this issue on a clean Rails 4 or Rails 3.2 project that simply has PartyFoul installed, so it must be specific to this project, and while I can get the configuration file set up manually, I'd like to figure out what root cause of this problem is.
Any help would be much appreciated, thanks!
I just figured it out, the PartyFoul gem was in the :production group so I'm assuming that Rails was somehow not loading it properly. I replicated the NameError in the clean Rails project after moving the gem to :production, so that seems to be the difference. I'm not sure what the root cause is, any enlightenment would still be appreciated :-).

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)

spree_i18n integration

I'm trying to get the spree_i18n gem working, but am not quite getting it.
I've added this to the Gemfile:
gem 'spree_i18n', :git => 'git://github.com/spree/spree_i18n.git'
I'm using RVM, so bundle installed it to:
~/.rvm/gems/ruby-1.9.3-p125#spree/bundler/gems/spree_i18n-e5e3e189c843
instead of the usual location at:
~/.rvm/gems/ruby-1.9.3-p125#spree/gems/
so I'm not sure if RVM is doing something weird.
But running any of the rake spree_i18n:xxx commands results in the following error:
'Don't know how to build task 'spree_i18n:new'
I'm guessing it's because the gem isn't getting picked up by rake and the app. I was thinking that the app should have picked up on the .yml translation files from the gem folder so I would not need to copy them over to the main app folder.
As a quick fix, I copied over the .yml files from the gem folder to the app config/locales folder. It works but definitely feels like a hack.
Can someone please point me in the right direction to integrate this gem correctly?
I've also posted the question here, in case, there's additional information that might help to solve this.
https://groups.google.com/forum/?hl=en&fromgroups#!topic/spree-user/6ycWGfm6eTk
Thank you for your time!
see related closed issue on github
https://github.com/spree/spree_i18n/issues/171

Unable to generate friendly_id from gem

I'm trying to use Friendly ID to handle slugs in my Rails app. When I run "rails generate friendly_id", I get the following error:
/usr/lib/ruby/gems/1.8/gems/activesupport-3.0.3/lib/active_support/dependencies.rb:239:in `require': no such file to load -- babosa (LoadError)
However, the babosa gem is definitely installed.
How can I even begin to solve this?
I was able to fix the problem by installing Bundler and adding the following lines to "Gemfile" in the root of my app:
gem 'babosa'
gem 'friendly_id'
I've not seen this problem myself, but have you tried the Google Group for the gem? It looks like that's the author's preferred communication method, and he looks to be fairly responsive there.
http://groups.google.com/group/friendly_id

Resources