Redmine backlogs : could not locate gemfile - ruby

I installed redmine on my server.
Redmine is installed in /usr/share/redmine.
I try to install redmine backlogs using the installation guide)
As mentionned in the guide, I execute the following commands:
cd /usr/share/redmine
bundle exec rake redmine:backlogs:install
It fails with the message: Could not locate Gemfile
It looks like the bundle command is waiting for a gemfile in the directory but this file is missing.
Do you have any idea how to solve this problem?
EDIT: Note that I installed Redmine using the Wheezy backports. Maybe we cannot install plugins when Redmine has been installed from the Debian package....
Thank you

That url is for sale now, your best bet is to build it from source from the most currently updated fork from that project which is: https://github.com/ahelten/redmine_backlogs
Try this:
cd ~/redmine/plugins
git clone https://github.com/ahelten/redmine_backlogs.git
git checkout feature/v1.0.6_inherit_fields
Install libs and gems needed by backlogs
sudo apt-get install libxslt-dev libxml2-dev
sudo gem install nokogiri -v '1.5.11'
bundle install
Test Your Work
bundle exec rails server webrick -e production
NOTE: this assumes that you have git and whatever other development tools and gems you need installed. If you fail to install a gem, scroll up and read the output, chances are you need to add a package mentioned in the output first (sudo apt-get install foo). If you fail to find a gem you are either building in a directory without a Gemfile or the gem the gem file wants doesn't exist ... search rubygems.org if that happens)

Related

Bundler 2.2.0 and Ruby 2.7.5 on Docker crashing

I installed Ruby 2.7.5, and within the Dockerfile, specified bundler (version 2.2.0) to be installed:
RUN gem install bundler -v 2.2.0 --no-document
the output of this is:
INFO[0093] RUN gem install bundler -v 2.2.0 --no-document
INFO[0093] cmd: /bin/sh
INFO[0093] args: [-c gem install bundler -v 2.2.0 --no-document]
INFO[0093] Running: [/bin/sh -c gem install bundler -v 2.2.0 --no-document]
Successfully installed bundler-2.2.0
All seemed to be fine in that install, and bundle works as gems specified in Gemfile are installed. However, when I try to open the console, I see this:
/usr/lib/ruby/2.7.0/rubygems.rb:277:in `find_spec_for_exe': Could not find 'bundler' (2.2.0) required by your /app/Gemfile.lock. (Gem::GemNotFoundException)
To update to the latest version installed on your system, run `bundle update --bundler`.
To install the missing version, run `gem install bundler:2.2.0`
However, it is installed. as you can see from above. Also, when I output the version within the Dockerfile, I see:
Bundler version 2.2.0
It seemed to install fine, however, still see the error above, and it crashes immediately.
Is there something obvious I am doing wrong?
Building a Docker Image with an Updated Bundler Version
You're missing a couple of steps in your Dockerfile build for bundled gems. After you update Bundler, you also need to update your Gemfile.lock and possibly re-run bundle install. There are a lot of options involved, but here's my personal recommendation for your Dockerfile based on your post:
# Note: Don't lock your Bundler version unless you
# have a VERY good reason to do so. Update will
# install or update, as needed.
RUN gem update bundler --no-document \
&& gem clean bundler \
&& bundle update --bundler \
&& bundle install
The key here is that if you don't use bundle update --bundler then the Gemfile.lock will not contain the version of Bundler that you're expecting to call. Recent versions of Bundler will downgrade themselves to the version in the Gemfile.lock if necessary, so this is really the key to the whole thing.
In addition, if you continue to have problems after applying the recipe above, you may need to figure out where Bundler is actually being installed inside your container image. While Bundler (currently) doesn't run from inside your bundle, the required version still needs to be in GEM_HOME, GEM_ROOT, or GEM_PATH in order to be found when you invoke it.
As a final consideration, if you're building your gems locally or modifying your Gemfile.lock and then using an ADD or COPY command to place the Gemfile.lock or any vendored gems into your container image, you need to perform these activities outside of Docker rather than inside the Dockerfile. Based on your original post it doesn't look like you're doing that now, but it's another option to consider as you work on resolving this.

Bundle install fails, Gem install succeeds

When trying to bundle install on a Gemfile that contained only the GitHub Pages gem and nothing else, on Ubuntu 18.04, I got error messages telling me to try installing eventmachine using gem install. That always succeeds, but bundle install still fails. How can I get bundler to see that the gem is installed?
I fixed this after many hours of struggle, by noticing that on the GitHub Pages repo there's a note that says
Important: Make sure you have Bundler > v1.14 by running gem update bundler in your terminal before following the next steps.
I have no idea why this mattered but I removed my ruby packages from Ubuntu and reinstalled them, then installed bundler with rubygems, which gave me a newer version:
sudo apt-get remove ruby
sudo apt-get install ruby ruby-dev
sudo gem install bundler
bundler --version
If anyone knows why I needed that version of bundler, or how I should have diagnosed this faster, I'd be interested to hear it. I'm not new to programming but I'm new to Ruby.
From my understanding it might be the gem you are trying to install requires a specific feature provided by bundler. If you check the change log of bundler there is some changes related to install github based gems on how to correctly read the user git settings. So I think that might be where the problem is from.

Can't installl devdocs for offline browsing

I have problem installing devdocs in my mac.
I tried to do the steps there but I'm stucked installing bundler.
I tried the following in the terminal:
gem install bundler //this worked
bundle install //this prints error: Bundler::GemfileNotFound
I already have the latest Ruby version required but still printing the same error.
I tried to execute bundle install in the path where the gemfile is still the same error.
I needed to install this in my pc for offline browsing. For those who successfully installed this in their mac machine, please help me.
This error indicates that you're trying to run the command in a directory that does not contain any Gemfile. I think that in your local directory, you forgot to clone the devdocs Git repo. So go to your local devdocs directory and type:
git clone https://github.com/Thibaut/devdocs
Then go to this directory, and type the following commands:
bundle install
thor docs:download --all
rackup
That should work, and devdocs should be available at localhost:9292. If that does not, maybe your ruby version is too old (devdocs requires Ruby 2.1.0 or greater). In this case, I strongly recommend you to us rvm to update ruby (rvm install ruby-2.1.0).

Build binary Ruby 2 gems

In our production environment, we are forbidden from having compilers installed (don't ask). Back in the Ruby 1.8.7 days, we would use gem-compile to compile binary gems on a dev workstation and put the binary gem out in our repository. Is anybody aware of any similar methods that work with Ruby 2.0? I know RVM is capable of building custom packages of rubies that can be deployed, but I can't find any way to make it work with gems.
I'd like to come up with something a little less brittle than building everything on a dev box and rsync'ing the entire rvm directory over to the server.
Thanks!
check this part of rvm offline installation - http://rvm.io/rvm/offline#installing-gems :
Online
Create a (fake) project directory: mkdir gems; cd gems
Install bundler: gem install bundler
Create Gemfile: bundle init
Add rails to it: echo "gem 'rails'" >> Gemfile
Install all gems: bundle install
Get gem files: bundle package
Package project: tar czf gems.tgz .
Download bundler from https://rubygems.org/gems/bundler the Download link
Offline
Create a (fake) project directory: mkdir gems; cd gems
Unpack gems: tar xzf gems.tgz
Install bundler: gem install bundler-1.2.1.gem
Install gems: bundle install --local
Nevermind, I found the answer. There is a newer gem called gem-compiler from https://github.com/luislavena/gem-compiler that works with Ruby 2. I didn't think it was working because I inadvertently still had an old copy of gem-compile installed and that was getting executed when I ran 'gem compile'. Anyways, this generates platform specific gems for me that I can install in our production environment.
Cheers and Thanks,
Jason

Can't install JSON gem

I need to install json because I get this error:
Could not find json-1.4.6 in any of the sources
I ran gem install json and bundle install but I was only able to install json-1.5.1 when I need json-1.4.6
I have gem 'json', '1.4.6' in my gemfile, so I'm not sure what's going on...
UPDATE
I get this error:
Installing json (1.4.6) /System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/lib/ruby/1.8/fileutils.rb:1216:in `chmod': Operation not permitted - /Library/Ruby/Gems/1.8/gems/json-1.4.6/CHANGES (Errno::EPERM)
After checking logs by running $ heroku logs
I found "An error occurred while installing json (1.4.6), and Bundler cannot continue.
Make sure that gem install json -v '1.4.6' succeeds before bundling."
I then removed 2 json entries from the Gemfile.lock and had no further issues.
Why did you run gem install json at all? Bundler takes care of that for you and will ensure that the correct version of each gem is installed (since sometimes dependencies require an older version). Run
gem uninstall json
bundle install
Also ensure you have source 'https://rubygems.org' at the top of your Gemfile.
As for the permissions info, you may have to run gem and bundle commands with sudo.
By the way, I highly recommend taking a look at and using RVM, particularly the gemsets feature. It will make your life infinitely better when developing Ruby apps. If you decide to do so, I'd also suggest trashing all the gems you've install using the system Ruby by running sudo rm -rf /Library/Ruby/Gems/1.8/. It's also important that when using RVM you don't have to use sudo when running gem (or bundle), which is not only safer but less typing too.
Please update your rubygems by executing the following command..
gem update --system
may be it will solve the problem. After updating your gem. Then run the following command to install json
gem install json
Now you can get json gem installed in your system.
Try:
$ sudo apt-get install ruby1.8-dev
If you're using rbenv, try rbenv rehash
I had this problem when trying to build a website with Jekyll.
Turned out I hadn't followed all the instructions at https://jekyllrb.com/docs/installation/ubuntu/
I don't know if it was the missing packages or commands into ~/.bashrc but it fixed the problem in two instances of Ubuntu in WSL
Remove the json entries from the Gemfile.lock file and try to re run bundle install..

Resources