我正在尝试使用 Rails 生成器创建迁移,但是当我运行 rails g migration create_meetups_table
时,我得到以下输出:
Could not find slop-3.4.7 in any of the sources
Run `bundle install` to install missing gems.
我手动安装了 gem,然后再次运行 bundle install 并得到了这个输出:
Using i18n 0.6.9
Using json 1.8.1
Using minitest 5.3.4
Using thread_safe 0.3.4
Using builder 3.2.2
Using erubis 2.7.0
Using rake 10.3.2
Using rack 1.5.2
Using polyglot 0.3.5
Using mime-types 1.25.1
Using arel 5.0.1.20140414130214
Using bcrypt 3.1.7
Using coderay 1.1.0
Using coffee-script-source 1.7.0
Using execjs 2.2.0
Using thor 0.19.1
Using orm_adapter 0.5.0
Using geocoder 1.2.2
Using hike 1.2.3
Using multi_json 1.10.1
Using method_source 0.8.2
Using pg 0.17.1
Using slop 3.4.7
Using bundler 1.6.2
Using tilt 1.4.1
Using sass 3.2.19
Using spring 1.1.3
Using rdoc 4.1.1
Using tzinfo 1.2.1
Using rack-test 0.6.2
Using warden 1.2.3
Using treetop 1.4.15
Using coffee-script 2.2.0
Using uglifier 2.5.1
Using pry 0.9.12.4
Using sprockets 2.11.0
Using sdoc 0.4.0
Using activesupport 4.1.1
Using mail 2.5.4
Using actionview 4.1.1
Using activemodel 4.1.1
Using jbuilder 2.1.0
Using actionpack 4.1.1
Using activerecord 4.1.1
Using actionmailer 4.1.1
Using railties 4.1.1
Using sprockets-rails 2.1.3
Using coffee-rails 4.0.1
Using devise 3.2.4
Using jquery-rails 3.1.0
Using rails 4.1.1
Using sass-rails 4.0.3
Using rMeetup 1.0.1 from git://github.com/tannermares/rmeetup.git (at master)
Your bundle is complete!
Use `bundle show [gemname]` to see where a bundled gem is installed.
我可以清楚地看到 gem 正在被捆绑。我可以运行其他命令来启动应用程序和控制台,但无法运行生成迁移。关于如何解决这个问题的任何想法?我试过删除 ruby 安装并重新安装,但这没有帮助。
最佳答案
我认为Spring行为不当,并且没有正确地重新要求 gem 。
使用 bin/spring status
检查 spring 的状态。如果它正在运行,请尝试使用 bin/spring stop
停止它。如果不是,请检查是否有任何孤立的 Spring 进程可能会搞砸:
ps 辅助 | grep spring
.
我不完全确定为什么 Spring 会这样,但将其关闭为我解决了这个问题。我无法再次复制以进一步调查。
关于ruby-on-rails - Rails 生成命令不起作用,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/24222646/