Rails数据库命令无法正常工作

时间:2016-01-13 21:48:23

标签: postgresql ruby-on-rails-4 capistrano scaffold

所以我刚刚完成了一个新的测试部署服务器并使用测试ruby应用程序来测试它。使用capistrano正确部署了所有内容。但网页上没有任何内容显示ip。就像我之后所说的教程一样,我需要为服务器设置一个根目录。为此,我需要为用户生成一个脚手架。所以我做了以下操作并得到了一个错误:

    MacBook-Pro:deploy_test $ rails g scaffold User
/usr/local/lib/ruby/gems/2.2.0/gems/nokogiri-1.6.7.1/lib/nokogiri.rb:29:in `require': dlopen(/usr/local/lib/ruby/gems/2.2.0/gems/nokogiri-1.6.7.1/lib/nokogiri/nokogiri.bundle, 9): Library not loaded: /usr/local/lib/libruby.2.2.0.dylib (LoadError)
  Referenced from: /usr/local/lib/ruby/gems/2.2.0/gems/nokogiri-1.6.7.1/lib/nokogiri/nokogiri.bundle
  Reason: image not found - /usr/local/lib/ruby/gems/2.2.0/gems/nokogiri-1.6.7.1/lib/nokogiri/nokogiri.bundle
    from /usr/local/lib/ruby/gems/2.2.0/gems/nokogiri-1.6.7.1/lib/nokogiri.rb:29:in `rescue in <top (required)>'
    from /usr/local/lib/ruby/gems/2.2.0/gems/nokogiri-1.6.7.1/lib/nokogiri.rb:25:in `<top (required)>'
    from /usr/local/lib/ruby/gems/2.2.0/gems/loofah-2.0.3/lib/loofah.rb:3:in `require'
    from /usr/local/lib/ruby/gems/2.2.0/gems/loofah-2.0.3/lib/loofah.rb:3:in `<top (required)>'
    from /usr/local/lib/ruby/gems/2.2.0/gems/rails-html-sanitizer-1.0.2/lib/rails-html-sanitizer.rb:2:in `require'
    from /usr/local/lib/ruby/gems/2.2.0/gems/rails-html-sanitizer-1.0.2/lib/rails-html-sanitizer.rb:2:in `<top (required)>'
    from /usr/local/lib/ruby/gems/2.2.0/gems/actionview-4.2.5/lib/action_view/helpers/sanitize_helper.rb:3:in `require'
    from /usr/local/lib/ruby/gems/2.2.0/gems/actionview-4.2.5/lib/action_view/helpers/sanitize_helper.rb:3:in `<top (required)>'
    from /usr/local/lib/ruby/gems/2.2.0/gems/actionview-4.2.5/lib/action_view/helpers/text_helper.rb:32:in `<module:TextHelper>'
    from /usr/local/lib/ruby/gems/2.2.0/gems/actionview-4.2.5/lib/action_view/helpers/text_helper.rb:29:in `<module:Helpers>'
    from /usr/local/lib/ruby/gems/2.2.0/gems/actionview-4.2.5/lib/action_view/helpers/text_helper.rb:6:in `<module:ActionView>'
    from /usr/local/lib/ruby/gems/2.2.0/gems/actionview-4.2.5/lib/action_view/helpers/text_helper.rb:4:in `<top (required)>'
    from /usr/local/lib/ruby/gems/2.2.0/gems/actionview-4.2.5/lib/action_view/helpers/form_tag_helper.rb:18:in `<module:FormTagHelper>'
    from /usr/local/lib/ruby/gems/2.2.0/gems/actionview-4.2.5/lib/action_view/helpers/form_tag_helper.rb:14:in `<module:Helpers>'
    from /usr/local/lib/ruby/gems/2.2.0/gems/actionview-4.2.5/lib/action_view/helpers/form_tag_helper.rb:8:in `<module:ActionView>'
    from /usr/local/lib/ruby/gems/2.2.0/gems/actionview-4.2.5/lib/action_view/helpers/form_tag_helper.rb:6:in `<top (required)>'
    from /usr/local/lib/ruby/gems/2.2.0/gems/actionview-4.2.5/lib/action_view/helpers/form_helper.rb:4:in `require'
    from /usr/local/lib/ruby/gems/2.2.0/gems/actionview-4.2.5/lib/action_view/helpers/form_helper.rb:4:in `<top (required)>'
    from /usr/local/lib/ruby/gems/2.2.0/gems/actionview-4.2.5/lib/action_view/helpers.rb:50:in `<module:Helpers>'
    from /usr/local/lib/ruby/gems/2.2.0/gems/actionview-4.2.5/lib/action_view/helpers.rb:4:in `<module:ActionView>'
    from /usr/local/lib/ruby/gems/2.2.0/gems/actionview-4.2.5/lib/action_view/helpers.rb:3:in `<top (required)>'
    from /usr/local/lib/ruby/gems/2.2.0/gems/sprockets-rails-3.0.0/lib/sprockets/rails/context.rb:7:in `<module:Context>'
    from /usr/local/lib/ruby/gems/2.2.0/gems/sprockets-rails-3.0.0/lib/sprockets/rails/context.rb:6:in `<module:Rails>'
    from /usr/local/lib/ruby/gems/2.2.0/gems/sprockets-rails-3.0.0/lib/sprockets/rails/context.rb:5:in `<module:Sprockets>'
    from /usr/local/lib/ruby/gems/2.2.0/gems/sprockets-rails-3.0.0/lib/sprockets/rails/context.rb:4:in `<top (required)>'
    from /usr/local/lib/ruby/gems/2.2.0/gems/sprockets-rails-3.0.0/lib/sprockets/railtie.rb:7:in `require'
    from /usr/local/lib/ruby/gems/2.2.0/gems/sprockets-rails-3.0.0/lib/sprockets/railtie.rb:7:in `<top (required)>'
    from /usr/local/lib/ruby/gems/2.2.0/gems/sass-rails-5.0.4/lib/sass/rails/railtie.rb:3:in `require'
    from /usr/local/lib/ruby/gems/2.2.0/gems/sass-rails-5.0.4/lib/sass/rails/railtie.rb:3:in `<top (required)>'
    from /usr/local/lib/ruby/gems/2.2.0/gems/sass-rails-5.0.4/lib/sass/rails.rb:11:in `require'
    from /usr/local/lib/ruby/gems/2.2.0/gems/sass-rails-5.0.4/lib/sass/rails.rb:11:in `<top (required)>'
    from /usr/local/lib/ruby/gems/2.2.0/gems/sass-rails-5.0.4/lib/sass-rails.rb:1:in `require'
    from /usr/local/lib/ruby/gems/2.2.0/gems/sass-rails-5.0.4/lib/sass-rails.rb:1:in `<top (required)>'
    from /usr/local/lib/ruby/gems/2.2.0/gems/font-awesome-sass-4.5.0/lib/font-awesome-sass.rb:66:in `require'
    from /usr/local/lib/ruby/gems/2.2.0/gems/font-awesome-sass-4.5.0/lib/font-awesome-sass.rb:66:in `register_rails_engine'
    from /usr/local/lib/ruby/gems/2.2.0/gems/font-awesome-sass-4.5.0/lib/font-awesome-sass.rb:8:in `load!'
    from /usr/local/lib/ruby/gems/2.2.0/gems/font-awesome-sass-4.5.0/lib/font-awesome-sass.rb:79:in `<top (required)>'
    from /usr/local/lib/ruby/gems/2.2.0/gems/bundler-1.10.6/lib/bundler/runtime.rb:76:in `require'
    from /usr/local/lib/ruby/gems/2.2.0/gems/bundler-1.10.6/lib/bundler/runtime.rb:76:in `block (2 levels) in require'
    from /usr/local/lib/ruby/gems/2.2.0/gems/bundler-1.10.6/lib/bundler/runtime.rb:72:in `each'
    from /usr/local/lib/ruby/gems/2.2.0/gems/bundler-1.10.6/lib/bundler/runtime.rb:72:in `block in require'
    from /usr/local/lib/ruby/gems/2.2.0/gems/bundler-1.10.6/lib/bundler/runtime.rb:61:in `each'
    from /usr/local/lib/ruby/gems/2.2.0/gems/bundler-1.10.6/lib/bundler/runtime.rb:61:in `require'
    from /usr/local/lib/ruby/gems/2.2.0/gems/bundler-1.10.6/lib/bundler.rb:134:in `require'
    from /Users/username/Desktop/site/deploy_test/config/application.rb:7:in `<top (required)>'
    from /usr/local/lib/ruby/gems/2.2.0/gems/railties-4.2.5/lib/rails/commands/commands_tasks.rb:141:in `require'
    from /usr/local/lib/ruby/gems/2.2.0/gems/railties-4.2.5/lib/rails/commands/commands_tasks.rb:141:in `require_application_and_environment!'
    from /usr/local/lib/ruby/gems/2.2.0/gems/railties-4.2.5/lib/rails/commands/commands_tasks.rb:128:in `generate_or_destroy'
    from /usr/local/lib/ruby/gems/2.2.0/gems/railties-4.2.5/lib/rails/commands/commands_tasks.rb:50:in `generate'
    from /usr/local/lib/ruby/gems/2.2.0/gems/railties-4.2.5/lib/rails/commands/commands_tasks.rb:39:in `run_command!'
    from /usr/local/lib/ruby/gems/2.2.0/gems/railties-4.2.5/lib/rails/commands.rb:17:in `<top (required)>'
    from bin/rails:4:in `require'

这是我的Gemfile的样子:

source 'https://rubygems.org'

# Bundle edge Rails instead: gem 'rails', github: 'rails/rails'
gem 'rails', '4.2.5'

# Use Bootstrap
gem 'bootstrap-sass', '~> 3.3.5'
# Use Font-Awesome
gem 'font-awesome-sass'
# Use SCSS for stylesheets
gem 'sass-rails', '>= 3.2'
# Use Uglifier as compressor for JavaScript assets
gem 'uglifier', '>= 1.3.0'
# Use CoffeeScript for .coffee assets and views
gem 'coffee-rails', '~> 4.1.0'
# Use jquery as the JavaScript library
gem 'jquery-rails'
gem 'jquery-ui-rails'
# Build JSON APIs with ease. Read more: https://github.com/rails/jbuilder
gem 'jbuilder', '~> 2.0'
# bundle exec rake doc:rails generates the API under doc/api.
gem 'sdoc', '~> 0.4.0', group: :doc

# Use Autoprefixer
gem 'autoprefixer-rails'
# Turbolinks makes following links in your web application faster. Read more: https://github.com/rails/turbolinks
gem 'turbolinks'

#gem 'pygments.rb', '~> 0.6.0'
gem 'redcarpet', '~> 3.2.2'

gem 'passenger'


group :production do 
    gem 'pg'
end

group :development, :test do
  # Call 'byebug' anywhere in the code to stop execution and get a debugger console
  gem 'byebug'
end

group :development do

    gem 'sqlite3'

    # Use Capistrano for deployment
    gem 'capistrano-bundler', '~> 1.1', '>= 1.1.4'
    gem 'capistrano', '~> 3.4.0'
    gem 'capistrano-rails', '~> 1.1', '>= 1.1.5'
    gem 'capistrano-rbenv', '~> 2.0', '>= 2.0.4'

  # Access an IRB console on exception pages or by using <%= console %> in views
  gem 'web-console', '~> 2.0'

  # Spring speeds up development by keeping your application running in the background. Read more: https://github.com/rails/spring
  gem 'spring'
end

不知道这意味着什么?

0 个答案:

没有答案