bower-rails can't install packages anymore - ruby-on-rails

No idea why but a current already bower-rails installed project can't do bower:install anymore !
As it worked before, I already have packages installed locally.
No idea wht is going one. NO changes as been made !
Tried to reinstall npm and bower, no changes !
rake bower:install
bower.js files generated
/usr/local/bin/bower install -p
bower ENOTFOUND Package dsl-generated dependencies=./vendor/assets/bower.json not found
rake aborted!
Command failed with status (1): [/usr/local/bin/bower install -p ...]
Tasks: TOP => bower:install:production
(See full trace by running task with --trace)
I DO have a bower.json in my /vendor/assets/ directory.
npm -v
1.4.14
bower -v
1.3.11
Here is the full trace:
rake bower:install --trace
** Invoke bower:install (first_time)
** Execute bower:install
** Invoke bower:install:production (first_time)
** Execute bower:install:production
bower.js files generated
/usr/local/bin/bower install -p
bower ENOTFOUND Package dsl-generated dependencies=./vendor/assets/bower.json not found
rake aborted!
Command failed with status (1): [/usr/local/bin/bower install -p ...]
/usr/local/var/rbenv/versions/2.0.0-p353/lib/ruby/gems/2.0.0/gems/rake-10.3.2/lib/rake/file_utils.rb:54:in `block in create_shell_runner'
/usr/local/var/rbenv/versions/2.0.0-p353/lib/ruby/gems/2.0.0/gems/rake-10.3.2/lib/rake/file_utils.rb:45:in `call'
/usr/local/var/rbenv/versions/2.0.0-p353/lib/ruby/gems/2.0.0/gems/rake-10.3.2/lib/rake/file_utils.rb:45:in `sh'
/usr/local/var/rbenv/versions/2.0.0-p353/lib/ruby/gems/2.0.0/gems/bower-rails-0.8.3/lib/tasks/bower.rake:36:in `block (4 levels) in <top (required)>'
/usr/local/var/rbenv/versions/2.0.0-p353/lib/ruby/gems/2.0.0/gems/bower-rails-0.8.3/lib/bower-rails/performer.rb:32:in `instance_exec'
/usr/local/var/rbenv/versions/2.0.0-p353/lib/ruby/gems/2.0.0/gems/bower-rails-0.8.3/lib/bower-rails/performer.rb:32:in `block in perform'
/usr/local/var/rbenv/versions/2.0.0-p353/lib/ruby/gems/2.0.0/gems/bower-rails-0.8.3/lib/bower-rails/performer.rb:57:in `block (2 levels) in dsl_perform_command'
/usr/local/var/rbenv/versions/2.0.0-p353/lib/ruby/gems/2.0.0/gems/bower-rails-0.8.3/lib/bower-rails/performer.rb:56:in `chdir'
/usr/local/var/rbenv/versions/2.0.0-p353/lib/ruby/gems/2.0.0/gems/bower-rails-0.8.3/lib/bower-rails/performer.rb:56:in `block in dsl_perform_command'
/usr/local/var/rbenv/versions/2.0.0-p353/lib/ruby/gems/2.0.0/gems/bower-rails-0.8.3/lib/bower-rails/performer.rb:55:in `each'
/usr/local/var/rbenv/versions/2.0.0-p353/lib/ruby/gems/2.0.0/gems/bower-rails-0.8.3/lib/bower-rails/performer.rb:55:in `dsl_perform_command'
/usr/local/var/rbenv/versions/2.0.0-p353/lib/ruby/gems/2.0.0/gems/bower-rails-0.8.3/lib/bower-rails/performer.rb:31:in `perform'
/usr/local/var/rbenv/versions/2.0.0-p353/lib/ruby/gems/2.0.0/gems/bower-rails-0.8.3/lib/bower-rails/performer.rb:10:in `perform'
/usr/local/var/rbenv/versions/2.0.0-p353/lib/ruby/gems/2.0.0/gems/bower-rails-0.8.3/lib/tasks/bower.rake:35:in `block (3 levels) in <top (required)>'
/usr/local/var/rbenv/versions/2.0.0-p353/lib/ruby/gems/2.0.0/gems/rake-10.3.2/lib/rake/task.rb:240:in `call'
/usr/local/var/rbenv/versions/2.0.0-p353/lib/ruby/gems/2.0.0/gems/rake-10.3.2/lib/rake/task.rb:240:in `block in execute'
/usr/local/var/rbenv/versions/2.0.0-p353/lib/ruby/gems/2.0.0/gems/rake-10.3.2/lib/rake/task.rb:235:in `each'
/usr/local/var/rbenv/versions/2.0.0-p353/lib/ruby/gems/2.0.0/gems/rake-10.3.2/lib/rake/task.rb:235:in `execute'
/usr/local/var/rbenv/versions/2.0.0-p353/lib/ruby/gems/2.0.0/gems/rake-10.3.2/lib/rake/task.rb:179:in `block in invoke_with_call_chain'
/usr/local/var/rbenv/versions/2.0.0-p353/lib/ruby/2.0.0/monitor.rb:211:in `mon_synchronize'
/usr/local/var/rbenv/versions/2.0.0-p353/lib/ruby/gems/2.0.0/gems/rake-10.3.2/lib/rake/task.rb:172:in `invoke_with_call_chain'
/usr/local/var/rbenv/versions/2.0.0-p353/lib/ruby/gems/2.0.0/gems/rake-10.3.2/lib/rake/task.rb:165:in `invoke'
/usr/local/var/rbenv/versions/2.0.0-p353/lib/ruby/gems/2.0.0/gems/bower-rails-0.8.3/lib/tasks/bower.rake:11:in `block (2 levels) in <top (required)>'
/usr/local/var/rbenv/versions/2.0.0-p353/lib/ruby/gems/2.0.0/gems/rake-10.3.2/lib/rake/task.rb:240:in `call'
/usr/local/var/rbenv/versions/2.0.0-p353/lib/ruby/gems/2.0.0/gems/rake-10.3.2/lib/rake/task.rb:240:in `block in execute'
/usr/local/var/rbenv/versions/2.0.0-p353/lib/ruby/gems/2.0.0/gems/rake-10.3.2/lib/rake/task.rb:235:in `each'
/usr/local/var/rbenv/versions/2.0.0-p353/lib/ruby/gems/2.0.0/gems/rake-10.3.2/lib/rake/task.rb:235:in `execute'
/usr/local/var/rbenv/versions/2.0.0-p353/lib/ruby/gems/2.0.0/gems/rake-10.3.2/lib/rake/task.rb:179:in `block in invoke_with_call_chain'
/usr/local/var/rbenv/versions/2.0.0-p353/lib/ruby/2.0.0/monitor.rb:211:in `mon_synchronize'
/usr/local/var/rbenv/versions/2.0.0-p353/lib/ruby/gems/2.0.0/gems/rake-10.3.2/lib/rake/task.rb:172:in `invoke_with_call_chain'
/usr/local/var/rbenv/versions/2.0.0-p353/lib/ruby/gems/2.0.0/gems/rake-10.3.2/lib/rake/task.rb:165:in `invoke'
/usr/local/var/rbenv/versions/2.0.0-p353/lib/ruby/gems/2.0.0/gems/rake-10.3.2/lib/rake/application.rb:150:in `invoke_task'
/usr/local/var/rbenv/versions/2.0.0-p353/lib/ruby/gems/2.0.0/gems/rake-10.3.2/lib/rake/application.rb:106:in `block (2 levels) in top_level'
/usr/local/var/rbenv/versions/2.0.0-p353/lib/ruby/gems/2.0.0/gems/rake-10.3.2/lib/rake/application.rb:106:in `each'
/usr/local/var/rbenv/versions/2.0.0-p353/lib/ruby/gems/2.0.0/gems/rake-10.3.2/lib/rake/application.rb:106:in `block in top_level'
/usr/local/var/rbenv/versions/2.0.0-p353/lib/ruby/gems/2.0.0/gems/rake-10.3.2/lib/rake/application.rb:115:in `run_with_threads'
/usr/local/var/rbenv/versions/2.0.0-p353/lib/ruby/gems/2.0.0/gems/rake-10.3.2/lib/rake/application.rb:100:in `top_level'
/usr/local/var/rbenv/versions/2.0.0-p353/lib/ruby/gems/2.0.0/gems/rake-10.3.2/lib/rake/application.rb:78:in `block in run'
/usr/local/var/rbenv/versions/2.0.0-p353/lib/ruby/gems/2.0.0/gems/rake-10.3.2/lib/rake/application.rb:176:in `standard_exception_handling'
/usr/local/var/rbenv/versions/2.0.0-p353/lib/ruby/gems/2.0.0/gems/rake-10.3.2/lib/rake/application.rb:75:in `run'
./bin/rake:4:in `<main>'
Tasks: TOP => bower:install:production
Same when I try to rake bower:list
rake bower:list
/usr/local/bin/bower list
bower check-new Checking for new versions of the project dependencies..
bower ENOTFOUND Package dsl-generated dependencies=./vendor/assets/bower.json not found
rake aborted!
Command failed with status (1): [/usr/local/bin/bower list...]
Tasks: TOP => bower:list
(See full trace by running task with --trace)

Maybe too late, but I'll leave it here, since I had similar issues using bower-rails, when running:
rake bower:install.
The solution I found on the web is running:
sudo apt-get install nodejs-legacy
Hope it's helpful for someone else in the same situation.

you can install nodejs by nvm, apt-get can't install all packages of nodejs.
wget -qO- https://raw.githubusercontent.com/creationix/nvm/v0.26.1/install.sh | bash
source ~/.profile
nvm install v0.12.7
npn install bower -g
rake bower:install

In my case, our codebase used private Bower packages hosted on Gemfury. We enabled this by adding
"resolvers": [
"fury-bower-resolver"
]
to the repo's .bowerrc. This setting is only supported in Bower 1.7.x. My global bower binary was 1.7.2, so I had no problems running bower install, but the rake bower:install tasks doesn't use my global bower; it uses my_repo/node_modules/.bin/bower instead, and that one was version 1.4.2, which didn't understand the resolvers setting, hence the 'package not found' error. You can see which binary it's using in one of the first log output lines; then you can invoke that binary with -v to see which version it's on. The fix was to upgrade the Bower binary that bower-rails uses with npm upgrade bower (needless to say, don't add the -g option!)

Try deleting the vendor directory and re-running rake bower:install.
P.S. Before deleting please check what else is inside vendor directory besides bower_components - you may have to reinstall those as well.

Related

Redmine not receiving emails

Please help.
I wanted to set up in Redmine 4.1.1 an email read.
This is my code that I am executing in CLI:
bundle exec rake -f Rakefile --silent redmine:email:receive_imap RAILS_ENV="production" host=outlook.office365.com port=993 username=user#domain.com password=PASSWORD ssl=1 project=mars-test-do-not-delete folder=main move_on_success=completed move_on_failure=failed no_permission_check=1 unknown_user=accept no_account_notice=1 --trace
But I am getting this output when I execute the code:
** Invoke redmine:email:receive_imap (first_time)
** Invoke environment (first_time)
** Execute environment
** Execute redmine:email:receive_imap
rake aborted!
NameError: uninitialized constant Redmine::IMAP
/home/seven/redmine/lib/tasks/email.rake:121:in `block (4 levels) in <top (required)>'
/home/seven/redmine/app/models/mailer.rb:630:in `with_synched_deliveries'
/home/seven/redmine/lib/tasks/email.rake:120:in `block (3 levels) in <top (required)>'
/home/seven/.rbenv/versions/2.6.0/lib/ruby/gems/2.6.0/gems/rake-13.0.1/lib/rake/task.rb:281:in `block in execute'
/home/seven/.rbenv/versions/2.6.0/lib/ruby/gems/2.6.0/gems/rake-13.0.1/lib/rake/task.rb:281:in `each'
/home/seven/.rbenv/versions/2.6.0/lib/ruby/gems/2.6.0/gems/rake-13.0.1/lib/rake/task.rb:281:in `execute'
/home/seven/.rbenv/versions/2.6.0/lib/ruby/gems/2.6.0/gems/rake-13.0.1/lib/rake/task.rb:219:in `block in invoke_with_call_chain'
/home/seven/.rbenv/versions/2.6.0/lib/ruby/2.6.0/monitor.rb:230:in `mon_synchronize'
/home/seven/.rbenv/versions/2.6.0/lib/ruby/gems/2.6.0/gems/rake-13.0.1/lib/rake/task.rb:199:in `invoke_with_call_chain'
/home/seven/.rbenv/versions/2.6.0/lib/ruby/gems/2.6.0/gems/rake-13.0.1/lib/rake/task.rb:188:in `invoke'
Tasks: TOP => redmine:email:receive_imap
This is only half of the output.
Any ideas? Suggestions? Anything :)
The SMTP works without any problems. I am using an Exchange MS server for email.
Thank you.
As an update:
I set up a new server ubuntu 20.04 LTS
Installed redmine 4.0.6
Ruby 2.5.0
rake 13.0.1
Now when I run:
rake -f Rakefile --silent redmine:email:receive_imap RAILS_ENV="production" host=outlook.office365.com port=993 username=EMAIL_USER password=PASSWORD ssl=true project=mars-test-do-not-delete folder=main move_on_success=processed move_on_failure=failed no_permission_check=1 unknown_user=accept 1 > /dev/null
I get this:
Your Gemfile lists the gem redmine_crm (>= 0) more than once.
You should probably keep only one of them.
Remove any duplicate entries and specify the gem only once.
While it's not a problem now, it could cause errors if you change the version of one of them later.
rake aborted!
NameError: uninitialized constant Redmine::IMAP
/home/seven/redmine/lib/tasks/email.rake:121:in `block (4 levels) in <top (required)>'
/home/seven/redmine/app/models/mailer.rb:612:in `with_synched_deliveries'
/home/seven/redmine/lib/tasks/email.rake:120:in `block (3 levels) in <top (required)>'
/home/seven/.rvm/gems/ruby-2.5.0/gems/rake-13.0.1/exe/rake:27:in `<top (required)>'
/home/seven/.rvm/gems/ruby-2.5.0/bin/ruby_executable_hooks:24:in `eval'
/home/seven/.rvm/gems/ruby-2.5.0/bin/ruby_executable_hooks:24:in `<main>'
Tasks: TOP => redmine:email:receive_imap
(See full trace by running task with --trace)
I didi check the redmine_crm, to mu surprise in the Gemfile I have only one reference to it, so I do not fully understand why I get this error to;/
I found the problem.
In file:
/ROOT_PATH_TO_REDMINE/lib/tasks/email.rake
I needed to add one line on the top of the file:
require 'redmine/imap.rb'
That solved the problem.

How to use the attach gem in rails 5

My environment:
Ruby 2.4.1
Rails 5.1.4
I am trying to use the attach gem, written by the person who also wrote this article https://atech.blog/atech/file-attachments-in-rails-tutorial.
When I run the bundle install it installs attach gem, version 1.0.2
Then when I try to run the rake command I get an error saying it does not know how to build the task.
rake attach:install:migrations --trace
rake aborted!
Don't know how to build task 'attach:install:migrations' (see --tasks)
/usr/local/rvm/gems/ruby-2.4.1/gems/rake-12.3.0/lib/rake/task_manager.rb:59:in `[]'
/usr/local/rvm/gems/ruby-2.4.1/gems/rake-12.3.0/lib/rake/application.rb:159:in `invoke_task'
/usr/local/rvm/gems/ruby-2.4.1/gems/rake-12.3.0/lib/rake/application.rb:116:in `block (2 levels) in top_level'
/usr/local/rvm/gems/ruby-2.4.1/gems/rake-12.3.0/lib/rake/application.rb:116:in `each'
/usr/local/rvm/gems/ruby-2.4.1/gems/rake-12.3.0/lib/rake/application.rb:116:in `block in top_level'
/usr/local/rvm/gems/ruby-2.4.1/gems/rake-12.3.0/lib/rake/application.rb:125:in `run_with_threads'
/usr/local/rvm/gems/ruby-2.4.1/gems/rake-12.3.0/lib/rake/application.rb:110:in `top_level'
/usr/local/rvm/gems/ruby-2.4.1/gems/rake-12.3.0/lib/rake/application.rb:83:in `block in run'
/usr/local/rvm/gems/ruby-2.4.1/gems/rake-12.3.0/lib/rake/application.rb:186:in `standard_exception_handling'
/usr/local/rvm/gems/ruby-2.4.1/gems/rake-12.3.0/lib/rake/application.rb:80:in `run'
/usr/local/rvm/gems/ruby-2.4.1/gems/rake-12.3.0/exe/rake:27:in `<top (required)>'
/usr/local/rvm/gems/ruby-2.4.1/bin/rake:23:in `load'
/usr/local/rvm/gems/ruby-2.4.1/bin/rake:23:in `<main>'
/usr/local/rvm/gems/ruby-2.4.1/bin/ruby_executable_hooks:15:in `eval'
/usr/local/rvm/gems/ruby-2.4.1/bin/ruby_executable_hooks:15:in `<main>'
Any ideas on what the error is? I am wondering if I am missing a required gem to make it work. The link to the attach documentation is https://github.com/adamcooke/attach
There are no rake tasks defined in this repo.
After you run bundle install, you can get a list of rake tasks by running rake -P (rake -T shows tasks with descriptions). You'll see that attach:install:migrations is not there.
Why not try using paperclip?

Rails App "Permission Denied" error when installing refinerycms

While trying to install refinery, a rails app, I keep getting the following error:
ESL#new-host-2 ~$ refinerycms /Application/MAMP/htdocs/goodwatching
create
/usr/local/rvm/rubies/ruby-1.9.3-p194/lib/ruby/1.9.1/fileutils.rb:247:in `mkdir': Permission denied - /Application (Errno::EACCES)
from /usr/local/rvm/rubies/ruby-1.9.3-p194/lib/ruby/1.9.1/fileutils.rb:247:in `fu_mkdir'
from /usr/local/rvm/rubies/ruby-1.9.3-p194/lib/ruby/1.9.1/fileutils.rb:221:in `block (2 levels) in mkdir_p'
from /usr/local/rvm/rubies/ruby-1.9.3-p194/lib/ruby/1.9.1/fileutils.rb:219:in `reverse_each'
from /usr/local/rvm/rubies/ruby-1.9.3-p194/lib/ruby/1.9.1/fileutils.rb:219:in `block in mkdir_p'
from /usr/local/rvm/rubies/ruby-1.9.3-p194/lib/ruby/1.9.1/fileutils.rb:205:in `each'
from /usr/local/rvm/rubies/ruby-1.9.3-p194/lib/ruby/1.9.1/fileutils.rb:205:in `mkdir_p'
from /usr/local/rvm/gems/ruby-1.9.3-p194/gems/thor-0.16.0/lib/thor/actions/empty_directory.rb:51:in `block in invoke!'
from /usr/local/rvm/gems/ruby-1.9.3-p194/gems/thor-0.16.0/lib/thor/actions/empty_directory.rb:133:in `call'
from /usr/local/rvm/gems/ruby-1.9.3-p194/gems/thor-0.16.0/lib/thor/actions/empty_directory.rb:133:in `invoke_with_conflict_check'
from /usr/local/rvm/gems/ruby-1.9.3-p194/gems/thor-0.16.0/lib/thor/actions/empty_directory.rb:50:in `invoke!'
from /usr/local/rvm/gems/ruby-1.9.3-p194/gems/thor-0.16.0/lib/thor/actions.rb:95:in `action'
from /usr/local/rvm/gems/ruby-1.9.3-p194/gems/thor-0.16.0/lib/thor/actions/empty_directory.rb:15:in `empty_directory'
from /usr/local/rvm/gems/ruby-1.9.3-p194/gems/railties-3.2.13/lib/rails/generators/app_base.rb:103:in `create_root'
from (eval):1:in `create_root'
from /usr/local/rvm/gems/ruby-1.9.3-p194/gems/thor-0.16.0/lib/thor/task.rb:27:in `run'
from /usr/local/rvm/gems/ruby-1.9.3-p194/gems/thor-0.16.0/lib/thor/invocation.rb:120:in `invoke_task'
from /usr/local/rvm/gems/ruby-1.9.3-p194/gems/thor-0.16.0/lib/thor/invocation.rb:126:in `block in invoke_all'
from /usr/local/rvm/gems/ruby-1.9.3-p194/gems/thor-0.16.0/lib/thor/invocation.rb:126:in `each'
from /usr/local/rvm/gems/ruby-1.9.3-p194/gems/thor-0.16.0/lib/thor/invocation.rb:126:in `map'
from /usr/local/rvm/gems/ruby-1.9.3-p194/gems/thor-0.16.0/lib/thor/invocation.rb:126:in `invoke_all'
from /usr/local/rvm/gems/ruby-1.9.3-p194/gems/thor-0.16.0/lib/thor/group.rb:238:in `dispatch'
from /usr/local/rvm/gems/ruby-1.9.3-p194/gems/thor-0.16.0/lib/thor/base.rb:425:in `start'
from /usr/local/rvm/gems/ruby-1.9.3-p194/gems/refinerycms-2.0.10/bin/refinerycms:30:in `<top (required)>'
from /usr/local/rvm/gems/ruby-1.9.3-p194/bin/refinerycms:23:in `load'
from /usr/local/rvm/gems/ruby-1.9.3-p194/bin/refinerycms:23:in `<main>'
from /usr/local/rvm/gems/ruby-1.9.3-p194/bin/ruby_noexec_wrapper:14:in `eval'
from /usr/local/rvm/gems/ruby-1.9.3-p194/bin/ruby_noexec_wrapper:14:in `<main>'
I've seen a couple similar questions but the resolution always seems to be that target directory either doesn't exist or is owned by root. I've checked and my directory exists, is owned by me and has permissions 755.
update
I tried a lot of things so I'm not 100% sure this is relevant, but I updated rvm and then I was able to run refinercyms goodwatching from inside the original /goodwatching directory. But now I'm getting this multiple times when I run it:
NoMethodError: private method `open' called for Gem::Package:Class
An error occured while installing rake (10.0.4), and Bundler cannot continue.
Make sure that `gem install rake -v '10.0.4'` succeeds before bundling.
When I run gem install rake -v '10.0.4' it does succede, but then I get the same error again immediately after.
Try to use sudo
sudo refinerycms /Application/MAMP/htdocs/goodwatching
UPDATE
try to remove Gemfile.lock
then
sudo gem update --system
sudo gem install bundler
sudo bundle install

pg_dump - permission denied (db:structure:dump)

I have problems with getting db:structure:dump to work.
I and getting this error:
C:\Sites\care>rake db:structure:dump --trace
Creating scope :search. Overwriting existing method PgSearch::Document.search.
** Invoke db:structure:dump (first_time)
** Invoke environment (first_time)
** Execute environment
** Execute db:structure:dump
rake aborted!
Permission denied - pg_dump -i -s -x -O -f C:/Sites/care/db/structure.sql care_development
C:/RailsInstaller/Ruby1.9.3/lib/ruby/gems/1.9.1/gems/activesupport-3.2.1/lib/active_support/core_ext/kernel/agnostics.rb:7:in ``'
C:/RailsInstaller/Ruby1.9.3/lib/ruby/gems/1.9.1/gems/activesupport-3.2.1/lib/active_support/core_ext/kernel/agnostics.rb:7:in ``'
C:/RailsInstaller/Ruby1.9.3/lib/ruby/gems/1.9.1/gems/activerecord-3.2.1/lib/active_record/railties/databases.rake:389:in `block (3 levels) in <top (required)>'
C:/RailsInstaller/Ruby1.9.3/lib/ruby/gems/1.9.1/gems/rake-0.9.2.2/lib/rake/task.rb:205:in `call'
C:/RailsInstaller/Ruby1.9.3/lib/ruby/gems/1.9.1/gems/rake-0.9.2.2/lib/rake/task.rb:205:in `block in execute'
C:/RailsInstaller/Ruby1.9.3/lib/ruby/gems/1.9.1/gems/rake-0.9.2.2/lib/rake/task.rb:200:in `each'
C:/RailsInstaller/Ruby1.9.3/lib/ruby/gems/1.9.1/gems/rake-0.9.2.2/lib/rake/task.rb:200:in `execute'
C:/RailsInstaller/Ruby1.9.3/lib/ruby/gems/1.9.1/gems/rake-0.9.2.2/lib/rake/task.rb:158:in `block in invoke_with_call_chain'
C:/RailsInstaller/Ruby1.9.3/lib/ruby/1.9.1/monitor.rb:211:in `mon_synchronize'
C:/RailsInstaller/Ruby1.9.3/lib/ruby/gems/1.9.1/gems/rake-0.9.2.2/lib/rake/task.rb:151:in `invoke_with_call_chain'
C:/RailsInstaller/Ruby1.9.3/lib/ruby/gems/1.9.1/gems/rake-0.9.2.2/lib/rake/task.rb:144:in `invoke'
C:/RailsInstaller/Ruby1.9.3/lib/ruby/gems/1.9.1/gems/rake-0.9.2.2/lib/rake/application.rb:116:in `invoke_task'
C:/RailsInstaller/Ruby1.9.3/lib/ruby/gems/1.9.1/gems/rake-0.9.2.2/lib/rake/application.rb:94:in `block (2 levels) in top_level'
C:/RailsInstaller/Ruby1.9.3/lib/ruby/gems/1.9.1/gems/rake-0.9.2.2/lib/rake/application.rb:94:in `each'
C:/RailsInstaller/Ruby1.9.3/lib/ruby/gems/1.9.1/gems/rake-0.9.2.2/lib/rake/application.rb:94:in `block in top_level'
C:/RailsInstaller/Ruby1.9.3/lib/ruby/gems/1.9.1/gems/rake-0.9.2.2/lib/rake/application.rb:133:in `standard_exception_handling'
C:/RailsInstaller/Ruby1.9.3/lib/ruby/gems/1.9.1/gems/rake-0.9.2.2/lib/rake/application.rb:88:in `top_level'
C:/RailsInstaller/Ruby1.9.3/lib/ruby/gems/1.9.1/gems/rake-0.9.2.2/lib/rake/application.rb:66:in `block in run'
C:/RailsInstaller/Ruby1.9.3/lib/ruby/gems/1.9.1/gems/rake-0.9.2.2/lib/rake/application.rb:133:in `standard_exception_handling'
C:/RailsInstaller/Ruby1.9.3/lib/ruby/gems/1.9.1/gems/rake-0.9.2.2/lib/rake/application.rb:63:in `run'
C:/RailsInstaller/Ruby1.9.3/lib/ruby/gems/1.9.1/gems/rake-0.9.2.2/bin/rake:33:in `<top (required)>'
C:/RailsInstaller/Ruby1.9.3/bin/rake:19:in `load'
C:/RailsInstaller/Ruby1.9.3/bin/rake:19:in `<main>'
Tasks: TOP => db:structure:dump
If I run it like this in CMD, it works:
cd C:\Program Files (x86)\PostgreSQL\9.1\bin
pg_dump.exe -i -s -x -O -f C:/Sites/care/db/structure.sql care_development
I have tried changing the permission on both the pg_dump.exe folder/file and the rails folder/files. But doesn't seem to make any different. Tried adding full permissions for Users, System and even Everyone.
I also tried adding --username params to the pg_dump call (in the rake code) and adding Login Roles that match my windows user in pgAdminIII.
(I'm on Windows 7, Rails 3 and postgreSQL 9)
Do anyone know what the problem can be?
I have same problem on my Linux machine:
Then i used the following command to make it run:
su
>> I logged in first with my Admin user
su -postgres
I save my .sql file in my /tmp folder
For dumping the .sql file in database i run the command
psql -u postgres -d my_db_name -a -f /tmp/path_to_sql_file
It works greatly for me. Hope it may help you.

Unknown encoding error on running rake

I have been writing a Rails app and only now started bringing it under
test coverage. I have written a basic test and when I execute the
'rake' command at the command prompt, I get the following errors:
E:\testapp>rake
(in E:/testapp)
E:/Ruby192/bin/ruby.exe: unknown encoding name - \Ruby192\lib
(RuntimeError)
E:/Ruby192/bin/ruby.exe: unknown encoding name - \Ruby192\lib
(RuntimeError)
E:/Ruby192/bin/ruby.exe: unknown encoding name - \Ruby192\lib
(RuntimeError)
Errors running test:units, test:functionals, test:integration!
When I run rake test:units, I get
E:\testapp>rake test:units
(in E:/testapp)
E:/Ruby192/bin/ruby.exe: unknown encoding name - \Ruby192\lib
(RuntimeError)
rake aborted!
Command failed with status (1): [E:/Ruby192/bin/ruby.exe -I"lib;test"
"E:/R...]
E:/Ruby192/lib/ruby/1.9.1/rake.rb:993:in `block in sh'
E:/Ruby192/lib/ruby/1.9.1/rake.rb:1008:in `call'
E:/Ruby192/lib/ruby/1.9.1/rake.rb:1008:in `sh'
E:/Ruby192/lib/ruby/1.9.1/rake.rb:1092:in `sh'
E:/Ruby192/lib/ruby/1.9.1/rake.rb:1027:in `ruby'
E:/Ruby192/lib/ruby/1.9.1/rake.rb:1092:in `ruby'
E:/Ruby192/lib/ruby/gems/1.9.1/gems/railties-3.0.5/lib/rails/test_unit/testing.rake:26:in `block (2 levels) in define'
E:/Ruby192/lib/ruby/1.9.1/rake.rb:1110:in `verbose'
E:/Ruby192/lib/ruby/gems/1.9.1/gems/railties-3.0.5/lib/rails/test_unit/testing.rake:11:in `block in define'
E:/Ruby192/lib/ruby/1.9.1/rake.rb:634:in `call'
E:/Ruby192/lib/ruby/1.9.1/rake.rb:634:in `block in execute'
E:/Ruby192/lib/ruby/1.9.1/rake.rb:629:in `each'
E:/Ruby192/lib/ruby/1.9.1/rake.rb:629:in `execute'
E:/Ruby192/lib/ruby/1.9.1/rake.rb:595:in `block ininvoke_with_call_chain'
E:/Ruby192/lib/ruby/1.9.1/monitor.rb:201:in `mon_synchronize'
E:/Ruby192/lib/ruby/1.9.1/rake.rb:588:in `invoke_with_call_chain'
E:/Ruby192/lib/ruby/1.9.1/rake.rb:581:in `invoke'
E:/Ruby192/lib/ruby/1.9.1/rake.rb:2041:in `invoke_task'
E:/Ruby192/lib/ruby/1.9.1/rake.rb:2019:in `block (2 levels) intop_level'
E:/Ruby192/lib/ruby/1.9.1/rake.rb:2019:in `each'
E:/Ruby192/lib/ruby/1.9.1/rake.rb:2019:in `block in top_level'
E:/Ruby192/lib/ruby/1.9.1/rake.rb:2058:in`standard_exception_handling'
E:/Ruby192/lib/ruby/1.9.1/rake.rb:2013:in `top_level'
E:/Ruby192/lib/ruby/1.9.1/rake.rb:1992:in `run'
E:/Ruby192/bin/rake:31:in `<main>'
I have tried searching on the Net to no success.. I initially assumed
something was wrong with my test code, but I get the same errors with
a new rails app!!
I am using Rails 3.0.5 on Ruby 1.9.2p180 on Windows Vista. On a friend's suggestion, I
installed RubyInstaller and used DevKit, but I still get the same
error.
Any inputs?
Looking at the path it seems you are pointing to ruby 1.9.1
E:/Ruby192/lib/ruby/1.9.1/rake.rb
I'm not familiar with Windows but something must still be pointing at the old Ruby version

Resources