2013-08-23 206 views
1

我從Heroku克隆了一個應用程序,這個應用程序工作正常,但是當我在Rails本地運行它時不起作用。我需要配置一些VAR?Heroku運行Rails服務器時出錯

我有相同的RubyGem和Ruby版本。不過,這不等於,這裏複製並粘貼寶石ENV LOCAL: RubyGems的環境:

- RUBYGEMS VERSION: 1.3.7 
    - RUBY VERSION: 1.9.2 (2011-07-09 patchlevel 290) [i686-linux] 
    - INSTALLATION DIRECTORY: /home/lala/.rvm/gems/ruby-1.9.2-p290 
    - RUBY EXECUTABLE: /home/lala/.rvm/rubies/ruby-1.9.2-p290/bin/ruby 
    - EXECUTABLE DIRECTORY: /home/lala/.rvm/gems/ruby-1.9.2-p290/bin 
    - RUBYGEMS PLATFORMS: 
    - ruby 
    - x86-linux 
    - GEM PATHS: 
    - /home/lala/.rvm/gems/ruby-1.9.2-p290 
    - /home/lala/.rvm/gems/[email protected] 
    - GEM CONFIGURATION: 
    - :update_sources => true 
    - :verbose => true 
    - :benchmark => false 
    - :backtrace => false 
    - :bulk_threshold => 1000 
    - REMOTE SOURCES: 
    - http://rubygems.org/ 

這裏是Heroku的寶石ENV:

RubyGems的環境:

- RUBYGEMS VERSION: 1.3.7 
    - RUBY VERSION: 1.9.2 (2011-07-09 patchlevel 290) [x86_64-linux] 
    - INSTALLATION DIRECTORY: /usr/local/lib/ruby/gems/1.9.1 
    - RUBY EXECUTABLE: /usr/local/bin/ruby 
    - EXECUTABLE DIRECTORY: /usr/local/bin 
    - RUBYGEMS PLATFORMS: 
    - ruby 
    - x86_64-linux 
    - GEM PATHS: 
    - /usr/local/lib/ruby/gems/1.9.1 
    - /app/vendor/bundle/ruby/1.9.1 
    - vendor/bundle/ruby/1.9.1 
    - GEM CONFIGURATION: 
    - :update_sources => true 
    - :verbose => true 
    - :benchmark => false 
    - :backtrace => false 
    - :bulk_threshold => 1000 
    - REMOTE SOURCES: 
    - http://rubygems.org/ 

我不知道還有什麼我必須設置工作這個應用程序。

這是我的database.yml

- development: 
    - adapter: sqlite3 
    - database: db/development.sqlite3 
    - pool: 5 
    - timeout: 5000 

- test: 
    - adapter: sqlite3 
    - database: db/test.sqlite3 
    - pool: 5 
    - timeout: 5000 

- production: 
    - adapter: sqlite3 
    - database: db/production.sqlite3 
    - pool: 5 
    - timeout: 5000 

我從Heroku的克隆,這個程序是工作呢,但就像我說的,不在本地工作。 我所做的:耙分貝:創建和耙分貝:遷移,但最後我得到這個錯誤:

rake aborted! 
undefined method `translate_from_file' for #<ActionDispatch::Routing::RouteSet:0xaefad80> 

/home/lala/rails_projects/wikasport/config/routes.rb:47:in `<top (required)>' 

/home/lala/.rvm/gems/ruby-1.9.2-p290/gems/activesupport-3.2.11/lib/active_support/dependencies.rb:245:in `load' 

/home/lala/.rvm/gems/ruby-1.9.2-p290/gems/activesupport-3.2.11/lib/active_support/dependencies.rb:245:in `block in load' 

/home/lala/.rvm/gems/ruby-1.9.2-p290/gems/activesupport-3.2.11/lib/active_support/dependencies.rb:236:in `load_dependency' 

/home/lala/.rvm/gems/ruby-1.9.2-p290/gems/activesupport-3.2.11/lib/active_support/dependencies.rb:245:in `load' 

/home/lala/.rvm/gems/ruby-1.9.2-p290/gems/railties-3.2.11/lib/rails/application/routes_reloader.rb:40:in `block in load_paths' 

/home/lala/.rvm/gems/ruby-1.9.2-p290/gems/railties-3.2.11/lib/rails/application/routes_reloader.rb:40:in `each' 

/home/lala/.rvm/gems/ruby-1.9.2-p290/gems/railties-3.2.11/lib/rails/application/routes_reloader.rb:40:in `load_paths' 

/home/lala/.rvm/gems/ruby-1.9.2-p290/gems/railties-3.2.11/lib/rails/application/routes_reloader.rb:16:in `reload!' 

/home/lala/.rvm/gems/ruby-1.9.2-p290/gems/railties-3.2.11/lib/rails/application.rb:108:in `reload_routes!' 

/home/lala/.rvm/gems/ruby-1.9.2-p290/gems/activeadmin-0.6.0/lib/active_admin/reloader.rb:34:in `reload!' 

/home/lala/.rvm/gems/ruby-1.9.2-p290/gems/activeadmin-0.6.0/lib/active_admin/reloader.rb:61:in `block in attach!' 

/home/lala/.rvm/gems/ruby-1.9.2-p290/gems/activesupport-3.2.11/lib/active_support/callbacks.rb:429:in `_run__506550043__prepare__394196312__callbacks' 

/home/lala/.rvm/gems/ruby-1.9.2-p290/gems/activesupport-3.2.11/lib/active_support/callbacks.rb:405:in `__run_callback' 

/home/lala/.rvm/gems/ruby-1.9.2-p290/gems/activesupport-3.2.11/lib/active_support/callbacks.rb:385:in `_run_prepare_callbacks' 

/home/lala/.rvm/gems/ruby-1.9.2-p290/gems/activesupport-3.2.11/lib/active_support/callbacks.rb:81:in `run_callbacks' 

/home/lala/.rvm/gems/ruby-1.9.2-p290/gems/actionpack-3.2.11/lib/action_dispatch/middleware/reloader.rb:74:in `prepare!' 

/home/lala/.rvm/gems/ruby-1.9.2-p290/gems/actionpack-3.2.11/lib/action_dispatch/middleware/reloader.rb:48:in `prepare!' 

/home/lala/.rvm/gems/ruby-1.9.2-p290/gems/railties-3.2.11/lib/rails/application/finisher.rb:47:in `block in <module:Finisher>' 

/home/lala/.rvm/gems/ruby-1.9.2-p290/gems/railties-3.2.11/lib/rails/initializable.rb:30:in `instance_exec' 

/home/lala/.rvm/gems/ruby-1.9.2-p290/gems/railties-3.2.11/lib/rails/initializable.rb:30:in `run' 

/home/lala/.rvm/gems/ruby-1.9.2-p290/gems/railties-3.2.11/lib/rails/initializable.rb:55:in `block in run_initializers' 

/home/lala/.rvm/gems/ruby-1.9.2-p290/gems/railties-3.2.11/lib/rails/initializable.rb:54:in `each' 

/home/lala/.rvm/gems/ruby-1.9.2-p290/gems/railties-3.2.11/lib/rails/initializable.rb:54:in `run_initializers' 

/home/lala/.rvm/gems/ruby-1.9.2-p290/gems/railties-3.2.11/lib/rails/application.rb:136:in `initialize!' 

/home/lala/.rvm/gems/ruby-1.9.2-p290/gems/railties-3.2.11/lib/rails/railtie/configurable.rb:30:in `method_missing' 

/home/lala/rails_projects/wikasport/config/environment.rb:4:in `<top (required)>' 

/home/lala/.rvm/gems/ruby-1.9.2-p290/gems/activesupport-3.2.11/lib/active_support/dependencies.rb:251:in `require' 

/home/lala/.rvm/gems/ruby-1.9.2-p290/gems/activesupport-3.2.11/lib/active_support/dependencies.rb:251:in `block in require' 

/home/lala/.rvm/gems/ruby-1.9.2-p290/gems/activesupport-3.2.11/lib/active_support/dependencies.rb:236:in `load_dependency' 

/home/lala/.rvm/gems/ruby-1.9.2-p290/gems/activesupport-3.2.11/lib/active_support/dependencies.rb:251:in `require' 

/home/lala/.rvm/gems/ruby-1.9.2-p290/gems/railties-3.2.11/lib/rails/application.rb:103:in `require_environment!' 

/home/lala/.rvm/gems/ruby-1.9.2-p290/gems/railties-3.2.11/lib/rails/application.rb:297:in `block (2 levels) in initialize_tasks' 

/home/lala/.rvm/gems/ruby-1.9.2-p290/bin/ruby_noexec_wrapper:14:in `eval' 

/home/lala/.rvm/gems/ruby-1.9.2-p290/bin/ruby_noexec_wrapper:14:in `<main>' 
Tasks: TOP => db:migrate => environment 
(See full trace by running task with --trace) 

這裏的routes.rb

AppDemo :: Application.routes.draw做 ActiveAdmin.routes(個體經營)

本地化做 ..... ..... 結束

結束

AppDemo :: Application.routes.translate_from_file


+0

什麼不起作用?任何異常或錯誤? –

+0

編輯錯誤 – AvaCristian

回答

1

你必須至少提供數據庫連接。這意味着您必須創建database.yml並將其配置爲您的數據庫。

+0

我編輯了帖子,添加了我的database.yml和錯誤 – AvaCristian

+0

爲我們提供config/route.rb,那裏有47行嗎? – ka8725