This project is archived and is in readonly mode.
Extend gem:install task to allow for options to the gem command and to the setup of gems
-
Claudio Poli
I vote for it, on production boxes there's no need for gem documentation, also the mysql gem always gave this kind of "problem".
the issue here is that the options may differ from machine to machine, but it's a start.
-
Ryan Bates
I don't think this belongs in the config file because it is very specific to the system. If you have multiple developers or need to deploy to multiple servers, there's a good chance you'll need it to behave differently.
Perhaps instead we can have "GEM_OPTIONS" for the gems:install rake task itself? You could then make a capistrano task to run this command with specific options on the specific server to install the gems the way you want.
That said, giving the ability to specify gem options in the config file doesn't hurt anything, and there very well be options which aren't system dependent. I'm just going by the example in the ticket.
-
Gavin Stark
The case of needing to supply build options to the mysql gem was the original case I was trying to solve. That install rarely automatically finds the mysql headers and libraries. There was no way to get a one-step clean gems:install without providing options.
You are correct that this doesn't explicitly deal with options that may be machine specific.
However, wouldn't this already work with the above:
config.gem "mysql", :version => "2.7", :install_options => ENV["MYSQL_GEM_INSTALL_OPTIONS"]
and invoke the gems:install rake task as:
rake gems:install MYSQL_GEM_INSTALL_OPTIONS="--with-mysql-config=/server/specific/directory"
or the same via capistrano?
-
Dan Pickett
I kind of agree that it's really dependent on the environment. Maybe there should be an established convention for environment variables?
-
PhilT
I agree this is an environmental issue. Luckily I just found this gem (sorry bad pun).
Add the following to ~/.gemrc file:
gem: --no-ri --no-rdoc
Doing a rake gems:install then doesn't install the docs. I tested it on Ubuntu 8.10 and it works a treat. Obviously, that doesn't solve the install options issue but but it's a step.
-
Norman Timmler
+1 That patch would really help us to install gems automatically. At the moment we have a custom solution, that is working exactly like that.
-
Frederik Dietz
+1 for including this patch.
The ~/.gemrc solves only partly the problem since it lets you only configure settings which are used each time you run the gem command.
Gavin's patch introduces a per-gem option which allows to mix even with system environment variables.
The mysql gem broke the whole thing for me too, BTW. Since I can't specify any additional options, the whole thing can't be used in my special case.
-
A. Jelveh
+1 for this patch
though I believe it's correct that server installations and deployment might differ this would be a great start.
-
Rizwan Reza
- Milestone cleared.
- Tag changed from railties to patch, railties, verified
- State changed from new to invalid
Since Rails 3 uses Bundler, this whole discussion doesn't apply.