新 rails 项目中的耙子 db:create 出错

Error in rake db:create in new rails project

我收到以下错误:

耙子中止!
NameError:未初始化的常量 Sass::Script /home/nikhil/Nurture/careerpal-back/config/application.rb:7:in <top (required)>' /home/nikhil/Nurture/careerpal-back/Rakefile:4:in' (使用 --trace 查看 运行ning 任务的完整跟踪)

Gemfile 是

source 'https://rubygems.org'

# Bundle edge Rails instead: gem 'rails', github: 'rails/rails'
gem 'rails', '4.2.5.1'
# Use sqlite3 as the database for Active Record
gem 'sqlite3'
# 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 .coffee assets and views
gem 'coffee-rails', '~> 4.1.0'
# See https://github.com/rails/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

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

# Use Unicorn as the app server
# gem 'unicorn'

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

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

group :development do
  # 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

我已经通过 运行ning bundle update 将所有 gem 更新到最新版本并更改了 sass-rails gem 到特定版本。还是不行运行

Gemfile.lock 有这些行

sass (3.4.21)
sass-rails (5.0.4)
  railties (>= 4.0.0, < 5.0)
  sass (~> 3.1)
  sprockets (>= 2.8, < 4.0)
  sprockets-rails (>= 2.0, < 4.0)
  tilt (>= 1.1, < 3)

但是 运行ning bundle install 给了我这个:

Using sass 3.4.21
Using sass-rails 5.0.4

编辑: 我之前用 4.2.4 创建了一个 api 只有 rails 的项目。还行运行

感谢帮助。提前致谢。

运行一步一步,首先:

gem install bundler

然后

bundle install

&然后

bundle exec rake db:create

为了学习bundler, Create rails project

希望能帮到你

我只是重新安装了 ruby+rails,一切正常。

我删除了 ~/.rbenv 文件夹和 运行 sudo apt-get purge ruby

然后使用 Official Page 安装 ruby 和 rails。

重要的是,一旦我创建了一个新项目,系统就会提示我安装另一个 gem 来解决一些依赖关系 gem install rdoc-data