【发布时间】:2012-09-14 04:33:32
【问题描述】:
使用 rbenv 所以创建新应用的过程有点复杂:
- 创建目录
- cd 目录
- 设置 ruby 版本:
rbenv local 1.9.3-p125(或其他版本) - 镶嵌宝石:
echo project-name > .rbenv-gemsets -
gem install rails -v 3.2.2 --no-rdoc --no-ri(例如) rbenv rehashecho "gem 'rails', '3.2.2'" > Gemfilebundle-
rails new .(输入 y 覆盖) bundle
这之前有效,但这次我在rails new . 命令上遇到错误:
...
...
create vendor/assets/stylesheets
create vendor/assets/stylesheets/.gitkeep
create vendor/plugins
create vendor/plugins/.gitkeep
run bundle install
b/gems/bundler-1.2.1/lib/bundler/resolver.rb:287:in `resolve': Could not find gem 'jquery-rails (>= 0) ruby' in the gems available on this machine. (Bundler::GemNotFound)
运行rails new .第二次抛出
Can't initialize a new Rails application within the directory of another, please change to a non-Rails directory first.
如果无法使用rails new app-name,初始化新 Rails 应用程序的最佳方法是什么?
如何只创建 Gemfile?如果我有正确的 Rails Gemfile,那么 bundle 和 rails new . 应该可以工作...
【问题讨论】:
-
问题似乎是 jquery-rails 的安装。您是否尝试再次运行捆绑软件?
标签: ruby-on-rails ruby-on-rails-3 bundle bundler rbenv