在rails上创建新的应用程序ruby [英] create new application ruby on rails
问题描述
我对使用ruby进行简单工作感到困惑,因为我已经花了三天的时间尝试创建一个应用程序。
我在site5托管,并尝试创建新的应用程序。一步一步:
$ rails新应用程序-d mysql
$ gem install mysql
$ gem install mysql2
和之后
$ rake db:create
关于错误
在Gemfile中列出的任何gem源中找不到gem'mysql2(〜> 0.2.6,runtime)' 。
我google了,但仍然无法修复问题。任何人都可以帮忙吗?
运行 rails新应用程序-d mysql
自动将所需的gem添加到您的Gemfile中,因此您不需要使用 gem
命令手动安装它们。尝试以下操作:
$ rails新应用程序-d mysql
$ cd app
$ bundle install
$ rake db:创建
我怀疑你正在遵循的教程是针对旧版本的的Rails。使用rails 3,您应该使用 bundler 进行所有宝石管理。
I'm bit confused by "easy" working with ruby on rails, cause I already spend three days by trying create an app.
I work on site5 hosting, and try to create new app. step by step:
$ rails new app -d mysql
$ gem install mysql
$ gem install mysql2
and after
$ rake db:create
it report about error
Could not find gem 'mysql2 (~> 0.2.6, runtime)' in any of the gem sources listed in your Gemfile.
I google it, but still can't fix problem. Can anybody help?
Running rails new app -d mysql
will automatically add the required gems to your Gemfile, so you shouldn't need to install them manually with the gem
command. Try the following:
$ rails new app -d mysql
$ cd app
$ bundle install
$ rake db:create
I suspect the tutorial you're following is for an older version of Rails. With rails 3, you should be using bundler for all gem management.
这篇关于在rails上创建新的应用程序ruby的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!