麻烦在Mac上的rails控制台上运行ruby

时间:2017-08-15 04:33:46

标签: ruby-on-rails ruby linux macos heroku

我无法在我的Mac上运行rails。这是我得到的输出。我的软件包或Ruby或rvm版本似乎有问题,但我不知道如何解决它。我最终每次都要部署到Heroku来测试一些东西。

Pauls-MacBook-Pro:heroku paulyang$ rails console
/Users/paulyang/.rvm/gems/ruby-2.3.3/gems/spring-2.0.1/lib/spring/application.rb:108:in `ensure in preload': undefined method `application' for Rails:Module (NoMethodError)
    from /Users/paulyang/.rvm/gems/ruby-2.3.3/gems/spring-2.0.1/lib/spring/application.rb:112:in `preload'
    from /Users/paulyang/.rvm/gems/ruby-2.3.3/gems/spring-2.0.1/lib/spring/application.rb:143:in `serve'
    from /Users/paulyang/.rvm/gems/ruby-2.3.3/gems/spring-2.0.1/lib/spring/application.rb:131:in `block in run'
    from /Users/paulyang/.rvm/gems/ruby-2.3.3/gems/spring-2.0.1/lib/spring/application.rb:125:in `loop'
    from /Users/paulyang/.rvm/gems/ruby-2.3.3/gems/spring-2.0.1/lib/spring/application.rb:125:in `run'
    from /Users/paulyang/.rvm/gems/ruby-2.3.3/gems/spring-2.0.1/lib/spring/application/boot.rb:19:in `<top (required)>'
    from /usr/local/lib/ruby/site_ruby/2.3.0/rubygems/core_ext/kernel_require.rb:55:in `require'
    from /usr/local/lib/ruby/site_ruby/2.3.0/rubygems/core_ext/kernel_require.rb:55:in `require'
    from -e:1:in `<main>'

这是我用于我的Rails应用程序的gemfile:

source 'https://rubygems.org'
ruby '2.3.3'

gem 'sinatra'
# sinatra needs old tilt version: http://stackoverflow.com/questions/20648394/moduletemplates-uninitialized-constant-tiltcompilesite-nameerror-using
#https://groups.google.com/forum/#!topic/sinatrarb/mAtn7AZBVmY
gem 'tilt', '~> 1.4.1', group: :production
gem 'rest-client'
gem 'sequel'
gem 'sqlite3', group: :development
gem 'pg', '~> 0.18', group: :development
gem 'cowsay'
# Bundle edge Rails instead: gem 'rails', github: 'rails/rails'
gem 'rails', '4.2.5'
# Use postgresql as the database for Active Record
gem 'pg', '~> 0.18', group: :production
gem 'rails_12factor', group: :production
# Use SCSS for stylesheets
gem 'sass-rails', '~> 5.0.3'
# Use Uglifier as compressor for JavaScript assets
gem 'uglifier', '>= 1.3.0'
# Use CoffeeScript for .js.coffee assets and views
gem 'coffee-rails', '~> 4.0.0'
# See https://github.com/sstephenson/execjs#readme for more supported runtimes
# gem 'therubyracer',  platforms: :ruby

# Use jquery as the JavaScript library
gem 'jquery-rails'
# Turbolinks makes following links in your web application faster. Read more: https://github.com/rails/turbolinks
gem 'turbolinks'
# 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

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

# Use ActiveModel has_secure_password
# gem 'bcrypt', '~> 3.1.7'

gem 'puma'

# Use Capistrano for deployment
# gem 'capistrano-rails', group: :development

# for auto-renewable subscription validation
# https://github.com/gabrielgarza/monza/blob/master/README.md
gem 'monza'
gem 'itunes-receipt'

任何帮助都会很棒。

0 个答案:

没有答案