我从 Heroku 克隆了一个应用程序,该应用程序可以正常工作,但是当我在 Rails 上本地运行它时无法正常工作。我需要配置一些 VAR?
我有相同的 RubyGem 和 Ruby 版本。但不等于,这里复制粘贴 Gem env LOCAL: RubyGems Environment:
- 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/ruby-1.9.2-p290@global
- GEM CONFIGURATION:
- :update_sources => true
- :verbose => true
- :benchmark => false
- :backtrace => false
- :bulk_threshold => 1000
- REMOTE SOURCES:
- http://rubygems.org/
这是HEROKU gem 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 克隆,这个应用程序是 wokring,但就像我说的,不能在本地工作。我做了:rake db:create AND rake db:migrate,但最后我得到这个错误:
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(self)
本地化做...... ......结束
结尾
AppDemo::Application.routes.translate_from_file