I am trying to $bundle install the obfuscate_id gem into my Rails 4 application, but I am coming across an error:
It says it's dependent on Rails > 3.2.1, but I have Rails 4.0.2. Am I wrong in assuming this should work? Have I missed something?
The gem: https://github.com/namick/obfuscate_id
Thanks,
Michael.
I had the same issue. RubyGems doesn't seem to have the most recent version, so I installed the gem from Github, which resolved it. Put the following code in your file:
gem 'obfuscate_id', :git => 'https://github.com/namick/obfuscate_id.git'
Related
i'm trying to make an scaffofold on rails V 5.2.1 but i have the following error
i already tried gem pristine --all
but not works thanks any help please
Try bundle install..
The error which I could see in scaffold is Rails couldn't find the gem nokogiri .. make sure that your gemfile has the gem and then try running it
I'm trying to upgrade to Rails 4.2 from Rails 4.1.9 and when I attempt to run the console or the server i get the following error. Any thoughts? I thought the html-scanner gem was included with Action::View
gems/activesupport-4.2.0/lib/active_support/dependencies.rb:274:in `require': cannot load such file -- action_view/vendor/html-scanner (LoadError)
The OP's issue (and mine) was to do with an incompatibility in the prototype-rails gem. This can be fixed by using the "4.2" branch of prototype-rails directly from github. Modify your Gemfile entry as follows:
gem 'prototype-rails', github: 'rails/prototype-rails', branch: '4.2'
Note that the prototype-rails gem will not be supported from Rails 5 onwards, so now would be as good a time as any to remove this dependency.
I believe they removed html-scanner from rails in 4.2 when they switched to rails-html-sanitizer according to the upgrade guide but it seems you can use the rails-deprecated_sanitizer gem to your Gemfile to then re-include the html-scanner library
gem 'rails-deprecated_sanitizer'
Hope this helps!
I've also had this problem on a legacy project. It's a bundler 1.17.3 / ruby 2.4 / rails 4.2.11.3 and it was driving me up the wall.
The following nasty hack worked:
Gemfile:
gem 'rails-deprecated_sanitizer'
gem 'prototype-rails', git: 'https://github.com/rails/prototype-rails.git', branch: '4.2'
but that wasn't enough. I then had to get rails-deprecated_sanitizer to appear where the gems wanted it.
So in my project, I created lib/action_view/vendor/html-scanner.rb:
require 'rails-deprecated_sanitizer'
require 'rails/deprecated_sanitizer/railtie'
require 'rails/deprecated_sanitizer/html-scanner'
(I doubt all three are needed, mind)
This depends on lib being in your load paths of course.
That fixed the problem, and I was finally able to reset the db and launch the server.
We are using this gem(https://github.com/smartinez87/exception_notification) with rails 3.2.11. We want to use following method "ExceptionNotifier.notify_exception(e)" from action of controller and from background process as mentioned on the wikie but we are getting following error
undefined method `notify_exception' for ExceptionNotifier:Class
We are installing 3.0.1 version of this gem.
gem "exception_notification", "~> 3.0.1"
Our rails version is 3.2.11 and ruby version is ruby 1.9.2p320.
Thanks
You're reading an API for notify_exception for a version that has yet to be released as a gem.
You can either point your Gemfile at the git repo
gem "exception_notification", git: "git://github.com/smartinez87/exception_notification.git"
or use the proper API call for 3.0.1
ExceptionNotifier::Notifier.exception_notification(request.env, exception,
:data => {:message => "was doing something wrong"}).deliver
The docs for 3.0.1 are here.
In your gem file just write this line
gem 'exception_notification' , '3.0.1'
and after that
bundle install
this works for me :)
I am having a problem getting an old Ruby on Rails 2 app that hasn't worked in a year to work.
I'm trying to run rake test:functionals in the root of my project directory, but am getting undefined method 'name' for "SystemTimer":String.
I've pasted everything that I believe relevant to the problem here:
http://pastebin.com/NgBvystZ
Also, when I run rake itself, I get
Errors running test:units!
Not sure how to debug that.
I have copied and pasted everything that I think would be useful to understanding this problem. Your time is greatly appreciated. Thank you.
This is an incompatibility between versions of RubyGems greater than 1.3.7 and versions of Rails less than 2.3.12. There are a few ways to solve this.
Use Bundler
Bundler is easy to install, fixes this problem, and has a number of other advantages as well. I highly recommend it.
Upgrade to Rails 2.3.12 or higher
Rails 2.3.12 fixed compatibility issues with RubyGems 1.8.5 (see release report).
Downgrade to RubyGems 1.3.7
I would not recommended this unless you have no other choice. Use this command: gem update --system 1.3.7. Also, version 1.7.2 has partial compatibility (it will run, but freezing gems will fail and there are likely other issues).
I chanced upon this thread, because I got the following error when migrating some Radiant 0.9.1 installations to a new server:
undefined method `name' for "RedCloth":String
(3) The compromising solution: I haven't tested this personally, but I hear that rails 2.3 with bundler is compatible with the latest rubygems. If you're interested in this solution, see http://gembundler.com/rails23.html for getting bundler to work under rails 2.3.
For me solution 3 was the only option, since we had other apps needing the latest rubygems on the system.
Just install bundler and follow thes steps on this page:
http://gembundler.com/rails23.html
And put this in a file called "Gemfile" in the app root:
source :gemcutter
gem "radiant", "0.9.1"
gem "sanitize"
gem "fastercsv"
gem "rmagick"
gem "rack", "~> 1.1.0"
gem "rake", ">= 0.8.3"
gem "RedCloth", ">= 4.0.0"
gem "will_paginate", "~> 2.3.11"
gem "mysql"
This is just my example. Start with only the first 2 lines, run bundle update and reload the page to see what else you might be missing.
Thank you Ben!
I have a rails app with the config/environment.rb line
config.gem 'authlogic', :version => '2.1.2'
The system gem for authlogic is 2.1.4
The one in my GEM_PATH is 2.1.2
No matter what I try, Rails is only using the 2.1.4 version, which is a problem. How to force rails to use 2.1.2?
Thanks
I recommend using Bundler
i've made a test here, included the gem authlogic, choose to use the 2.1.3 version, and the application ran without problems.
then i've uninstalled the gem (gem uninstall authlogic -v=2.1.3), and my application didn't ran anymore, normal behavior (i'm using rails 2.3.8 for this test)
you could try uninstalling and then installing the gem again
To be safe, uninstall your 2.1.4 version, freeze 2.1.2, then uninstall 2.1.2 too.
Unpack the gems into your rails app. This'll also help in deployment.
rake gems:unpack
Sys admin re-installed some gems and all the problems went away.