ruby on rails - 'rake assets: precompile' giving me errors in development and production -
whenever try deploy app cap production deploy:migrations
error message along lines:
* executing "ln -nfs /var/www/apps/myapp/releases/20130802221024/config/configs/resque_schedule.yml /var/www/apps/myapp/releases/20130802221024/config/resque_schedule.yml" servers: ["12.34.567.8"] [12.34.567.8] executing command command finished in 550ms triggering after callbacks `deploy:update_code' * executing `deploy:assets:precompile' * executing "cd /var/www/apps/myapp/releases/20130802221024 && bundle exec rake rails_env=production rails_groups=assets assets:precompile" servers: ["12.34.567.8"] [12.34.567.8] executing command ** [out :: 12.34.567.8] rake aborted! ** [out :: 12.34.567.8] received wrong number of arguments. [nil] ** [out :: 12.34.567.8] /var/www/apps/myapp/shared/bundle/ruby/1.8/gems/omniauth-1.1.0/lib/omniauth/strategy.rb:136:in `initialize' ** [out :: 12.34.567.8] /var/www/apps/myapp/shared/bundle/ruby/1.8/gems/actionpack-3.2.3/lib/action_dispatch/middleware/stack.rb:43:in `new' ** [out :: 12.34.567.8] /var/www/apps/myapp/shared/bundle/ruby/1.8/gems/actionpack-3.2.3/lib/action_dispatch/middleware/stack.rb:43:in `build'
i had been believed there configuration issue server, or missing dependency files. on local ubuntu when run in terminal:
bundle exec rake assets:precompile --trace
i get:
mycompaq@ubuntu:~/myapp$ bundle exec rake assets:precompile --trace deprecation warning: require "activerecord" deprecated , removed in rails 3. use require "active_record" instead. (called /usr/lib/ruby/vendor_ruby/activerecord.rb:2) ** invoke assets:precompile (first_time) ** execute assets:precompile /usr/bin/ruby1.8 /usr/local/bin/rake assets:precompile:all rails_env=production rails_groups=assets --trace deprecation warning: require "activerecord" deprecated , removed in rails 3. use require "active_record" instead. (called /usr/lib/ruby/vendor_ruby/activerecord.rb:2) ** invoke assets:precompile:all (first_time) ** execute assets:precompile:all ** invoke assets:precompile:primary (first_time) ** invoke assets:environment (first_time) ** execute assets:environment ** invoke environment (first_time) ** execute environment rake aborted! received wrong number of arguments. [nil] /var/lib/gems/1.8/gems/omniauth-1.1.0/lib/omniauth/strategy.rb:136:in `initialize' /var/lib/gems/1.8/gems/actionpack-3.2.3/lib/action_dispatch/middleware/stack.rb:43:in `new' /var/lib/gems/1.8/gems/actionpack-3.2.3/lib/action_dispatch/middleware/stack.rb:43:in `build' /var/lib/gems/1.8/gems/actionpack-3.2.3/lib/action_dispatch/middleware/stack.rb:113:in `build' /var/lib/gems/1.8/gems/railties-3.2.3/lib/rails/application.rb:282:in `inject' /var/lib/gems/1.8/gems/actionpack-3.2.3/lib/action_dispatch/middleware/stack.rb:113:in `each' /var/lib/gems/1.8/gems/actionpack-3.2.3/lib/action_dispatch/middleware/stack.rb:113:in `inject' /var/lib/gems/1.8/gems/actionpack-3.2.3/lib/action_dispatch/middleware/stack.rb:113:in `build' /var/lib/gems/1.8/gems/railties-3.2.3/lib/rails/engine.rb:470:in `build_middleware_stack' /var/lib/gems/1.8/gems/railties-3.2.3/lib/rails/application/finisher.rb:31 /var/lib/gems/1.8/gems/railties-3.2.3/lib/rails/initializable.rb:30:in `instance_exec' /var/lib/gems/1.8/gems/railties-3.2.3/lib/rails/initializable.rb:30:in `run' /var/lib/gems/1.8/gems/railties-3.2.3/lib/rails/initializable.rb:55:in `run_initializers' /var/lib/gems/1.8/gems/railties-3.2.3/lib/rails/initializable.rb:54:in `each' /var/lib/gems/1.8/gems/railties-3.2.3/lib/rails/initializable.rb:54:in `run_initializers' /var/lib/gems/1.8/gems/railties-3.2.3/lib/rails/application.rb:136:in `initialize!' /var/lib/gems/1.8/gems/railties-3.2.3/lib/rails/railtie/configurable.rb:30:in `send' /var/lib/gems/1.8/gems/railties-3.2.3/lib/rails/railtie/configurable.rb:30:in `method_missing' /home/mycompaq/myapp/config/environment.rb:5 /var/lib/gems/1.8/gems/activesupport-3.2.3/lib/active_support/dependencies.rb:251:in `require' /var/lib/gems/1.8/gems/activesupport-3.2.3/lib/active_support/dependencies.rb:251:in `require' /var/lib/gems/1.8/gems/activesupport-3.2.3/lib/active_support/dependencies.rb:236:in `load_dependency' /var/lib/gems/1.8/gems/activesupport-3.2.3/lib/active_support/dependencies.rb:251:in `require' /var/lib/gems/1.8/gems/railties-3.2.3/lib/rails/application.rb:103:in `require_environment!' /var/lib/gems/1.8/gems/railties-3.2.3/lib/rails/application.rb:292:in `initialize_tasks' /var/lib/gems/1.8/gems/rake-10.0.4/lib/rake/task.rb:246:in `call' /var/lib/gems/1.8/gems/rake-10.0.4/lib/rake/task.rb:246:in `execute' /var/lib/gems/1.8/gems/rake-10.0.4/lib/rake/task.rb:241:in `each' /var/lib/gems/1.8/gems/rake-10.0.4/lib/rake/task.rb:241:in `execute' /var/lib/gems/1.8/gems/rake-10.0.4/lib/rake/task.rb:184:in `invoke_with_call_chain' /usr/lib/ruby/1.8/monitor.rb:242:in `synchronize' /var/lib/gems/1.8/gems/rake-10.0.4/lib/rake/task.rb:177:in `invoke_with_call_chain' /var/lib/gems/1.8/gems/rake-10.0.4/lib/rake/task.rb:170:in `invoke' /var/lib/gems/1.8/gems/actionpack-3.2.3/lib/sprockets/assets.rake:93 /var/lib/gems/1.8/gems/rake-10.0.4/lib/rake/task.rb:246:in `call' /var/lib/gems/1.8/gems/rake-10.0.4/lib/rake/task.rb:246:in `execute' /var/lib/gems/1.8/gems/rake-10.0.4/lib/rake/task.rb:241:in `each' /var/lib/gems/1.8/gems/rake-10.0.4/lib/rake/task.rb:241:in `execute' /var/lib/gems/1.8/gems/rake-10.0.4/lib/rake/task.rb:184:in `invoke_with_call_chain' /usr/lib/ruby/1.8/monitor.rb:242:in `synchronize' /var/lib/gems/1.8/gems/rake-10.0.4/lib/rake/task.rb:177:in `invoke_with_call_chain' /var/lib/gems/1.8/gems/rake-10.0.4/lib/rake/task.rb:205:in `invoke_prerequisites' /var/lib/gems/1.8/gems/rake-10.0.4/lib/rake/task.rb:203:in `each' /var/lib/gems/1.8/gems/rake-10.0.4/lib/rake/task.rb:203:in `invoke_prerequisites' /var/lib/gems/1.8/gems/rake-10.0.4/lib/rake/task.rb:183:in `invoke_with_call_chain' /usr/lib/ruby/1.8/monitor.rb:242:in `synchronize' /var/lib/gems/1.8/gems/rake-10.0.4/lib/rake/task.rb:177:in `invoke_with_call_chain' /var/lib/gems/1.8/gems/rake-10.0.4/lib/rake/task.rb:170:in `invoke' /var/lib/gems/1.8/gems/actionpack-3.2.3/lib/sprockets/assets.rake:60 /var/lib/gems/1.8/gems/rake-10.0.4/lib/rake/task.rb:246:in `call' /var/lib/gems/1.8/gems/rake-10.0.4/lib/rake/task.rb:246:in `execute' /var/lib/gems/1.8/gems/rake-10.0.4/lib/rake/task.rb:241:in `each' /var/lib/gems/1.8/gems/rake-10.0.4/lib/rake/task.rb:241:in `execute' /var/lib/gems/1.8/gems/rake-10.0.4/lib/rake/task.rb:184:in `invoke_with_call_chain' /usr/lib/ruby/1.8/monitor.rb:242:in `synchronize' /var/lib/gems/1.8/gems/rake-10.0.4/lib/rake/task.rb:177:in `invoke_with_call_chain' /var/lib/gems/1.8/gems/rake-10.0.4/lib/rake/task.rb:170:in `invoke' /var/lib/gems/1.8/gems/rake-10.0.4/lib/rake/application.rb:143:in `invoke_task' /var/lib/gems/1.8/gems/rake-10.0.4/lib/rake/application.rb:101:in `top_level' /var/lib/gems/1.8/gems/rake-10.0.4/lib/rake/application.rb:101:in `each' /var/lib/gems/1.8/gems/rake-10.0.4/lib/rake/application.rb:101:in `top_level' /var/lib/gems/1.8/gems/rake-10.0.4/lib/rake/application.rb:110:in `run_with_threads' /var/lib/gems/1.8/gems/rake-10.0.4/lib/rake/application.rb:95:in `top_level' /var/lib/gems/1.8/gems/rake-10.0.4/lib/rake/application.rb:73:in `run' /var/lib/gems/1.8/gems/rake-10.0.4/lib/rake/application.rb:160:in `standard_exception_handling' /var/lib/gems/1.8/gems/rake-10.0.4/lib/rake/application.rb:70:in `run' /var/lib/gems/1.8/gems/rake-10.0.4/bin/rake:33 /usr/local/bin/rake:19:in `load' /usr/local/bin/rake:19 tasks: top => environment rake aborted! command failed status (1): [/usr/bin/ruby1.8 /usr/local/bin/rake asset...] /var/lib/gems/1.8/gems/rake-10.0.4/lib/rake/file_utils.rb:53:in `create_shell_runner' /var/lib/gems/1.8/gems/rake-10.0.4/lib/rake/file_utils.rb:45:in `call' /var/lib/gems/1.8/gems/rake-10.0.4/lib/rake/file_utils.rb:45:in `sh' /var/lib/gems/1.8/gems/rake-10.0.4/lib/rake/file_utils_ext.rb:37:in `sh' /var/lib/gems/1.8/gems/rake-10.0.4/lib/rake/file_utils.rb:80:in `ruby' /var/lib/gems/1.8/gems/rake-10.0.4/lib/rake/file_utils_ext.rb:37:in `ruby' /var/lib/gems/1.8/gems/actionpack-3.2.3/lib/sprockets/assets.rake:12:in `ruby_rake_task' /var/lib/gems/1.8/gems/actionpack-3.2.3/lib/sprockets/assets.rake:21:in `invoke_or_reboot_rake_task' /var/lib/gems/1.8/gems/actionpack-3.2.3/lib/sprockets/assets.rake:29 /var/lib/gems/1.8/gems/rake-10.0.4/lib/rake/task.rb:246:in `call' /var/lib/gems/1.8/gems/rake-10.0.4/lib/rake/task.rb:246:in `execute' /var/lib/gems/1.8/gems/rake-10.0.4/lib/rake/task.rb:241:in `each' /var/lib/gems/1.8/gems/rake-10.0.4/lib/rake/task.rb:241:in `execute' /var/lib/gems/1.8/gems/rake-10.0.4/lib/rake/task.rb:184:in `invoke_with_call_chain' /usr/lib/ruby/1.8/monitor.rb:242:in `synchronize' /var/lib/gems/1.8/gems/rake-10.0.4/lib/rake/task.rb:177:in `invoke_with_call_chain' /var/lib/gems/1.8/gems/rake-10.0.4/lib/rake/task.rb:170:in `invoke' /var/lib/gems/1.8/gems/rake-10.0.4/lib/rake/application.rb:143:in `invoke_task' /var/lib/gems/1.8/gems/rake-10.0.4/lib/rake/application.rb:101:in `top_level' /var/lib/gems/1.8/gems/rake-10.0.4/lib/rake/application.rb:101:in `each' /var/lib/gems/1.8/gems/rake-10.0.4/lib/rake/application.rb:101:in `top_level' /var/lib/gems/1.8/gems/rake-10.0.4/lib/rake/application.rb:110:in `run_with_threads' /var/lib/gems/1.8/gems/rake-10.0.4/lib/rake/application.rb:95:in `top_level' /var/lib/gems/1.8/gems/rake-10.0.4/lib/rake/application.rb:73:in `run' /var/lib/gems/1.8/gems/rake-10.0.4/lib/rake/application.rb:160:in `standard_exception_handling' /var/lib/gems/1.8/gems/rake-10.0.4/lib/rake/application.rb:70:in `run' /var/lib/gems/1.8/gems/rake-10.0.4/bin/rake:33 /usr/local/bin/rake:19:in `load' /usr/local/bin/rake:19 tasks: top => assets:precompile
here's devise.rb:
# use hook configure devise mailer, warden hooks , forth. # many of these configuration options can set straight in model. devise.setup |config| # ==> mailer configuration # configure e-mail address shown in devise::mailer, # note overwritten if use own mailer class default "from" parameter. config.mailer_sender = "no-reply@myapp.com" # configure class responsible send e-mails. # config.mailer = "devise::mailer" # automatically apply schema changes in tableless databases config.apply_schema = false # ==> orm configuration # load , configure orm. supports :active_record (default) , # :mongoid (bson_ext recommended) default. other orms may # available additional gems. require 'devise/orm/active_record' # ==> configuration authentication mechanism # configure keys used when authenticating user. default # :email. can configure use [:username, :subdomain], # authenticating user, both parameters required. remember # parameters used when authenticating , not when retrieving # session. if need permissions, should implement in before filter. # can supply hash value boolean determining whether # or not authentication should aborted when value not present. # config.authentication_keys = [ :email ] # configure parameters request object used authentication. each entry # given should request method , automatically passed # find_for_authentication method , considered in model lookup. instance, # if set :request_keys [:subdomain], :subdomain used on authentication. # same considerations mentioned authentication_keys apply request_keys. # config.request_keys = [] # configure authentication keys should case-insensitive. # these keys downcased upon creating or modifying user , when used # authenticate or find user. default :email. config.case_insensitive_keys = [ :email ] # configure authentication keys should have whitespace stripped. # these keys have whitespace before , after removed upon creating or # modifying user , when used authenticate or find user. default :email. config.strip_whitespace_keys = [ :email ] # tell if authentication through request.params enabled. true default. # can set array enable params authentication # given strategies, example, `config.params_authenticatable = [:database]` # enable database (email + password) authentication. # config.params_authenticatable = true # tell if authentication through http basic auth enabled. false default. # can set array enable http authentication # given strategies, example, `config.http_authenticatable = [:token]` # enable token authentication. # config.http_authenticatable = false # if http headers should returned ajax requests. true default. # config.http_authenticatable_on_xhr = true # realm used in http basic authentication. "application" default. # config.http_authentication_realm = "application" # change confirmation, password recovery , other workflows # behave same regardless if e-mail provided right or wrong. # not affect registerable. # config.paranoid = true # default devise store user in session. can skip storage # :http_auth , :token_auth adding symbols array below. # notice if skipping storage authentication paths, # may want disable generating routes devise's sessions controller # passing :skip => :sessions `devise_for` in config/routes.rb config.skip_session_storage = [:http_auth] # ==> configuration :database_authenticatable # bcrypt, cost hashing password , defaults 10. if # using other encryptors, sets how many times want password re-encrypted. # # limiting stretches 1 in testing increase performance of # test suite dramatically. however, recommended not use # value less 10 in other environments. config.stretches = rails.env.test? ? 1 : 10 # setup pepper generate encrypted password. # config.pepper = "9297a3b06e77e9730672dccc5cf9d9da555707c9b711d36115f4109352aee73e399163a22d8c59493ef09096d7b94b63ddfc4c16af432b46cab64f22b1a0be23" # ==> configuration :confirmable # period user allowed access website without # confirming account. instance, if set 2.days, user # able access website 2 days without confirming account, # access blocked in third day. default 0.days, meaning # user cannot access website without confirming account. # config.allow_unconfirmed_access_for = 2.days # if true, requires email changes confirmed (exctly same way # initial account confirmation) applied. requires additional unconfirmed_email # db field (see migrations). until confirmed new email stored in # unconfirmed email column, , copied email column on successful confirmation. config.reconfirmable = true # defines key used when confirming account # config.confirmation_keys = [ :email ] # ==> configuration :rememberable # time user remembered without asking credentials again. config.remember_for = 2.weeks # if true, extends user's remember period when remembered via cookie. config.extend_remember_period = true # if true, uses password salt remember token. should turned # false if not using database authenticatable. config.use_salt_as_remember_token = true # options passed created cookie. instance, can set # :secure => true in order force ssl cookies. # config.cookie_options = {} # ==> configuration :validatable # range password length. default 6..128. # config.password_length = 6..128 # email regex used validate email formats. asserts # 1 (and one) @ exists in given string. # give user feedback , not assert e-mail validity. # config.email_regexp = /\a[^@]+@[^@]+\z/ # ==> configuration :timeoutable # time want timeout user session without activity. after # time user asked credentials again. default 30 minutes. # config.timeout_in = 30.minutes # ==> configuration :lockable # defines strategy used lock account. # :failed_attempts = locks account after number of failed attempts sign in. # :none = no lock strategy. should handle locking yourself. # config.lock_strategy = :failed_attempts # defines key used when locking , unlocking account # config.unlock_keys = [ :email ] # defines strategy used unlock account. # :email = sends unlock link user email # :time = re-enables login after amount of time (see :unlock_in below) # :both = enables both strategies # :none = no unlock strategy. should handle unlocking yourself. # config.unlock_strategy = :both # number of authentication tries before locking account if lock_strategy # failed attempts. # config.maximum_attempts = 20 # time interval unlock account if :time enabled unlock_strategy. # config.unlock_in = 1.hour # ==> configuration :recoverable # # defines key used when recovering password account # config.reset_password_keys = [ :email ] # time interval can reset password reset password key. # don't put small interval or users won't have time # change passwords. config.reset_password_within = 6.hours # ==> configuration :encryptable # allow use encryption algorithm besides bcrypt (default). can use # :sha1, :sha512 or encryptors others authentication tools :clearance_sha1, # :authlogic_sha512 (then should set stretches above 20 default behavior) # , :restful_authentication_sha1 (then should set stretches 10, , copy # rest_auth_site_key pepper) # config.encryptor = :sha512 # ==> configuration :token_authenticatable # defines name of authentication token params key # config.token_authentication_key = :auth_token # ==> scopes configuration # turn scoped views on. before rendering "sessions/new", first check # "users/sessions/new". it's turned off default because it's slower if # using default views. config.scoped_views = true # configure default scope given warden. default it's first # devise role declared in routes (usually :user). # config.default_scope = :user # configure sign_out behavior. # sign_out action can scoped (i.e. /users/sign_out affects :user scope). # default true, means logout action sign out active scopes. config.sign_out_all_scopes = false # ==> navigation configuration # lists formats should treated navigational. formats # :html, should redirect sign in page when user not have # access, formats :xml or :json, should return 401. # # if have navigational formats, :iphone or :mobile, # should add them navigational formats lists. # # "*/*" below required match internet explorer requests. # config.navigational_formats = ["*/*", :html] # default http method used sign out resource. default :delete. config.sign_out_via = :delete # ==> omniauth # add new omniauth provider. check wiki more information on setting # on models , hooks. # config.omniauth :github, 'app_id', 'app_secret', :scope => 'user,public_repo' oauth_config_path = rails.root.join("config", "oauth.yml") if file.exists?(oauth_config_path) oauth_config = yaml.load_file(oauth_config_path)[rails.env] config.omniauth :facebook, oauth_config['facebook']['app_id'], oauth_config['facebook']['app_secret'], oauth_config['facebook']['options'] else rails.logger.warn("could not find oauth.yml in config directory.") end # ==> warden configuration # if want use other strategies, not supported devise, or # change failure app, can configure them inside config.warden block. # # config.warden |manager| # manager.intercept_401 = false # manager.default_strategies(:scope => :user).unshift :some_external_strategy # end end
here's oauth.yml
development: facebook: app_id: "144574445xxxxxx" app_secret: "501bf4e3202cd8578e3223xxxxxxxxxx" options: scope: "email" display: "page" staging: &staging facebook: app_id: "144574445xxxxxx" app_secret: "501bf4e3202cd8578e3223xxxxxxxxxx" options: scope: "email" display: "page" test: <<: *staging production: facebook: app_id: "144574445xxxxxx" app_secret: "501bf4e3202cd8578e3223xxxxxxxxxx"
Comments
Post a Comment