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 do ActiveAdmin.routes(self)
ローカライズド・・・・・エンド
終わり
AppDemo::Application.routes.translate_from_file