rails 项目学习1

1. git clone https://github.com/saasbook/bdd-tdd-cycle

2.follow the instructions below to get setup:

1) Change into the rottenpotatoes directory: cd bdd-tdd-cycle/rottenpotatoes
2) Run bundle install --without production to make sure all gems are properly installed.
3) Run bundle exec rake db:migrate to apply database migrations.
4) Finally, run these commands to set up the Cucumber directories (under features/) and RSpec directories (under spec/) if they don't already exist, allowing overwrite of any existing files:

rails generate cucumber:install capybara
rails generate cucumber_rails_training_wheels:install
rails generate rspec:install

Notes1. some errors got while run bundle install

1) ruby version disagree, I change the Gemfile to agree with my ruby version

2)json-1.8.3 Gem::Ext::BuildError: ERROR: Failed to build gem native extension

the solution is to install libgmp3-dev.
sudo apt-get install libgmp3-dev

3) cannot load such file -- test/unit/

 add the test-unit gem to your gemfile:gem 'test-unit'

4) cannot install debugger

change 'debugger' in Gemfile to 'byebug'.

5) warning: circular argument reference

delete the version specified in Gemfile, delete Gemfile.lock before rerun bundle install

6)LoadError: cannot load such file -- active_resource/railtie


If you do not need ActiveResource , then you will need to comment out/remove following line from application.rb:

1require "active_resource/railtie"

Previously  ActiveResource, was included by the rails gem as a dependency; now you'll have to add it explicitly if you want to use it.

gem 'activeresource'

7) NoMethodError: undefined method `whitelist_attributes=' for ActiveRecord::Base:Class

gem 'protected_attributes'

8) config.eager_load is set to nil. Please update your config/environments/*.rb files accordingly

add config.eager_load = false to config/environment/test.rb

add config.eager_load = false to config/environment/development.rb

add config.eager_load = true to config/environment/production.rb

9)Migrations are pending. To resolve this issue, run:

    rake db:migrate RAILS_ENV=test
10)DEPRECATION WARNING: The configuration option `config.serve_static_assets` has been renamed to `config.serve_static_files` to clarify its role (it merely enables serving everything in the `public` folder and is unrelated to the asset pipeline). The `serve_static_assets` alias will be removed in Rails 5.0. Please migrate your configuration files accordingly.

change config.serve_static_assets to `config.serve_static_files'  in config/environment/test.rb

 rm -f db/*.sqlite3
      rake db:create
      RAILS_ENV=test rake db:migrate



  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值