【问题标题】:Rails 2.3.4 Errors, :rails s && :bundle not working?Rails 2.3.4 错误,:rails s && :bundle 不工作?
【发布时间】:2013-11-29 17:44:46
【问题描述】:

我有一个朋友有一个现有的 Rails 应用程序,根据 environment.rb 文件,它似乎是在“2.3.4”中构建的。他对此有一些问题,并要求我为他调查一下。

我习惯使用 Rails 3.2+。

我下载了他的文件并运行了bundle 命令并得到了这个响应:

Could not locate Gemfile

然后我尝试通过运行rails s 命令在本地签出该站点。我回来了:

Usage:
  rails new APP_PATH [options]

Options:
  -r, [--ruby=PATH]              # Path to the Ruby binary of your choice
                                 # Default: /Users/stevenbrooks1111/.rvm/rubies/ruby-1.9.3-p429/bin/ruby
  -m, [--template=TEMPLATE]      # Path to some application template (can be a filesystem path or URL)
      [--skip-gemfile]           # Don't create a Gemfile
  -B, [--skip-bundle]            # Don't run bundle install
  -G, [--skip-git]               # Skip .gitignore file
      [--skip-keeps]             # Skip source control .keep files
  -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
      [--rc=RC]                  # Path to file containing extra configuration options for rails command
      [--no-rc]                  # Skip loading of extra configuration options from .railsrc file

Runtime options:
  -f, [--force]    # Overwrite files that already exist
  -p, [--pretend]  # Run but do not make any changes
  -q, [--quiet]    # Suppress status output
  -s, [--skip]     # Skip files that already exist

Rails options:
  -h, [--help]     # Show this help message and quit
  -v, [--version]  # Show Rails version number and quit

Description:
    The 'rails new' command creates a new Rails application with a default
    directory structure and configuration at the path you specify.

    You can specify extra command-line arguments to be used every time
    'rails new' runs in the .railsrc configuration file in your home directory.

    Note that the arguments specified in the .railsrc file don't affect the
    defaults values shown above in this help message.

Example:
    rails new ~/Code/Ruby/weblog

    This generates a skeletal Rails installation in ~/Code/Ruby/weblog.
    See the README in the newly created application to get going.

我希望能够告诉我的朋友问题是什么以及浏览该网站。它运行的服务器不再接受低于 Rails 3.2 的任何内容。

如何在本地运行此服务器?我不知道是什么问题,因为:

  1. 他没有 gemfile。
  2. 我什至看不到他的网站。
  3. 我看不出他的错误在哪里,因为他没有任何测试。

【问题讨论】:

  • 我在应用程序的目录中,当我运行 :ls 时,我会以我在 rails 3 中习惯的方式看到文件夹
  • 这是stackoverflow.com/questions/20291309/… 的部分副本。不要那样做。提出一个问题并对其进行修改以添加任何其他信息。问两次会重复工作并划分结果,使您的问题对寻求类似答案的其他人来说不太有效和有用。

标签: ruby-on-rails ruby ruby-on-rails-2


【解决方案1】:

bundle 不起作用。 Rails 2.3 没有与捆绑器集成。 rails s 也不起作用。为了在 Rails 2.3 中启动应用服务器,你需要运行

script/server

【讨论】:

  • 当我运行该命令时,我得到以下信息:-bash: script/server: Permission denied
  • 我也刚刚尝试运行 'ruby script/server' 也出现了一堆错误。
  • @user2184718 你可能有一些权限问题。你有权限写app目录吗?
【解决方案2】:

添加到另一个答案,运行ruby --versiongem list -d rails,以检查您是否安装了正确的版本并在路径上。 (我现在正在开发一个“太大而无法升级”的 Rails 2.3 项目!)

【讨论】:

猜你喜欢
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 2014-07-13
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
相关资源
最近更新 更多