Existing Redmine Project from Linux to Windows: Redmine is not migrated - ruby-on-rails

This is the error I encounter during rake.
The Easy Project cannot start because the Redmine is not migrated!
Please run bundle exec rake db:migrate RAILS_ENV=production and than
bundle exec rake easyproject:install RAILS_ENV=production rake
aborted!
I try to run the command stated and it doesn't work.
Do I need to install something? Because the bundle install is successful.
I thought running the bundle install after giving me the project will do.
The first developer used Linux, but im on Windows.

Already resolved. I used these ffg commands:
bundle exec rake generate_secret_token
set RAILS_ENV=production
bundle exec rake db:migrate

Related

Delayed Job in Rails 4 with Capistrano

I cant figure how to start Delayed Jobs on a dedicated Ubuntu server.
It works fine on my localhost but when I run on my server
sudo RAILS_ENV=production bin/delayed_job restart
I get
sudo: bin/delayed_job: command not found
On top of that, if I run the "rake jobs:work RAILS_ENV=production" command Im getting the following error:
PG::FeatureNotSupported: ERROR: SELECT FOR UPDATE/SHARE is not allowed in subqueries
Apparently theres an issue with my psql version.
Is there any way I can get the script to work? Any effective Capistrano recipes available? All ive found on the web are old recipes for Rails 3 and older versions of capistrano.
Thanks in advance.
EDIT:
I have already bundled install the daemons gem and generated "delayed_job:active_record" on my local machine, then proceded to cap deploy which bundle installed and migrated in the production server.
The bin/delayed_job file exists in the server yet it fails with command not found.
And add this to config/environment.rb:
ENV['RAILS_ENV'] ||= 'production'
Then at your production server:
RAILS_ENV=production rake db:migrate
RAILS_ENV=test production generate delayed_job:active_record && RAILS_ENV=production rake db:migrate
Now after you do that:
RAILS_ENV=production script/delayed_job start
As for Capistrano error you are facing, please try to add the command like:
run "cd #{current_path}; #{sudo} RACK_ENV=production bundle exec #{current_path}/bin/delayed_job start"
You must run this on target server:
bundle exec rails generate delayed_job

Error in Rake Task in Redmine

When I'm trying to install the plugins by Rake command I'm getting the below error can any one help?
rake redmine:plugins:migrate:RAILS_ENV=production
rake aborted!
Don't know how to build task 'redmine:plugins:migrate:RAILS_ENV'
Note that im using 2.2.0 version
The RAILS_ENV=production part should be prepended to your command.
Try:
RAILS_ENV=production bundle exec rake redmine:plugins:migrate

Migrations are pending; run 'rake db:migrate RAILS_ENV=development' to resolve this issue.?

After this error in my web page when i have run > rake db:migrate. It shows error such as:
rake aborted!
you have already activated rake 10.1.1 but you gemfile requires rake 10.1.0 using bundle exec may solve this.
when i tried with bundle exec rake db:migrate it works.
And when i tried with the rake db:migrate. i shows error
My question is:
What is the difference between bundle exec rake db:migrate and rake db:migrate.
every time i have to do like this if yes then why?
What is the problem in my project.
Thanks.
bundle exec rake db:migrate will run rake db:migrate with the environment of your Gemfile.
You have an error because your Gemfile requires a version of rake but you have a newer one installed on your system.
By default, rake will run the latest available version, hence the mismatch.
You should always prefix your commands with bundle exec inside a project managed by bundler, I personally alias bx to bundle exec.
You can also use binstubs
Try to run bundle update.
It seems, that your Gemfile.lock is out of sync with your Gemfile.

Capistrano deploy:migrate Could not find rake-0.9.2.2 in any of the sources

My Capistrano deploy:migrate task is set to run a simple rake db:migrate command, as follows:
env PATH=/home/user/.gems/bin sh -c 'cd /home/user/app/releases/20121003140503 && rake RAILS_ENV=production db:migrate'
When I run this task during an ssh session manually it completes successfully. However when I run from my local development box, I receive the following error:
** [out :: app] Could not find rake-0.9.2.2 in any of the sources
I am able to locate my rake gem by typing which rake via ssh (/home/user/.gems/bin/rake) and rake --version gives me "rake, version 0.9.2.2," so I don't understand why this command fails via Capistrano?
Capistrano does not place bundle exec before rake command in default. If you are sure you have the rake gem in your bundle, try adding this to your deploy.rb.
set :rake, 'bundle exec rake'
This will tell Capistrano to instead of just rake run bundle exec rake. If it is in your bundle, you won't have any problems any more and you will also avoid collisions if you have more versions of rake installed on your system.
You might also just need to bundle your gems with this:
require "bundler/capistrano"
Via: Why is Capistrano not installing gems with bundler?
Once you go into your app folder, you simply type:
$bundle exec rake instead of just $rake

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