rails new web
rails s
然后出错
/home/yirol/.rbenv/versions/2.3.1/lib/ruby/gems/2.3.0/gems/bundler-1.13.6/lib/bundler/runtime.rb:94:in `rescue in block (2 levels) in require': There was an error while trying to load the gem 'uglifier'. (Bundler::GemRequireError) Gem Load Error is: Could not find a JavaScript runtime. See https://github.com/rails/execjs for a list of available runtimes. Backtrace for gem load error is:
修改 Gemfile 文件,将 gem 'therubyracer', platforms: :ruby 的注释取消,然后出现如下错误
=> Booting Puma => Rails 5.0.0.1 application starting in development on http://localhost:3000 => Run
rails server -h
for more startup options Puma starting in single mode...
- Version 3.6.0 (ruby 2.3.1-p112), codename: Sleepy Sunday Serenity
- Min threads: 5, max threads: 5
- Environment: development
- Listening on tcp://localhost:3001 Exiting /home/yirol/.rbenv/versions/2.3.1/lib/ruby/gems/2.3.0/gems/puma-3.6.0/lib/puma/binder.rb:266:in `initialize': Cannot assign requested address - bind(2) for "::1" port 3001 (Errno::EADDRNOTAVAIL)
在网上找到的运行命令:rails server -e development -b 0.0.0.0 -p 3000
这样就能够成功,但是我想知道怎么解决,可以用 rails s