2012-04-18 19 views
0

ここでは非常に長い話をするつもりです。私はUbuntuのサーバ上RefineryCMSでアプリケーションを構築して、私は次のようなエラーメッセージが出始めるまですべてがうまく働いていた:Rails URLが機能しない

.rvm/gems/ruby-1.9.2-p290/gems/activesupport-3.0.12/lib/active_support/dependencies.rb:242:in `require': no such file to load -- devise (LoadError) 

私はで

gem install devise 

に続い実行することにより、このエラーを解決することができました

bundle install 

bundle update 

これはブートないことの問題を解決しますが、URLのどれも、このような/ユーザー/ログインとデフォルトのものを含めて働いていないと、いつでも私は、私がページエラーなど

No route matches [GET] "https://stackoverflow.com/users/login" 

を示すだろう、このようなページに移動しますこれが私のジェムセットの問題だと思って、私は新しいものを作って新しいものを作ってから、私のファイルをその上に移動させる意図で新しい精油所のアプリケーションを始めました。しかし、その製油所は、それがデフォルトのレールのページに連れて行ってくれましたし、/public/index.htmlを削除した後、私は再びそれを起動して、その精製所を再確認するために、同じエラー

No route matches [GET] "https://stackoverflow.com/users/login" 

を持った仕事をしていたことを確認するためにそれを起動するとき作業私は/app/views/pages/show.html.erbファイルを上書きする単純なコマンドラインコマンドを実行し、うまくいったん起動してから再度起動し、ユーザー/登録ページにURLを手動で入力して再び同じルートを取得しましたエラー。どちらが私のルートが解釈されているのか、私はどのレベルではわからないが、そのいくつかの問題を確認している。

元のアプリケーションで、レールバージョン3.0.12、webrick 1.3.1、およびruby 1.9.2を使用しています。

現在、これが私のGemfileです:

source 'http://rubygems.org' 

gem "devise" 
gem "savon" 
gem 'refinerycms-testing' 
gem "factory_girl_rails" 
gem "guard-rspec" 
gem "rspec" 

# gem 'rails', '3.0.0' 

# Bundle edge Rails instead: 
# gem 'rails', :git => 'git://github.com/rails/rails.git' 

gem 'sqlite3', :require => 'sqlite3' 

# Use unicorn as the web server 
# gem 'unicorn' 

# Deploy with Capistrano 
# gem 'capistrano' 

# To use debugger 
# gem 'ruby-debug' 

# Bundle the extra gems: 
# gem 'bj' 
# gem 'nokogiri' 
# gem 'sqlite3-ruby', :require => 'sqlite3' 
# gem 'aws-s3', :require => 'aws/s3' 

# Bundle gems for the local environment. Make sure to 
# put test-only gems in this group so their generators 
# and rake tasks are available in development mode: 
# group :development, :test do 
# gem 'webrat' 
# end 

# REFINERY CMS ================================================================ 
# Anything you put in here will be overridden when the app gets updated. 

#gem 'refinerycms',    '~> 1.0.9' 

=begin #testing 
group :development, :test do 
    # To use refinerycms-testing, uncomment it (if it's commented out) and run 'bundle install' 
    # Then, run 'rails generate refinerycms_testing' which will copy its support files. 
    # Finally, run 'rake' to run the tests. 
    #gem 'refinerycms-testing' 
    gem 'capybara-webkit' 

    if RbConfig::CONFIG['target_os'] =~ /darwin/i 
     gem 'growl' 
    end 

    gem 'spork', '~> 0.9.0.rc', :platforms => :ruby 
    gem 'guard-spork', :platforms => :ruby 
    gem 'guard-rspec', :platforms => :ruby 
    gem 'generator_spec' 
end 

=end #testing 

# END REFINERY CMS ============================================================ 

# USER DEFINED 


    # Specify additional Refinery CMS Engines here (all optional): 
    # gem 'refinerycms-inquiries', '~> 1.0' 
    # gem "refinerycms-news",   '~> 1.2' 
    # gem 'refinerycms-blog',   '~> 1.6' 
    # gem 'refinerycms-page-images', '~> 1.0' 

    # Add i18n support (optional, you can remove this if you really want to). 
    #gem 'refinerycms-i18n',   '~> 1.0.0' 

# END USER DEFINED 

そして、私のroutes.rbをファイルには、次のようになります。それはどちらかの元に、製油所のルートに建てられたの認識を停止させたかもしれないのはなぜ

Quicksmile::Application.routes.draw do 

    match "/" => redirect("/new-practices") 

    # The priority is based upon order of creation: 
    # first created -> highest priority. 

    # Sample of regular route: 
    # match 'products/:id' => 'catalog#view' 
    # Keep in mind you can assign values other than :controller and :action 

    # Sample of named route: 
    # match 'products/:id/purchase' => 'catalog#purchase', :as => :purchase 
    # This route can be invoked with purchase_url(:id => product.id) 

    # Sample resource route (maps HTTP verbs to controller actions automatically): 
    # resources :products 

    # Sample resource route with options: 
    # resources :products do 
    #  member do 
    #  get 'short' 
    #  post 'toggle' 
    #  end 
    # 
    #  collection do 
    #  get 'sold' 
    #  end 
    # end 

    # Sample resource route with sub-resources: 
    # resources :products do 
    #  resources :comments, :sales 
    #  resource :seller 
    # end 

    # Sample resource route with more complex sub-resources 
    # resources :products do 
    #  resources :comments 
    #  resources :sales do 
    #  get 'recent', :on => :collection 
    #  end 
    # end 

    # Sample resource route within a namespace: 
    # namespace :admin do 
    #  # Directs /admin/products/* to Admin::ProductsController 
    #  # (app/controllers/admin/products_controller.rb) 
    #  resources :products 
    # end 

    # You can have the root of your site routed with "root" 
    # just remember to delete public/index.html. 

    # See how all your routes lay out with "rake routes" 

    # This is a legacy wild controller route that's not recommended for RESTful applications. 
    # Note: This route will make all actions in every controller accessible via GET requests. 
    # match ':controller(/:action(/:id(.:format)))' 
end 

アプリケーションまたは新しいものが事実の後に始まったか?それを修正する方法はありますか?そうでない場合は、正常に動作していたポイントに戻す方法がありますか?

答えて

1

私はあなたがデバイス設定の一部を行ったかもしれないが、すべてではないように見えます。両方のジェネレータを実行しましたか?それが正しく設定されていた場合devise_for :users

rails generate devise:install 
rails generate devise User 

あなたroutes.rbは、通常のようなものが含まれます。これは、user/sign_inのようなすべてのルートを作成するものです。

関連する問題