我不知道在OSX山狮下安装红宝石/ rails是怎么回事。
我从一个黑色rails应用程序开始,运行bundle并使用bundle show列出已安装的包,我得到如下信息:
[..]
* sqlite3 (1.3.7)
* thor (0.17.0)
* tilt (1.3.3)
* treetop (1.4.12)
[..]
一旦运行rake :migrate,就会得到以下错误:
Could not find thor-0.17.0 in any of the sources
Run `bundle install` to install missing gems.
但是,如图所示,安装了t
我知道我可以打开像String这样的类并添加功能。这个测试脚本camelize.rb运行得很好。
#!/usr/bin/env ruby
class String
def camelize
self.split("_").map(&:capitalize).join
end
end
class Test
def test
p "test_me".camelize
end
end
Test.test
打印"TestMe"
但是,在thor文件中,这不起作用。例如test.thor
p "TEST
我已经安装了Ruby1.9.2以及安装rails gem。我现在尝试用以下方法创建一个新的rails应用程序:
$ rails new foo -T
我立刻被提示
Thor is not available.
If you ran this command from a git checkout of Rails, please make sure thor is installed
我安装了雷神,我不知道该怎么做。请帮帮忙。
警告我是新手。
我在安装neat时遇到了这些回溯错误(最近一次调用last):
9: from /Users/jgattus/.asdf/installs/ruby/2.6.3/bin/neat:23:in `<main>'
8: from /Users/jgattus/.asdf/installs/ruby/2.6.3/bin/neat:23:in `load'
7: from /Users/jgattus/.asdf/installs/ruby/2.6.3/lib/ruby/gems/2.6.0/gems/neat-4.0.0/bin/neat:5:in `<top (r
我安装了gem koudoku,使用命令rails g koudoku:install user时,我得到了一个错误。我已经做了搜索,但找不到修复它的方法。我不知道该怎么办。如果有人有一些建议,那将是有帮助的!
generate model
/Users/.rvm/rubies/ruby-2.0.0-p353/bin/ruby: No such file or directory -- bin/rails (LoadError)
gsub app/models/subscription.rb
generate model
/Users/.rvm/rubie
我正在学习Ruby on Rails教程,并且已经读到了第2章。
rails new demo_app
这个错误就会泄漏出来。我试着寻找一个解决方案,但没有一个答案匹配。我尝试卸载/重新安装rails和rails,但仍然得到相同的错误。
run bundle install
Z:/Program Files/RailsInstaller/Ruby1.9.3/lib/ruby/gems/1.9.1/gems/railties-3.2.
6/lib/rails/generators/app_base.rb:254:in ``': No such file or dire
我试图在我的rails应用程序中安装rails_admin gem,我遵循了这个。但是,当我运行命令rails g rails_admin:install时,它会显示以下错误。
Running via Spring preloader in process 51535
? Where do you want to mount rails_admin? Press <enter> for [admin] > /Users/home/.rbenv/versions/2.2.3/gemsets/voiceover/gems/thor-0.19.1/lib/thor/
运行简单命令
rails g model User
导致:
→ bundle exec rails g model User
invoke active_record
create db/migrate/20160128191020_create_users.rb
create app/models/user.rb
invoke rspec
create spec/models/user_spec.rb
invoke factory_girl
create
我正在尝试创建一个新的Rails应用程序。每次我输入rails new之后,我都会得到这个错误
/usr/local/lib/ruby/gems/2.2.0/gems/thor-0.19.2/lib/thor/parser/option.rb:130:in `validate_default_type!': An option's default must match its type. (ArgumentError)
from /usr/local/lib/ruby/gems/2.2.0/gems/thor-0.19.2/lib/thor/parser/option.