when I run bundle exec rake db:migrate in windows CMD, it shows "ruby.exe is not recognized as an internal command...
but ruby.exe -v works fine..
what should I do now?
Related
When run the development mode, it works well:
$ rails s
But when the production mode:
$ RAILS_ENV=production rails s
And try to access it:
$ curl http://0.0.0.0:3000
Then message is:
Access denied.
There isn't any error log. Can't find what's the reason.
Make sure that you completed these steps before you ran rails s -e production.
bundle exec rake db:create RAILS_ENV=production
bundle exec rake db:migrate RAILS_ENV=production
bundle exec rake assets:precompile RAILS_ENV=production
then you can run: bundle exec rails s -e production
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
I tried ti backup my gitlab project (it's based on ROR) with a bash script triggered with a CRON job.
The bash script is ok except the rake migrations wiche returns an error:
gitlabBackUp.sh: 12:
/home/backup/scripts/gitlabBackUp.sh: bundle: not found
Here is the way i did it in my gitlabBackUp.sh
# Export the data
bundle exec rake gitlab:backup:create --trace RAILS_ENV=production
I tried without the bundle exec but it returns
/home/backup/scripts/gitlabBackUp.sh: 14:
/home/backup/scripts/gitlabBackUp.sh: rake: not found
Any tips?
EDIT:
I finally get the cron task get working with:
/usr/local/bin/bundle exec /usr/local/bin/rake gitlab:backup:create --trace RAILS_ENV=production
PATH is probably not well specified in cron. You can:
1) Call (exec) bash with -l e.g. exec bash -l /path/to/real-script.sh
Or perhaps directly in cron like 0 16 * * * /bin/bash -l '/home/backup/scripts/gitlabBackUp.sh'
2) Explicitly specify path for bundle and rake e.g. /usr/local/bin/bundle exec /usr/binrake gitlab:backup:create --trace RAILS_ENV=production
You can always know the location of bundle and rake through which bundle and which rake; or type -P bundle and type -P rake.
I have a ruby on rails application that i wish to deploy on a remote linux server from my windows machine. However I get the following out after running cap deploy command at the prompt
Command bundle exec rake assets:clean && EXECJS_RUNTIME='Node' JRUBY_OPTS='-J-d32 -X-C' bundle exec rake assets:precompile returned status code 256
Any ideas on what the error code means?
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