Error installing backlogs plugin in Redmine - redmine

I have the following problem. I am trying to install the "redmine_backlogs" version 1.0.6 plugin in an environment with Redmine 3.2.0 with a Ruby 2.0.0 version
The problem gives me when I download the plugin, I host it in the plugin directory of my redmine installation, and when following the documentation, I issue the command bundle exec rake db: migrate gives me the following error:
[!] There was an error parsing `Gemfile`:
[!] There was an error parsing `Gemfile`: You cannot specify the same gem twice with different version requirements.
You specified: capybara (> = 0) and capybara (~> 1.1.0). Bundler cannot continue.
 # from / var / www / redmine / plugins / redmine_backlogs / Gemfile: 51
 # -------------------------------------------
 # unless chiliproject
 > gem "capybara", "~> 1.1.0"
 # gem "poltergeist", "~> 0.6.0"
 # -------------------------------------------
. Bundler cannot continue.
 # from / var / www / redmine / Gemfile: 110
 # -------------------------------------------
 # Dir.glob File.expand_path ("../ plugins / * / {Gemfile, PluginGemfile}", __FILE__) do | file |
 > eval_gemfile file
 # end
 # -------------------------------------------
I can't find a way to solve it so that it is properly installed.
Any extra help?
Thank you very much in advance.

Your plugin has a Gemfile in it's root directory, which has an entry for the capybara gem.
Bundler now complains because either Redmine, or another Plugin, have an entry for the same library in their Gemfile, but with a conflicting version requirement.
As Capybara is only used for running tests, it should be safe to just remove that line from the backlog plugin's Gemfile.

Related

remote-style not showing on my GitHub Pages portfolio

The Problem
I wanted to install a remote theme for my portfolio website, but I am not exactly sure why it isn't working. Either I installed the remote-theme incorrectly in the only two files I edited, Gemfile and _config.yml, or it is going wrong whenever I enter bundle install/bundle update.
If you have any suggestions, please let me know!
Thanks!
I added "." at the beginning of each line of my Gemfile and _config.yml because it thought I was trying to use headings. As well as spacing each line out.
What I've Tried
In the Gemfile and config file, When I comment out the default "minima" theme, and only include the "hacker" theme, I expected it to update the theme of my GitHub pages website when I pushed to the GitHub repo.
Also, when I enter the command "bundle install" or "bundle update" in the terminal, I get an error:
Could not find gem 'http_parser.rb (= 0.8.0)' with platform 'x86_64-darwin-21' in rubygems repository
https://rubygems.org/ or installed locally.
The source contains the following gems matching 'http_parser.rb (= 0.8.0)':
http_parser.rb-0.8.0
So I installed http_parser.rb 0.8.0 I expected it to install all of these gems smoothly.
to show what I have done in each file, here is my _config.yml:
.`title: My Portfolio
.email:
.description: >- # this means to ignore newlines until "baseurl:"
.Welcome to my page! Here you will find an accumulation of completed projects
.from Frontend Mentor,
.as well as a few of my own unique projects.
.baseurl: "" # the subpath of your site, e.g. /blog
.url: "" # the base hostname & protocol for your site, e.g. http://example.com
.twitter_username: jekyllrb
.github_username: jekyll
.# Build settings
.# theme: minima
.remote_theme: pages-themes/hacker#v0.2.0
.plugins:
.jekyll-feed
.jekyll-remote-theme`
.and here is the part of the Gemfile that involves installing remote-themes:
`.# Happy Jekylling!
.# gem "jekyll", "~> 4.3.1"
.gem "github-pages", "~> 227", group: :jekyll_plugins
.gem "jekyll-include-cache", group: :jekyll_plugins
.gem "jekyll-remote-theme"
.# This is the default theme for new Jekyll sites. You may change this to .anything you like.
.# gem "minima", "~> 2.5"
.# gem "hacker", "~> 0.2"
.# If you want to use GitHub Pages, remove the "gem "jekyll"" above and
.# uncomment the line below. To upgrade, run bundle update github-pages.
.# gem "github-pages", group: :jekyll_plugins
.# If you have any plugins, put them here!
.group :jekyll_plugins do
. gem "jekyll-feed", "~> 0.12"
.end`

Is there a way to prevent rails to precompile assets on production?

I have a lot of assets in my project. The precompile task in the server is very slow and exhaust the host (CPU utilization 100%, high average latency).
My idea is to precompile all assets in my localhost and send to GIT (master) all files already precompiled.
In the deploy action (cap production deploy), avoid the precompile task and in the server, prevent any precompile task.
The server uses the already precompiled files sended via capistrano, available in GIT.
Is it possible? If yes, how to do?
If no, there's another solution to avoid server precomile assets?
Below my configs:
Gemfile
gem 'capistrano-rails', group: :development
gem 'capistrano-faster-assets', '~> 1.0', group: :development
Capfile
require 'capistrano/setup'
require 'capistrano/deploy'
require 'capistrano/rails'
require 'capistrano/faster_assets'
# Load custom tasks from `lib/capistrano/tasks` if you have any defined
Dir.glob('lib/capistrano/tasks/*.rake').each { |r| import r }
config/environments/production.rb
config.assets.js_compressor = :uglifier
config.assets.css_compressor = :sass
config.assets.compile = true
config.assets.digest = true
other assets configs in this file is commented
Environment info
OS: Ubuntu 14.04.2 LTS (GNU/Linux 3.13.0-48-generic x86_64)
ruby -v: ruby 2.2.2p95 (2015-04-13 revision 50295) [x86_64-linux]
rails -v: 4.2.3
nginx -v: nginx/1.8.0
passenger -v: 5.0.10
If you need more information, tell me on the comments.
Short answer:
Replace
require 'capistrano/rails'
with
require 'capistrano/rails/migrations'
require 'capistrano/bundler'
Why this works:
When you require capistrano/rails, you are really including the following (source):
require 'capistrano/bundler'
require 'capistrano/rails/assets'
require 'capistrano/rails/migrations'
Each of these can be included separately to get just those pieces of functionality. Per the docs: https://github.com/capistrano/rails#usage

Can't run Rails in Gem/Engine project without first installing the gem itself

I just made a fresh checkout of my Rails Engine project, and when (after bundle install) I invoke rails -v in its root directory, I'm getting a LoadError in which Rails appears to be looking for the very gem/engine I'm trying to build:
my-engine dmoles$ rails -v
/Users/dmoles/.rvm/rubies/ruby-2.2.1/lib/ruby/site_ruby/2.2.0/rubygems/dependency.rb:315:in `to_specs': Could not find 'my-engine' (>= 0) among 117 total gem(s) (Gem::LoadError)
Checked in 'GEM_PATH=/Users/dmoles/.rvm/gems/ruby-2.2.1:/Users/dmoles/.rvm/gems/ruby-2.2.1#global', execute `gem env` for more information
from /Users/dmoles/.rvm/rubies/ruby-2.2.1/lib/ruby/site_ruby/2.2.0/rubygems/dependency.rb:324:in `to_spec'
from /Users/dmoles/.rvm/rubies/ruby-2.2.1/lib/ruby/site_ruby/2.2.0/rubygems/core_ext/kernel_gem.rb:64:in `gem'
from /Users/dmoles/.rvm/gems/ruby-2.2.1/bin/rails:22:in `<main>'
Running gem env as suggested provides no more enlightenment:
my-engine dmoles$ gem env
RubyGems Environment:
- RUBYGEMS VERSION: 2.4.6
- RUBY VERSION: 2.2.1 (2015-02-26 patchlevel 85) [x86_64-darwin14]
- INSTALLATION DIRECTORY: /Users/dmoles/.rvm/gems/ruby-2.2.1
- RUBY EXECUTABLE: /Users/dmoles/.rvm/rubies/ruby-2.2.1/bin/ruby
- EXECUTABLE DIRECTORY: /Users/dmoles/.rvm/gems/ruby-2.2.1/bin
- SPEC CACHE DIRECTORY: /Users/dmoles/.gem/specs
- SYSTEM CONFIGURATION DIRECTORY: /Users/dmoles/.rvm/rubies/ruby-2.2.1/etc
- RUBYGEMS PLATFORMS:
- ruby
- x86_64-darwin-14
- GEM PATHS:
- /Users/dmoles/.rvm/gems/ruby-2.2.1
- /Users/dmoles/.rvm/gems/ruby-2.2.1#global
- GEM CONFIGURATION:
- :update_sources => true
- :verbose => true
- :backtrace => false
- :bulk_threshold => 1000
- REMOTE SOURCES:
- https://rubygems.org/
- SHELL PATH:
- /Users/dmoles/.rvm/gems/ruby-2.2.1/bin
- /Users/dmoles/.rvm/gems/ruby-2.2.1#global/bin
- /Users/dmoles/.rvm/rubies/ruby-2.2.1/bin
- /Users/dmoles/.rvm/bin
- /Users/dmoles/bin
- /usr/local/bin
- /usr/bin
- /bin
- /usr/sbin
- /sbin
- /usr/local/git/bin
I can build/install the gem fine with
gem build my-engine.gemspec
gem install my-engine-0.0.1.gem
after which rails -v starts working.* It doesn't seem like this should be necessary, though, and it makes me worry that Rails may be using the built/installed version of the code instead of the live source. What am I doing wrong?
* That is, it runs, even though it complains "Bundler is using a binstub that was created for a different gem". Possibly because it doesn't like the fact that the gem is named my-engine but the ENGINE_PATH has my/engine?
It doesn't make sense to call rails -v within the engine root since an engine is a gem after all that need to be loaded in a rails application, unless you have it structured like a normal rails app instead of an engine gem.
So basically, when you run rails -v, it will try to load your engine as a gem not as a normal rails application thus it will complain if its not installed in your environment.
It looks like somehow the local gem setup on this machine was corrupted -- even if I created a brand-new unrelated engine, it still complained about not being able to find my-engine. rm -r ~/.rvm/gems/ruby-2.2.1* / gem install rails fixed the problem (though at the price of having to reinstall a bunch of gems).

Spree with Payupaisa Gateway

I want to add Payupaisa gateway for my shopping cart site. I use spree. I used gem
gem 'spree_payupaisa', :github => "meetdestiny/spree_payupaisa_express", :branch => "2-1-stable"
https://github.com/meetdestiny/spree_payupaisa_express
but it give error while I am updating bundle
Git error: command `git rev-parse 2-1-stable` in directory
/home/tps/.rvm/gems/ruby-2.0.0-p247#demo/cache/bundler/git/spree_payupaisa_express-6aebc199a8cbc824377ffe9416c892e73cc3271e has failed.
Thank in Advance.
The instructions on that repository are incorrect. That git repository doesn't have a 2-1-stable branch. Try the following in your Gemfile:
gem 'spree_payupaisa', :github => "meetdestiny/spree_payupaisa_express"
Which should currently work with Spree 2.1.
You should file an issue/pull request on the repository to correct the instructions.

Rake assets:precompile fails with: couldn't find file 'handlebars'

Running the command during a capistrano deploy:
bundle exec rake RAILS_ENV=staging RAILS_GROUPS=assets assets:precompile
returns
rake aborted!
couldn't find file 'handlebars'
(in */app/assets/javascripts/application.js:22)
*/ruby/1.9.1/gems/sprockets-2.2.2/lib/sprockets/context.rb:102:in `resolve'
*/ruby/1.9.1/gems/sprockets-2.2.2/lib/sprockets/context.rb:142:in `require_asset'
*************
Tasks: TOP => assets:precompile:all
Gem ember-rails is in a global scope in my Gemfile and I am using handlebars-source (1.0.12), ember-rails (0.12.0), ember-source (1.0.0.rc6.2) in Rails 3.2.12 and ruby 1.9.3.
It's probably worth noting that this works in production, but not in staging deploys.
Also I have the following in my staging.rb, which appears to be the common issue.
config.ember.variant = :production
Turns out I had added the line
config.ember.variant = :development
to a version that wasn't getting pushed to master. Added config.ember.variant = :development to the current version fixed this.