【发布时间】:2012-12-28 08:18:24
【问题描述】:
我通过rails new app 创建了一个新的rails 项目。然后命令提示符显示了一些文件的创建,然后显示run bundle install,然后显示了一些东西。
但是,然后我更改了 Gemfile 以添加一些新的 gem,并再次运行 bundle install 来安装这些 gem,但我收到了 invalid argument 错误。那么,如何运行 bundle install 呢?
Rails 版本:3.2.1, 红宝石版本:1.9.3
这是 Gemfile
source 'https://rubygems.org'
gem 'rails', '3.2.1'
# Bundle edge Rails instead:
# gem 'rails', :git => 'git://github.com/rails/rails.git'
gem 'sqlite3'
# Gems used only for assets and not required
# in production environments by default.
group :assets do
gem 'sass-rails', '~> 3.2.3'
gem 'coffee-rails', '~> 3.2.1'
# See https://github.com/sstephenson/execjs#readme for more supported runtimes
# gem 'therubyracer'
gem 'uglifier', '>= 1.0.3'
end
group :development do
gem 'rspec-rails', '2.0.0.beta.18'
end
group :test do
gem 'rspec', '2.0.0.beta.18'
end
gem 'jquery-rails'
更新
事实证明,我之前安装了一个叫做 MoSync 的东西,它可能附带了一个 bundle 命令。所以,当我输入 bundle install 时,它试图运行其他东西但找不到有效的参数。
当我在 powershell 中输入 bundle 并看到以下内容时,这一点变得清晰:
MAUtil::MAFS Bundle tool
This tool is used to build a binary image of a folder on a desktop computer.
Usage:
bundle <parameters>
Parameters:
-in <input file or folder> the input files or folders to add to the
image (multiple -in directives may be added).
-out <output file> the name of the image to be created (only one).
-toUpper/-toLower change case of all file names to upper or lower
case.
Example:
bundle -in data -out anotherworld.bun -toLower
【问题讨论】:
-
向我们展示您的 Gemfile,很可能其中有错误。还向我们展示实际的错误输出。你没有给我们足够的信息来帮助你,我们无法猜测:)
-
@Agis 错误仅此而已。两个字,就是。
-
rspec-railsvresion 字符串中有错字:'bete' 而不是 'beta'。我不确定是不是问题,但你可以试试:)。 -
@Jatin 没有线路错误?奇怪.. 试试
bundle show。你是如何安装 Bundler 的?您的 rspec gem 中也有错误(bete应该是beta)。 -
@Agis 我使用了 rails 安装程序(railsinstaller.org)。它为我安装了捆绑器。即使在删除错字后也会出现错误。
标签: ruby-on-rails ruby-on-rails-3 ruby-on-rails-3.2