Open mminklet opened 9 years ago
Hi I will try to look into it before the end of week, in this time you can check out http://niczsoft.com/2015/02/changes-in-my-open-source-life/
Hi, did you link to the right article?
yes it's right, a little background why you have to wait
Ah right, yeah I'm fine with waiting. In the meantime I have been compiling manually and using the scp utilitiy in capistrano. I tried installing the capistrano gem into the same gemset as the projects compass etc, but that caused another error.
@MichaelMallett By default RVM integrates with Bundler with the help of the rubygems-bundler gem. This handily automatically prefixes bundle exec
to commands to run in the context of the bundle when a Gemfile is present.
It seems that here you don't actually want to be running in the context of the bundle, since Compass is not in the Gemfile file. You can explicitly disable rubygems-bundler's automatic bundle exec
by prefixing NOEXEC_DISABLE=1
to a command.
Hi, thanks for the response, but I think you may be misunderstanding me, our compass is in a gemfile.
We have a standard drupal theme, inside that is a gemfile, and we have that bundle installed to a project specific ruby gem with rvm. There's a lot of these projects with different requirements so
Outside of the root directory of the site (but inside the project) we have the deploy folder containing the capistrano script, the gemfile (and lock) containing the capistrano gem. This is installed to a gemset too, we don't want to install Capistrano 30 times on each machine into different gemsets, so this is in it's own 'deploy' gem using ruby 2.1.5. I tried adding capistrano into the theme gemfile and bundle installing again to bring them all together, but that caused other issues...and that's not really a viable solution to all our older projects.
Problem is that the projects theme uses a different gemset and ruby version to capistrano in order to compile sass, because surely that's the whole point of rvm. So when capistrano calls rvm 1.9.3@omega do compass compile in the sites theme folder, it is not actually using the correct ruby version or gemset. You can see that from the path in error message .rvm/gems/ruby-2.1.5@global/gems/bundler-1.7.9/
Gemfile in the theme folder ([root]/sites/all/themes/omega/Gemfile using 1.9.3@omega)
source 'https://rubygems.org'
group :development do
gem 'sass' # Sass.
gem 'sass-globbing' # Import Sass files based on globbing pattern.
gem 'compass' # Framework built on Sass.
gem 'compass-validator' # So you can compass validate
.
gem 'compass-normalize' # Compass version of normalize.css.
gem 'compass-rgbapng' # Turns rgba() into .png's for backwards compatibility.
gem 'susy' # Susy grid framework.
gem 'singularitygs' # Alternative to the Susy grid framework.
gem 'toolkit' # Compass utility from the fabulous Snugug.
gem 'breakpoint' # Manages CSS media queries.
gem 'oily_png' # Faster Compass sprite generation.
gem 'css_parser' # Helps compass stats
output statistics.
gem 'guard' # Guard event handler. gem 'guard-compass' # Compile on sass/scss change. gem 'guard-shell' # Run shell commands. gem 'guard-livereload' # Browser reload. gem 'yajl-ruby' # Faster JSON with LiveReload in the browser.
gem 'rb-inotify', '~> 0.9', :require => false # Linux gem 'rb-fsevent', :require => false # Mac OSX gem 'rb-fchange', :require => false # Windows
end
Gemfile in the deploy folder ([root]/deploy/Gemfile using 2.1.5@deploy) source 'https://rubygems.org' gem 'capistrano', '~> 3.1.0'
It seems that the run_locally
command is detecting the pre-cd deploy/Gemfile
, which prefixes bundle exec
and that bundle
executable is the 2.1.5 Bundler you're seeing. At least I think that's what's happening.
Is there any way of avoiding this?
Is that the right issue? I don't see how they are related. Also, I am using bundler 1.7.12 and apparently whatever issue this is was fixed in 1.1
Hi, I'm not sure if this is something that can be helped here, as I am not using this gem - but I will if it turns out that it can do what I hope to do. I don't want to install or use ruby or rvm on production, I'm looking to run rvm locally in capistrano, so I can compile sass locally and copy to production. Below is my, expanded, question I posted in the capistrano issue queue, but was directed here. Thanks in advance
I have come across a couple of sort of efforts to document this, and another that is out of date: I want to run compass compile through my projects already defined rvm gemset, using capistrano (which was installed using it's own gemset), and then upload the compiled css to the production server. I would assume that capistrano wouldn't force you to fix to a ruby version and gemset as these are all different across projects, or would it?
Anyway, I am trying to get capistrano working with a drupal site, specifically with the gemsets that the project was set up with long ago.
So, we have a themes folder where we run rvm 1.9.3@omega do compass compile, and capistrano installed to 2.1.5@deploy a few folders above it. The following commands were used to install compass capistrano:
I am running this task in my deploy.rb, after publishing
Which outputs this command
Which works fine from the command line, in the folder I run cap from...however I get this error message when I try and run cap production deploy
Which suggests it is not using the right ruby version/gemset...which I can kind of understand as capistrano is using that version of ruby...however I'm a bit stuck how to get round it. I don't want to have to manually compile compass everytime.
I should point out that I am very much learning capistrano, and ruby in general, so I am happy to take on board any ideas about how to go about this properly. I didn't use this gem as it seemed to be more about running rvm remotely, which I am not looking to do.