Redmine install process rake db:migrate does not work - ruby-on-rails

I am in process of installing Redmine app via RedmineInstall documentation I try step 5 :
bundle exec rake db:migrate
then error shows :
bundler: command not found: rake
Install missing gem executables with ´bundle install´
I use redmine 3.3.0 64 for windows
I use redmine gemfile and rake was installed (i see Using rake 11.2.2)
I tried reinstall it via bundle install or gem install/uninstall, but did not help (see Successfully installed rake-11.2.2 but rake do not work).
I tried this command from ruby/bin directory or redmine directory not success.
I do not understand, that rake is successfully installed, but when i try use it with bundle it says that command not found.
The problem may be in the directory where the Redmine or rake?

Try rake db:migrate in your redmine directory without bundle exec and see if that resolves your issue.
Bundler usually provides bin stubs for rake and other gem files, so that bundle exec is not necessary or will even fail because it will look in an other gem directory where, in this case, rake might not be installed.

Related

Rails console not launching [I'm in the directory]

Rails C and Rails S not working when in the correct directory.
have tried:
$ bundle exec rake rails:update:bin
this returns the following error:
bundler: command not found: rails:update:bin
Install missing gem executables with `bundle install`
I have ran:
Bundle Install
this still returns the same error
Have changed directories (higher and lower), repeated steps and attempted commends for same result.
I was running rails server, when i stopped the server and tried to restart server, the error appeared, so I'm thinking this has something to do with a physical location change (potentially the bin file), which is consistent as when I try and run a bin/rails command, i'm receiving an error of:
bundler: command not found: rails:update:bin
Install missing gem executables with `bundle install`
I have tried to rake the bin folder as below:
rake rails:update:bin
however I am receiving this error:
rake aborted!
Don't know how to build task 'rails:update:bin' (see --tasks)
Finally, I have checked the physical location and there is a .bin file, however this folder is empty and it's not in a .gitignore directory.
Ancillary information
Rails version: 5.1.4
ruby version: 2.3.4
Server: heroku
OS. Ubuntu 16.04 (via virtualbox).
I have not upgraded rails, this is a fresh install
I am at a loss.
rails update:bin or rake update:bin These are the right ways that execute a rake task.

Multiple Rails vers on same machine + rake

I've been running a Rails 3.2 with Ruby 1.9.3 for a while now. Recently I added Rails 5.1 and Ruby 2.4.
I used rvm to install Ruby2.4.
Today I had occasion to cd into one of my old projects and run rake db:migrate, and I got the following message:
Gem::LoadError: You have already activated rake 12.0.0, but your Gemfile requires rake 0.9.2.2. Prepending `bundle exec` to your command may solve this.
Prepending 'bundle exec' did solve the problem but for my knowledge I would like to understand what happened. I thought the whole point of a Gem file within the project was to lock in the required gems.
So somewhere on my machine clearly there is still rake 0.9.2.2 but why did my command 'rake db:migrate' not use that automatically?
Reason: Some of the gem might have locked rake gem to that version.You are getting this as version of rake inside gemlock file is different than the one you have already installed.
Solution1:
bundle update
Solution2:
edit the gemlock file. open Gemfile.lock and change
rake (0.9.2.2) to rake (12.0.0)
Solution3:
remove Gemfile.lock and run bundle install once again.This will create
Gemfile.lock once again.

bundle binstubs vs rake

I am relatively new to Rails, and using version 3.x.I have just found out about bundle binstubs gem command which creates executable wrappers in /bin dir.Is there any benefit running commands from bin/ if there is already rake task for that.For example, I would use rake spec:models , which I prefer over bin/rspec spec/models/.
Yes.
As an example, when you install gems locally within your rails app using Gemfile and bundle install, you normally need to do a bundle exec before running tasks, so as to resolve ruby gems dependecies from the app directory, not from installed otherwise (using gem install <gemname>).
With binstubs, you don't need to do that.
Example: bundle exec rake RAILS_ENV=production onetime:generate_report without binstubs and
rake RAILS_ENV=production onetime:generate_report with binstubs

"Missing these required gems" on specific server, gems are installed

Trying to run rake db:migrate I get:
$ rake db:migrate
(in /home/user/domains/staging)
log level debug
Missing these required gems:
haml ~> 3.1.4
htmlentities
fastercsv
You're running:
ruby 1.8.7.72 at /usr/bin/ruby1.8
rubygems 1.3.7 at /home/user/.gem/ruby/1.8, /usr/lib/ruby/gems/1.8
Run `rake gems:install` to install the missing gems.
rake aborted!
no such file to load -- json
I have two servers en both are updated via a git repository. On one server everything works fine, on the other I get the above error.
Whats up?
Have you tried bundle install or sudo bundle install in production? You might also try bundle exec rake db:migrate instead of just rake db:migrate. These are kind of guesses, but might help.
Is the path to the "ruby"/"rake" etc executables pointing at the correct one on the server that isn't working? It looks like you want to use REE, but your stack trace is 1.8, not REE.
You may need to export an environment variable to update your path to point at the correct Ruby binaries.

newbie: error message when 'rake -T'

I am using Ruby Enterprise Edition for my project. When I check all my rake task by run the command rake -T , I got the following error message:
You have already activated rake 0.9.2.2, but your Gemfile requires rake 0.9.2. Using bundle exec may solve this.
The error message implies that I can use bundle exec to solve the problem, but I am not sure how? So, how to get rid of this error message?
------------------------------ more ---------------------------
I prefer to update my Gemfile instead of run bundle exec rake -T. But when I open my project Gemfile, I did not see rake 0.9.2 in my Gemfile, why the error message complains that I have it? Where could be the place I defined rake 0.9.2??
Run bundle exec rake -T, this ensures that the version of rake that is specified in your Gemfile is running, not another version.
Alternatively, update your Gemfile.
This is because your rake tool does not match the version written in the Gemfile.
You first need to run this command, to ensure rake 0.9.2 get installed:
bundle install
Then, you can run rake 0.9.2 with the following command:
bundle exec rake -T
The bundle thing is a nice tool to help you manage the dependency of your application. You can get more info from here.

Resources