【问题标题】:Failing to install Locomotive CMS at bundle exec无法在 bundle exec 中安装 Locomotive CMS
【发布时间】:2013-06-04 06:27:57
【问题描述】:

我正在尝试安装 LocomotiveCMS 并尝试遵循本指南:http://doc.locomotivecms.com/guides/get-started/install-engine。我到了我必须输入的部分:

bundle exec rails g locomotive:install

然后只输出 rails 使用命令:

MacBook-Pro:myapp chris$ bundle exec rails g locomotive:install
Usage:
  rails new APP_PATH [options]

Options:
  -r, [--ruby=PATH]              # Path to the Ruby binary of your choice
                                 # Default: /Users/chris/.rvm/rubies/ruby-2.0.0-p195/bin/ruby
  -b, [--builder=BUILDER]        # Path to a application builder (can be a filesystem path or URL)
  -m, [--template=TEMPLATE]      # Path to an application template (can be a filesystem path or URL)
      [--skip-gemfile]           # Don't create a Gemfile
      [--skip-bundle]            # Don't run bundle install
  -G, [--skip-git]               # Skip Git ignores and keeps
  -O, [--skip-active-record]     # Skip Active Record files
  -S, [--skip-sprockets]         # Skip Sprockets files
  -d, [--database=DATABASE]      # Preconfigure for selected database (options: mysql/oracle/postgresql/sqlite3/frontbase/ibm_db/sqlserver/jdbcmysql/jdbcsqlite3/jdbcpostgresql/jdbc)
                                 # Default: sqlite3
  -j, [--javascript=JAVASCRIPT]  # Preconfigure for selected JavaScript library
                                 # Default: jquery
  -J, [--skip-javascript]        # Skip JavaScript files
      [--dev]                    # Setup the application with Gemfile pointing to your Rails checkout
      [--edge]                   # Setup the application with Gemfile pointing to Rails repository
  -T, [--skip-test-unit]         # Skip Test::Unit files

....

我不确定我做错了什么。我按照这封信的指南...

任何帮助将不胜感激。谢谢!

编辑:“捆绑安装”似乎运行良好。

Your bundle is complete!
Use `bundle show [gemname]` to see where a bundled gem is installed.

我的 Rails 版本是:

Rails 3.2.13

我的红宝石版本是:

ruby 2.0.0p195 (2013-05-14 revision 40734) [x86_64-darwin12.3.0]

这是我当前的 Gemfile(尽管我确实尝试稍微改变一下以进行测试):

source 'https://rubygems.org'

# Bundle edge Rails instead: gem 'rails', github: 'rails/rails'
gem 'rails', '3.2.13'

gem 'locomotive_cms', '~> 2.0.1', :require => 'locomotive/engine'
gem 'unicorn', :group => 'development'
gem 'compass-rails',  '~> 1.0.3', :group => 'assets'

# Use SCSS for stylesheets
gem 'sass-rails', '~> 3.2.6', :group => 'assets'

# Use Uglifier as compressor for JavaScript assets
gem 'uglifier', '>= 2.1.1', :group => 'assets'
# Use CoffeeScript for .js.coffee assets and views
gem 'coffee-rails', '~> 3.2.2', :group => 'assets'

# See https://github.com/sstephenson/execjs#readme for more supported runtimes
# gem 'therubyracer', platforms: :ruby

# Build JSON APIs with ease. Read more: https://github.com/rails/jbuilder
gem 'jbuilder', '~> 1.0.1', :group => 'assets'

group :doc do
  # bundle exec rake doc:rails generates the API under doc/api.
  gem 'sdoc', require: false
end

# Use ActiveModel has_secure_password
# gem 'bcrypt-ruby', '~> 3.0.0'

# Use unicorn as the app server
# gem 'unicorn'

# Use Capistrano for deployment
# gem 'capistrano', group: :development

# Use debugger
# gem 'debugger', group: [:development, :test]

【问题讨论】:

  • bundle install 命令最终是否没有任何错误?如果您在没有直接捆绑上下文的情况下启动相同的命令怎么办:rails generate locomotive:install?
  • 是的,bundle install 命令确实有效。它说“你的包已经完成了!”我只是尝试用“rails g locomotive:install”省略捆绑上下文,结果相同......
  • 你能显示rails --version的输出吗?
  • 当然,输出是:“Rails 3.2.13”
  • 好吧,我现在已经在 rails 3.2.13 和 ruby​​-1.9.3-p194 上成功安装了 loco cms,没有任何问题。你能显示你的 Gemfile 内容吗?

标签: ruby-on-rails locomotivecms


【解决方案1】:

向上移动一个目录(在您的 rails 应用程序目录之上一层)并运行:

rails -v

您可能会看到 3.2.13 以外的版本。如果这样做,请尝试使用以下方法创建您的项目:

rails _3.2.13_ new app_name --skip-active-record --skip-test-unit --skip-javascript --skip-bundle

【讨论】:

  • 谢谢!!这就是我一直在寻找的
  • 就是这样。我花了几个小时在这个..因此,如果@kurisukun 接受这个答案会很好/很清楚。+
【解决方案2】:

我认为这是安装指南中的错误。

只需将命令行更改为:

rails g locomotive:install

一切都会好起来的,我刚刚做到了。 ^^

【讨论】:

  • 这对我有用,谢谢! LocomotiveCMS 网站上的文档似乎有误。
  • “正确”的方式是使用bundle。如果这可行,那么您的捆绑包配置可能有问题。
猜你喜欢
  • 1970-01-01
  • 1970-01-01
  • 2014-09-13
  • 2021-04-25
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
相关资源
最近更新 更多