basecamp / pow

Zero-configuration Rack server for Mac OS X
http://pow.cx/
MIT License
3.41k stars 259 forks source link

LoadError: cannot load such file -- rack/mongoid #381

Closed holgersindbaek closed 11 years ago

holgersindbaek commented 11 years ago

I'm trying to switch to pow, because I need to use sub-domains, but I'm getting nothing but errors. I'm setting everything up using powder.

When I go into uninkd.dev (the app I set up), I get the following error:

Error starting application
Your Rack app raised an exception when Pow tried to run it.
LoadError: cannot load such file -- rack/mongoid
~/.rvm/rubies/ruby-1.9.3-p392/lib/ruby/site_ruby/1.9.1/rubygems/core_ext/kernel_require.rb:45:in `require'
~/.rvm/rubies/ruby-1.9.3-p392/lib/ruby/site_ruby/1.9.1/rubygems/core_ext/kernel_require.rb:45:in `require'
~/Projects/Uninkd/Uninkd_Web_App/config/application.rb:4:in `<top (required)>'
~/.rvm/rubies/ruby-1.9.3-p392/lib/ruby/site_ruby/1.9.1/rubygems/core_ext/kernel_require.rb:45:in `require'
~/.rvm/rubies/ruby-1.9.3-p392/lib/ruby/site_ruby/1.9.1/rubygems/core_ext/kernel_require.rb:45:in `require'
Show 14 more lines

It doesn't seem to have anything to do with the infamous ruby-error, since I'm running the right ruby-version (1.9.3). This is what is in my .rvmrc-file:

#!/usr/bin/env bash

# This is an RVM Project .rvmrc file, used to automatically load the ruby
# development environment upon cd'ing into the directory

# First we specify our desired <ruby>[@<gemset>], the @gemset name is optional,
# Only full ruby name is supported here, for short names use:
#     echo "rvm use 1.9.3" > .rvmrc
environment_id="ruby-1.9.3-p392@UninkdWebApp"

# Uncomment the following lines if you want to verify rvm version per project
# rvmrc_rvm_version="1.19.6 (stable)" # 1.10.1 seams as a safe start
# eval "$(echo ${rvm_version}.${rvmrc_rvm_version} | awk -F. '{print "[[ "$1*65536+$2*256+$3" -ge "$4*65536+$5*256+$6" ]]"}' )" || {
#   echo "This .rvmrc file requires at least RVM ${rvmrc_rvm_version}, aborting loading."
#   return 1
# }

# First we attempt to load the desired environment directly from the environment
# file. This is very fast and efficient compared to running through the entire
# CLI and selector. If you want feedback on which environment was used then
# insert the word 'use' after --create as this triggers verbose mode.
if [[ -d "${rvm_path:-$HOME/.rvm}/environments"
  && -s "${rvm_path:-$HOME/.rvm}/environments/$environment_id" ]]
then
  \. "${rvm_path:-$HOME/.rvm}/environments/$environment_id"
  for __hook in "${rvm_path:-$HOME/.rvm}/hooks/after_use"*
  do
    if [[ -f "${__hook}" && -x "${__hook}" && -s "${__hook}" ]]
    then \. "${__hook}" || true
    fi
  done
  unset __hook
else
  # If the environment file has not yet been created, use the RVM CLI to select.
  rvm --create  "$environment_id" || {
    echo "Failed to create RVM environment '${environment_id}'."
    return 1
  }
fi

# If you use bundler, this might be useful to you:
if [[ -s Gemfile ]] && {
  ! builtin command -v bundle >/dev/null ||
  builtin command -v bundle | GREP_OPTIONS= \grep $rvm_path/bin/bundle >/dev/null
}
then
  printf "%b" "The rubygem 'bundler' is not installed. Installing it now.\n"
  gem install bundler
fi
if [[ -s Gemfile ]] && builtin command -v bundle >/dev/null
then
  bundle install | GREP_OPTIONS= \grep -vE '^Using|Your bundle is complete'
fi

And my .powrc:

if [ -f "$rvm_path/scripts/rvm" ] && [ -f ".rvmrc" ]; then
  source "$rvm_path/scripts/rvm"
  source ".rvmrc"
fi

My config.rb:

# This file is used by Rack-based servers to start the application.

require ::File.expand_path('../config/environment',  __FILE__)
run UninkdWebApp::Application

And finally my application.rb:

# Removed this line because it was causing trouble. Doesn't seem to be a thing you should do.
# require File.expand_path('boot', __FILE__)

require 'rack/mongoid'
require 'mongoid/railtie'
require 'action_controller/railtie'
require 'action_mailer/railtie'
require 'active_resource/railtie'
require 'sprockets/railtie'
require 'carrierwave/mongoid'
require 'devise'
require 'mongoid/slug'
require 'rails_rinku'
require 'urbanairship'

if defined?(Bundler)
  # If you precompile assets before deploying to production, use this line
  Bundler.require(*Rails.groups(:assets => %w(development test production)))
  # If you want your assets lazily compiled in production, use this line
  # Bundler.require(:default, :assets, Rails.env)
end

module UninkdWebApp
  class Application < Rails::Application
    config.assets.paths << "#{Rails.root}/app/assets/misc"
    # config.autoload_paths += %W(#{config.root}/app/models/ckeditor)
    # Settings in config/environments/* take precedence over those specified here.
    # Application configuration should go into files in config/initializers
    # -- all .rb files in that directory are automatically loaded.

    # Custom directories with classes and modules you want to be autoloadable.
    # config.autoload_paths += %W(#{config.root}/extras)

    # Only load the plugins named here, in the order given (default is alphabetical).
    # :all can be used as a placeholder for all plugins not explicitly named.
    # config.plugins = [ :exception_notification, :ssl_requirement, :all ]

    # Activate observers that should always be running.
    # config.active_record.observers = :cacher, :garbage_collector, :forum_observer

    # Set Time.zone default to the specified zone and make Active Record auto-convert to this zone.
    # Run "rake -D time" for a list of tasks for finding time zone names. Default is UTC.
    # config.time_zone = 'Central Time (US & Canada)'

    # The default locale is :en and all translations from config/locales/*.rb,yml are auto loaded.
    # config.i18n.load_path += Dir[Rails.root.join('my', 'locales', '*.{rb,yml}').to_s]
    # config.i18n.default_locale = :de

    # Configure the default encoding used in templates for Ruby 1.9.
    config.encoding = "utf-8"

    # Configure sensitive parameters which will be filtered from the log file.
    config.filter_parameters += [:password]

    # Enable escaping HTML in JSON.
    config.active_support.escape_html_entities_in_json = true

    # Use SQL instead of Active Record's schema dumper when creating the database.
    # This is necessary if your schema can't be completely dumped by the schema dumper,
    # like if you have constraints or database-specific column types
    # config.active_record.schema_format = :sql

    # Enforce whitelist mode for mass assignment.
    # This will create an empty whitelist of attributes available for mass-assignment for all models
    # in your app. As such, your models will need to explicitly whitelist or blacklist accessible
    # parameters by using an attr_accessible or attr_protected declaration.
    #config.active_record.whitelist_attributes = true

    # Enable the asset pipeline
    config.assets.enabled = true

    # Version of your assets, change this if you want to expire all your assets
    config.assets.version = '1.0'
  end
end

Any suggestions on what I'm doing wrong?

holgersindbaek commented 11 years ago

Seems like it works not. Same files as you see above and a restart of the mac did the trick.