我遵循Ruby on Rails教程(Rails 5)学习使用Rails进行Web开发 Michael Hartl使用rails 5.0.0.1,当我尝试在bash中运行以下命令时
Version: 1.7.2
Usage: spring COMMAND [ARGS]
Commands for spring itself:
binstub Generate spring based binstubs. Use --all to generate a binstub for all known commands. Use --remove to revert.
help Print available commands.
server Explicitly start a Spring server in the foreground
status Show current status.
stop Stop all spring processes for this project.
Commands for your application:
rails Run a rails command. The following sub commands will use spring: console, runner, generate, destroy, test.
rake Runs the rake command
rails aborted!
Don't know how to build task 'rails' (see --tasks)
/home/Medo/.rvm/gems/ruby-2.3.1/gems/railties-5.0.0.1/lib/rails/commands/rake_proxy.rb:13:in `block in run_rake_task'
/home/Medo/.rvm/gems/ruby-2.3.1/gems/railties-5.0.0.1/lib/rails/commands/rake_proxy.rb:10:in `run_rake_task'
/home/Medo/.rvm/gems/ruby-2.3.1/gems/railties-5.0.0.1/lib/rails/commands/commands_tasks.rb:51:in `run_command!'
/home/Medo/.rvm/gems/ruby-2.3.1/gems/railties-5.0.0.1/lib/rails/commands.rb:18:in `<top (required)>'
bin/rails:9:in `require'
bin/rails:9:in `<main>'
(See full trace by running task with --trace)
我收到此错误
legend {
text-align: center;
}
我不知道导致此问题的原因,并且在搜索一小时后无法找到解决方案。
答案 0 :(得分:5)
这对我有用吗
for(var i = 0; i < x; i++)
之后,rails运行没有问题
答案 1 :(得分:3)
这对我们有所帮助。我只是运行这3个命令,这是有效的。
您的应用程序的./bin/rails看起来像是由...生成的存根 捆绑。
在Rails 5中,您的应用程序的bin /目录包含可执行文件 版本化任何其他源代码,而不是存根 按需生成。
以下是升级方法:
bundle config --delete bin#关闭Bundler的存根生成器
rails app:update:bin#使用新的Rails 5可执行文件
git add bin#添加bin /到源代码控制您可能还需要从.gitignore中删除bin /。
答案 2 :(得分:0)
我不确定但也许它可以提供帮助
$ spring stop
$ rails generate scaffold User name:string email:string
答案 3 :(得分:0)
您可以检查导轨是否正常工作。也可以尝试
bin/rails generate scaffold User name:string email:string