bower-rails不再能够安装包

时间:2014-09-22 15:53:59

标签: ruby-on-rails node.js rake npm bower

不知道为什么但是当前已经安装了bower-rails的项目不能做bower:再安装!

如前所述,我已经在本地安装了软件包。 不知道是哪一个。没有变化!

尝试重新安装npm和bower,没有变化!

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)

DO 在我的/ vendor / assets /目录中有bower.json。

npm -v 1.4.14

凉亭-v
1.3.11

以下是完整的跟踪:

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

当我尝试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)

4 个答案:

答案 0 :(得分:5)

也许为时已晚,但我会把它留在这里,因为我在运行时遇到类似问题 bower-rails

rake bower:install.

我在网上找到的解决方案正在运行:

sudo apt-get install nodejs-legacy

希望它对同样情况下的其他人有所帮助。

答案 1 :(得分:0)

你可以通过nvm安装nodejs,apt-get无法安装nodejs的所有包。

  1. wget -qO- https://raw.githubusercontent.com/creationix/nvm/v0.26.1/install.sh | bash
  2. source ~/.profile
  3. nvm install v0.12.7
  4. npn install bower -g
  5. rake bower:install

答案 2 :(得分:0)

就我而言,我们的代码库使用了Gemfury上托管的私有Bower软件包。我们通过添加启用了此功能 "resolvers": [ "fury-bower-resolver" ] 回到了回购邮件.bowerrc。此设置仅在Bower 1.7.x中受支持。我的全局bower二进制文件是1.7.2,因此运行bower install时没有问题,但rake bower:install任务没有使用我的全局bower;它使用的是my_repo/node_modules/.bin/bower,而且版本是1.4.2,它不了解resolvers设置,因此未找到&#39;错误。您可以在其中一个日志输出行中查看它使用的二进制文件;然后你可以用-v调用那个二进制文件来查看它所在的版本。解决方法是升级bower-rails与npm upgrade bower一起使用的Bower二进制文件(不用说,不要添加-g选项!)

答案 3 :(得分:0)

尝试删除public目录并重新运行vendor

P.S。删除之前,请检查rake bower:install之外vendor目录中的其他内容-您可能还需要重新安装它们。