首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >"rails服务器“没有在本地看到rails项目,该项目在heroku上运行良好。

"rails服务器“没有在本地看到rails项目,该项目在heroku上运行良好。
EN

Stack Overflow用户
提问于 2016-02-16 16:25:16
回答 1查看 372关注 0票数 1

我刚开始使用rails,在heroku中创建了简单的“空”应用程序,并将其与我的dropbox帐户同步。我能够在web浏览器中打开heroku站点,然后我更改了index.rb并部署了应用程序,更改为正确地完成了,我在web浏览器中看到了结果。

因此,dropbox文件夹中的应用程序工作正常,但我无法在本地运行它。当我在项目文件夹中键入rails服务器时,它只是无法识别项目,并给出:

代码语言:javascript
复制
C:\Users\Dav\Dropbox\Apps\Heroku\aqueous-waters-4632>rails server
DL is deprecated, please use Fiddle
Usage:
  rails new APP_PATH [options]

Options:
  -r, [--ruby=PATH]                                      # Path to the Ruby bina
ry of your choice
                                                         # Default: C:/RailsInst
aller/Ruby2.0.0/bin/ruby.exe
  -m, [--template=TEMPLATE]                              # Path to some applicat
ion template (can be a filesystem path or URL)
      [--skip-gemfile], [--no-skip-gemfile]              # Don't create a Gemfil
e
  -B, [--skip-bundle], [--no-skip-bundle]                # Don't run bundle inst
all
  -G, [--skip-git], [--no-skip-git]                      # Skip .gitignore file
      [--skip-keeps], [--no-skip-keeps]                  # Skip source control .
keep files
  -O, [--skip-active-record], [--no-skip-active-record]  # Skip Active Record fi
les
  -V, [--skip-action-view], [--no-skip-action-view]      # Skip Action View file
s
  -S, [--skip-sprockets], [--no-skip-sprockets]          # Skip Sprockets files
      [--skip-spring], [--no-skip-spring]                # Don't install Spring
application preloader
  -d, [--database=DATABASE]                              # Preconfigure for sele
cted database (options: mysql/oracle/postgresql/sqlite3/frontbase/ibm_db/sqlserv
er/jdbcmysql/jdbcsqlite3/jdbcpostgresql/jdbc)
                                                         # Default: sqlite3
  -j, [--javascript=JAVASCRIPT]                          # Preconfigure for sele
cted JavaScript library
                                                         # Default: jquery
  -J, [--skip-javascript], [--no-skip-javascript]        # Skip JavaScript files

      [--dev], [--no-dev]                                # Setup the application
 with Gemfile pointing to your Rails checkout
      [--edge], [--no-edge]                              # Setup the application
 with Gemfile pointing to Rails repository
  -T, [--skip-test-unit], [--no-skip-test-unit]          # Skip Test::Unit files

      [--rc=RC]                                          # Path to file containi
ng extra configuration options for rails command
      [--no-rc], [--no-no-rc]                            # Skip loading of extra
 configuration options from .railsrc file

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

Rails options:
  -h, [--help], [--no-help]        # Show this help message and quit
  -v, [--version], [--no-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版本(Ruby2.0和Rails 4.1.8):

代码语言:javascript
复制
C:\Users\Dav\Dropbox\Apps\Heroku\aqueous-waters-4632>ruby -v
ruby 2.0.0p598 (2014-11-13) [i386-mingw32]

C:\Users\Dav\Dropbox\Apps\Heroku\aqueous-waters-4632>rails -v
DL is deprecated, please use Fiddle
Rails 4.1.8

C:\Users\Dav\Dropbox\Apps\Heroku\aqueous-waters-4632>gem list

*** LOCAL GEMS ***

bundler (1.11.2)
jar-dependencies (0.1.15)
jruby-openssl (0.9.7 java)
jruby-win32ole (0.8.5)
json (1.8.0 java)
minitest (5.4.1)
power_assert (0.2.3)
psych (2.0.14.pre1 java)
rake (10.1.0)
rdoc (4.1.0)
ruby-maven (3.3.3)
ruby-maven-libs (3.3.3)
test-unit (3.0.3)

,最后这是heroku构建日志以供参考(Ruby2.2.2和Rails 4.1.8):

代码语言:javascript
复制
-----> Using set buildpack heroku/ruby

-----> Ruby app detected

-----> Compiling Ruby/Rails

-----> Using Ruby version: ruby-2.2.2-jruby-9.0.0.0

-----> Installing JVM: openjdk-8

-----> Installing dependencies using bundler 1.9.7

       Running: bundle install --without development:test --path vendor/bundle --binstubs vendor/bundle/bin -j4 --deployment

       Using json 1.8.1

       Using minitest 5.4.3

       Using thread_safe 0.3.4

       Using builder 3.2.2

       Using erubis 2.7.0

       Using rake 10.4.0

       Using rack 1.5.2

       Using i18n 0.6.11

       Using mime-types 2.4.3

       Using arel 5.0.1.20140414130214

       Using coffee-script-source 1.8.0

       Using jdbc-postgres 9.3.1102

       Using execjs 2.2.2

       Using thor 0.19.1

       Using hike 1.2.3

       Using multi_json 1.10.1

       Using bundler 1.9.7

       Using tilt 1.4.1

       Using rails_serve_static_assets 0.0.2

       Using rails_stdout_logging 0.0.3

       Using sass 3.2.19

       Using tzinfo 1.2.2

       Using rdoc 4.1.2

       Using mail 2.6.3

       Using rack-test 0.6.2

       Using puma 2.9.1

       Using coffee-script 2.3.0

       Using uglifier 2.5.3

       Using rails_12factor 0.0.3

       Using sprockets 2.12.3

       Using activesupport 4.1.8

       Using tzinfo-data 1.2015.1

       Using sdoc 0.4.1

       Using actionview 4.1.8

       Using activemodel 4.1.8

       Using jbuilder 2.2.5

       Using actionpack 4.1.8

       Using activerecord 4.1.8

       Using actionmailer 4.1.8

       Using sprockets-rails 2.2.2

       Using railties 4.1.8

       Using activerecord-jdbc-adapter 1.3.14

       Using activerecord-jdbcpostgresql-adapter 1.3.14

       Using coffee-rails 4.0.1

       Using jquery-rails 3.1.2

       Using rails 4.1.8

       Using sass-rails 4.0.5

       Using turbolinks 2.5.2

       Bundle complete! 13 Gemfile dependencies, 48 gems now installed.

       Gems in the groups development and test were not installed.

       Bundled gems are installed into ./vendor/bundle.

       Bundle completed (8.97s)

       Cleaning up the bundler cache.

-----> Preparing app for Rails asset pipeline

       Running: rake assets:precompile

       Asset precompilation completed (13.25s)

       Cleaning assets

       Running: rake assets:clean

-----> Discovering process types

       Procfile declares types     -> web

       Default types for buildpack -> console, rake, worker

-----> Compressing...

       Done: 101.5M

-----> Launching...

       Released v8
EN

回答 1

Stack Overflow用户

发布于 2016-02-16 16:52:12

尝试运行bundle install来安装您的gems,转到db/迁移,然后运行rake db:migrate,然后运行rails s

票数 0
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/35437780

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档