Could not be able to bundle paperclip - ruby

I bundled a gemfile, and all installed perfect except paperclip, I could not figure out what is the problem, anyone could help me? thanks in advance!
Errno::EINVAL: Invalid argument - c:/Ruby192/lib/ruby/gems/1.9.1/gems/paperclip-
2.5.0/test/fixtures/question?mark.png
An error occured while installing paperclip (2.5.0), and Bundler cannot continue
.
Make sure that `gem install paperclip -v '2.5.0'` succeeds before bundling.

Looks like that's caused by trying to create a file with a question mark in the name, which isn't valid on Windows. It looks like 2.4.4 is the newest version that doesn't contain that commit, so try forcing your Gemfile to use that exact version.
File a bug here, and link to it in a comment. (I would if I had Windows and could test this).

You can install Paperclip 2.6.0 and rename manually in gems folder to 2.5.0. And don't forget to rename gem version to 2.5.0 in paperclip-2.5.0.gemspec file. It will work without any problem.

Related

Can I control the version of rubygems that IntelliJ uses?

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.

error when update_rubygems

When I try to update gem I gave this:
4 bug fixes:
Use Psych API to emit more compatible YAML
Download and write inside gem fetch directly. Fixes #289
Honor sysconfdir on 1.8. Fixes #291
Search everywhere for a spec for gem spec. Fixes #288
Fix Gem.all_load_path. Fixes #171
Help me fix it please :D
That appears to be valid output from updating RubyGems. Did you run this command?
gem update --system
If so, and you saw that output, you should be able to run this and get the version number.
gem --version
It should be something along the lines of 1.8.17, which is the latest version.

Could not find gem 'rubytree (~> 0.5.2) ruby' while installing ChiliProject on Debian

I am trying to install chiliproject on a server, following the -well done- documentation I am hitting this error
Could not find gem 'rubytree (~> 0.5.2) ruby' in any of the gem sources listed in your Gemfile.
I did a gem install rubytree
I get this message
========================================================================
Thank you for installing rubytree.
WARNING: SIGNIFICANT API CHANGE in 0.8.0 !
------------------------------------------
Please note that as of 0.8.0 the CamelCase method names are DEPRECATED.
The new method names follow the ruby_convention (separated by '_').
The old CamelCase methods still work (a warning will be displayed),
but may go away in the future.
Details of the API changes are documented in the API-CHANGES file.
========================================================================
Successfully installed rubytree-0.8.1
1 gem installed
Installing ri documentation for rubytree-0.8.1...
file 'COPYING,API-CHANGES' not found
Installing RDoc documentation for rubytree-0.8.1...
file 'COPYING,API-CHANGES' not found
That is saying the installation was succesful. So why do I get the error ?
If the error is from the API change how can I request version 0.5.2 of the rubytree gem ?
When I do a gem list --local | grep 'rubytree'
I have this output rubytree (0.8.1)
So why is the system saying could not find gem 'rubytree' ?
thank you for any help,
Depending on what version of rails you are using (and it sounds like you are using a relatively newer one, if it's prompting you for your Gemfile), then you need to use Bundler to manage your gems.
Try editing your Gemfile, adding a new line that reads:
gem "rubytree", "< 0.6"
Then open up a console, and type this command
bundle install
This should fix your problems, but if you still get errors when running a command, then try typing bundle exec prior to the command (i.e. rails server becomes bundle exec rails server).
Currently, we require rubytree exactly in version 0.5.2 or 0.5.3, as specified in our Gemfile, the 0.8.1. version you installed by hand will not suffice that requirement, which is exactly what the error message states.
What seems a bit odd is the literal ruby in the error message. Could you please make sure that you have the exact unchanged Gemfile from the source on your system? Also, could you please remove any user-installed plugins and try again? Also, which ruby (type and version) on which operating system are you using?

How to safely fix "invalid date format in specification" for webrobots-0.0.10.gemspec

For every gem execution I am receiving the following error:
Invalid gemspec in [...rvm/gems/ruby-1.9.2-p136/specifications/webrobots-0.0.10.gemspec]: invalid date format in specification: "2011-07-01 00:00:00.000000000Z"
I am not the webrobots maintainer and I can't uninstall that gem.
There is any safe action to fix this problem on a production server?
These days with Github and Bundler you don't have to be a maintainer in order to fix issues in the gems you're using. Just fork the project on Github, fix whatever issue is there, and them simply point Bundler at your fork. If it is a handy extension to the gem rather than just a hack for yourself you might also consider making a pull request to the original maintainer to roll your changes into the official gem.
Having said all of that, the issue that might cause this problem doesn't seem to be present in the gemspec of the 0.0.10 version of webrobots. This issue can occur when the date in the gemspec is in the format that you have in your error e.g.:
"2011-07-01 00:00:00.000000000Z"
Looking at a snippet of gemspec though we have:
s.authors = [%q{Akinori MUSHA}]
s.date = %q{2011-07-01}
s.description = %q{This library helps write robots.txt compliant web robots in Ruby.
So that seems to be correct. Another issue that has been known to cause this problem is a YAML parser issue, to fix you need to force the use of a particular YAML parser (psych). You need to define the following somewhere:
require 'yaml'
YAML::ENGINE.yamler = 'syck'
Lastly you might want to clean your local installation and then do a redeploy which may sort you out. Once again if you're using Bundler something like this:
gem update --system
rvm gemset empty mygemset
gem install bundler
gem install
Here is the way I fix the "invalid date format in specification" error:
1.) Go to the specifications folder located at:
/usr/local/lib/ruby/gems/1.8/specifications/
2.) Find the spec that is causing the problem.
3.) Change "s.date = %q{2011-05-21 00:00:00.000000000Z}" to "s.date = %q{2011-05-21}"
That's a WIN for me! Good Luck
You may be using old version of gem. See you current version gem -v.
Upgrade you gem to latest
gem update --system
And install you gem file again with new gem. gem install <gem-name> or bundle install

Manually adding a Ruby Gem

I am trying to install the mechanize gem that is supposed to work with 1.9 from here: http://github.com/kemiller/mechanize but I do not know how to add it manually.
I am using Windows, I could just copy the folder to the gems directory, but how do I initialize it?
I'm not sure I understand the problem. gem install mechanize doesn't work? It produces version 0.9.3 for me, which matches the gemspec of the library you linked to.
EDIT: you're on 1.9. I knew that. Disregard my hasty post, not familiar enough with Windows to offer any help on building the extensions.
I would use the bundler gem using the command gem install bundler. This will create a file called Gemfile in your project directory where you can put your dependencies for the specific project that you are working on. In the Gemfile, you will need to specify gem mechanize. If you want a specific version include ~> VERSION after. After, run the command bundle install. This will install the gem you want and use it in your project.

Resources