I try to use mongoid 3.x together with rufus-scheduler 2.x and im always getting a gem conflict over tzinfo.
Unable to activate mongoid-3.1.4, because tzinfo-1.0.1 conflicts with tzinfo (~> 0.3.22)
Looks like mongoid has some dependency on some legacy tzinfo version.
How can I solve this problem?
In your Gemfile, specify the version of TzInfo that suits Mongoid, before Mongoid and before rufus-scheduler (rufus-scheduler accepts any version of TzInfo).
source 'https://rubygems.org'
gem 'tzinfo', '0.3.22'
gem 'mongoid', '3.1.4'
gem 'rufus-scheduler'
UPDATE
Updated rufus-scheduler 2.0.x so that it accepts >= 0.3.22 (https://github.com/jmettraux/rufus-scheduler/commit/18c98010)
Unfortunately, can't seem to be able to push to RubyGems.org for now (it goes 500).
Until I find a workaround, you can point to that new rufus-scheduler with
gem 'rufus-scheduler', :git => 'git://github.com/jmettraux/rufus-scheduler.git', :branch => 'two'
UPDATE
Could push rufus-scheduler 2.0.24 to rubygems https://rubygems.org/gems/rufus-scheduler
It should be OK now.
Related
Specifically, this commit has been merged into mongomapper master to fix a bug that is causing my application to crash:
https://github.com/mongomapper/mongomapper/pull/572
However, it hasn't been released in a new gem. Is it possible to include it prematurely or do I have to wait until it's released? I'm on heroku with a Gemfile.lock that specifies version.
My gemfile.lock currently reads:
mongo_mapper (0.13.0)
activemodel (>= 3.0.0)
activesupport (>= 3.0)
mongo (~> 1.8)
plucky (~> 0.6.5)
I don't know about Heroku, but if you want to use a git version of a gem that is not on Rubygems yet, you must add the git path to your Gemfile.
In your Gemfile change:
gem 'mongomapper'
To:
gem 'mongomapper', :git => 'https://github.com/mongomapper/mongomapper.git'
Or if you're on a more modern ruby, you can also use:
gem 'mongomapper', github: 'mongomapper/mongomapper'
And of course after that you must run bundle install or bundle update mongomapper.
Since the Ruby code isn't compiled, if you have the notes for that patch you can always manually add those changes to the lib directory of the mongomapper gem, although I can't advise against this enough - it's undesirable to change the source code, especially underneath an installed gem.
Once you go down this road you can't really count on any support for related issues until you are updated to a newer version or reverted to the original files.
I'm new in the Ruby world. I created my first app using Sinatra, and I'm having some trouble on my production server.
When I run unicorn -c randmovie_unicorn.rb on my local machine, it works just fine. But in production, I get this error:
<module:Templates>': uninitialized constant Tilt::CompileSite (NameError)
In my randmovie_unicorn.rb file:
preload_app true
working_directory "./"
listen 8006
worker_processes 2
timeout 30
I'm not using HAML or anything similar.
Could somebody help me with that? Thanks!
I think it's a bug in tilt 2.0.0 or in sinatra.
Specify tilt version in your Gemfile:
gem 'tilt', '~> 1.4.1'
I had a similar problem.
Make sure you don't have tilt 2.0.0 installed, and that you have a version of tilt that sinatra does support. For some reason bundler does not respect sinatra's dependencies properly, so you have to specify them explicitly.
Current tilt dependency for latest version of sinatra (1.4.4 as of this writing) is
gem 'tilt', '>= 1.3.4', '~> 1.3'
I have a small ruby app that has been working. I am now getting a conflict error with builder. It looks like I updated my gems and now it is conflicting. I have it set in the Gemfile to use v2.1.2. But that is not working either. Thanks for any help you can give me.
Gemfile
gem 'builder', '2.1.2'
Bundler output
$ bundle
Using builder (2.1.2)
Using bundler (1.2.3)
$ bundle show builder
/Users/covard/.rvm/gems/ruby-1.9.3-p327/gems/builder-2.1.2
Conflict message
`raise_if_conflicts': Unable to activate actionpack-3.2.11, because rack-1.5.0 conflicts with rack (~> 1.4.0), builder-3.1.4 conflicts with builder (~> 3.0.0) (Gem::LoadError)
Figured out what my problem was even though I had my Gemfile I wasn't using it. Since rails handles that automatically I didn't know I had to add a require to use it. After adding this to my ruby files it worked perfectly.
require "bundler/setup"
I am using activerecord and feedzirra(RSS parsing library). activerecord needs activesupport v3.2.8 and feedzirra needs v3.1.1. When I use both of them at the same time, I get error that they are conflicting because both of them require different versions of activesupport (3.2.8 vs 3.1.1.
What are my options?
Thanks
Use the latest feedzirra, it doesn't depend on 3.1.1 afaik:
gem 'feedzirra', :git => 'https://github.com/pauldix/feedzirra.git'
I have a ruby script that scans each type of entity in a given tweet:
status = Twitter::Client.new.status(tweet[:id_str], {:include_entities => "1"})
status[:entities].each do |x|
#job on the entity
end
It was doing good until yesterday. Now I get NoMethodError: undefined method 'entities' for #<Twitter::Status:0x000001033e1800>
I can't figure it out since I've checked that status does include entities after the first line.
Any clues?
EDIT: turns out it's the new version of the twitter gem (v2.0.0) which is in cause. First I'd like to downgrade it to the last version working (v1.7.2), but I'm getting an annoying gem version error:
Bundler could not find compatible versions for gem "hashie":
In Gemfile:
topsy (~> 0.3.6) depends on
hashie (~> 1.0.0)
twitter (= 1.7.2) depends on
hashie (1.1.0)
How can I work it out?
If you need specific gem's version, you can forcely set it throught Gemfile:
gem "rack", "1.0.1"
gem "rails", ">=2.3.2"
In the end it was a conflict in the Gemfile:
gem 'topsy', '~> 0.3.6'
gem 'twitter', '1.7.2'
were requesting different versions of hashie, so I just deleted the version of topsy and it worked.