I have a script that uses Watir to retrieve information from Web pages. It works fine as a standalone script. Now I would like to create a Padrino Rake task based on it, and attempt to run the script results in an error:
can't activate activesupport (= 2.3.9) for "firewatir-1.6.7", already activated activesupport-3.0.3 for "padrino-core-0.9.19"
I understand the reason for the problem: Firwatir demands an older version of activesupport. But can this demand be overruled?
have you tried padrino-core-0.9.15? it uses activesupport 2.3.8
gem install padrino-core -v 0.9.15
that would be the first thing I'd try.
Dave
Related
I'm just trying to use the simple career_builder gem and just get it imported by running the simple script:
require 'career_builder'
puts 'Hello world!'
and yet get the following error: /Library/Ruby/Site/2.0.0/rubygems/dependency.rb:315:in 'to_specs': Could not find 'activesupport' (~> 2.3.5) - did find: [activesupport-4.2.1,activesupport-3.1.12,activesupport-3.0.3] (Gem::LoadError)
I installed the gem with gem install career_builder and ran bundle install and even updated activesupport to the most recent version, but for some reason, the program can't find the newer version of activesupport. Does the gem require version 2.3.5?
http://guides.rubygems.org/patterns/
The ~>or 'twiddle-waka' is a ruby gems shortcut to specify the earliest version of the gem you can use without letting you go up to the next major release.
Your gem is being a bit unorthodox and also specifying a patch level.
So the gem_specification you're working with (activesupport' (~> 2.3.5)) really means minimum version of 2.3.5 maximum of the last patch released before 2.4.0.
The activesupport versions you have installed are all for subsequent major releases and won't work. Install something between 2.3.5 and 2.4.0 and you should be good to go.
Yes. It does require Active Support version >= 2.3.5 and < 2.4.0. All of your Active Support versions are > 2.4.0.
~> is called the spermy operator. See Meaning of tilde-greater-than (~>) in version requirement?
The gem has not been updated in 4 years, so it uses Rails 2.
FWIW, I don't think you'll have much luck getting it to work, so you may want to find a similar gem that works with Rails 4 and has been updated within the last few months.
Pulling my hair out on this. I'm running some rspec specs through rake using rspec's rake task. Its been working fine until I started getting this error message:
rake aborted!
LoadError: cannot load such file -- rspec/core/rake_task
Here is the results of gem list | grep rspec
rspec (3.1.0)
rspec-core (3.1.7)
rspec-expectations (3.1.2)
rspec-mocks (3.1.3)
rspec-support (3.1.2)
and here is the line I'm using to include the rake task in my Rakefile
require 'rspec/core/rake_task'
I uninstalled all rspec gems and re-installed. Same error. As I mentioned I've been running these tests for a few months now without issue. There have been no changes to the environment and it runs in a VM so I can ensure it wasn't a coworker. What am I missing?
EDIT
I double checked my Gemfile.lock file all the gem versions are matching with the one in the upstream repo.
First off, I recommend running your specs through the rspec command. It's far more flexible than running specs through rake and has less overhead. Running the specs through rake is still useful as part of a build pipeline (the kind of thing rake is good at).
You haven't provided sufficient information to definitely answer your question, but I can provide some suggestions:
Are you running rake via bundle exec rake? Bundler is designed to manage the load path at runtime after it installs your gems, and should ensure that the installed rspec-core/lib is on your load path.
You can add puts $LOAD_PATH.join("\n") to the top of your Rakefile to see what the load path is. Is rspec-core in the list anywhere? (I suspect it's not). If it's not, then require 'rspec/core/rake_task' is not going to work unless rspec-core is installed as a system gem. Use gem which rspec-core to see if it's installed that way.
I'm trying to start a rails application in IntelliJ with the Ruby plugin.
I've imported the application and set up the run configuration as best I can. When I try to run it I get the error:
NoMethodError: undefined method `version_requirements' for #<Gem::Dependency:0x7de21f45>
When looking for an answer I found this page saying that I should do this:
$ gem install rubygems-update -v='1.4.2'
$ gem uninstall rubygems-update -v='1.5.0'
$ update_rubygems
Since it's IntelliJ's ruby plugin that is managing the gems, I assume that I have to change the version of rubygems-update that the plugin is using.
Is this the right approach to take? And if so, can anyone tell me how to go about it?
I tried listing the gems but that gem is not shows so I must not be listing the gems in the right place, but I don't know where to look.
Many thanks :)
IntelliJ IDEA cannot handle it, you will need to install the appropriate rubygems version from the command line.
Note that your current rubygems-update version may be different, verify it with gem list and use the reported version when uninstalling.
I have created a very basic Rails 3.1 app, deployed to a box that runs Ruby 1.8.7 (P334) (I can't easily go to 1.9.2. there unfortunately).
After deploying and running 'bundle install' I tried to run a console:
bundle exec rails console
And I get:
Could not find rack-cache-1.0.3 in any of the sources
and the console does not come up.
It seems that this particular version of rack-cache is listed as a dependency by ActionPack 3.1.0.
Can someone explain to me what I need to do to resolve this, i.e. get bundler to attach this version of rack-cache to the project?
Also I read that bundler stores the project-specific GEMs 'somewhere else', i.e. no longer in the global Ruby GEM path. Is there a default location for this project specific place ?
Oh and I also keep getting heaps of 'invalid gemspec' warnings with Rails 3.1, i.e.:
Invalid gemspec in [/usr/local/lib/ruby/gems/1.8/specifications/rack-cache-1.0.3.gemspec]: invalid date format in specification: "2011-08-27 00:00:00.000000000Z"
Ran into this issue when upgrading my Rails 3.0 app to 3.1.
Edit the /usr/local/lib/ruby/gems/1.8/specifications/rack-cache-1.0.3.gemspec file and set s.date = %q{2011-08-27}. This will fix your problem.
I'm using Bundler for the gem dependency management.
Is there a way to get a notification when a new gem of a gem specified in Gemfile available?
While I don't think there's a way to directly monitor your Gemfile, RubyGems' website lets you subscribe to multiple gems if you create an account and log in. Then you could subscribe to the RSS feed (assuming you use an RSS reader) and know every time a new version comes out.
The command bundle outdated will tell you which gems can updated in your bundle. For more information on how to use the command take a look at the help command bundle --help outdated
More documentation on the command: http://gembundler.com/v1.1/bundle_outdated.html
According to "Can bundler show me which gems in Gemfile have newer versions (eg. dry-run of bundle update)" topic - there is no direct way to do it.
As a workaround if you use version controll just invoke bundler update print diff of Gemfile.lock (against version from repo) and revert it back.
Update Jun 2012: as of bundler 1.1 there is new command option bundle outdated - it prints nicely what are installed and latest versions of gems:
$ bundle outdated
Fetching gem metadata from http://rubygems.org/.......
Outdated gems included in the bundle:
* multi_json (1.3.6 > 1.1.0)
* activesupport (3.2.6 > 3.2.1)
* activemodel (3.2.6 > 3.2.1)
* journey (1.0.4 > 1.0.3)
...
Thanks Shaun.
I sketched out one way to implement notifications, here: http://www.masonsimon.com/idea-email-notification-of-new-gem-versions-i. I hope to have time for it soon, but if anyone else wants to implement it first, feel free :)