我對Rails遊戲相當陌生;我是一位教我自己編程的前端開發人員。我已經構建了一個Web應用程序,並決定使用RailsKit SaaS工具包來處理我的註冊等。我有問題只是讓默認的應用程序啓動並運行,但我確信這是由於我缺乏知識,我認爲這與設置mysql服務器有關(通常我使用sqlite3,但這並不是' t似乎也適用於這個應用程序)。讓RailsKits SaaS應用啓動並運行w/mysql2服務器
具體的過程和我遇到的錯誤,我仍然不能甚至創建一個數據庫或啓動服務器...
下載應用程序
Ran
bundle install
。得到了以下錯誤:Gem::InstallError: factory_girl requires Ruby version >= 1.9.2. An error occurred while installing factory_girl (4.1.0), and Bundler cannot continue. Make sure that `gem install factory_girl -v '4.1.0'` succeeds before bundling.
發現我對Ruby的版本1.8.7運行,因此我已將此添加到Gemfile中:
gem 'rake','1.9.2' and **updated my system** to 1.9.2
然
bundle install
,得到了出現以下錯誤:An error occurred while installing mysql2 (0.3.11), and Bundler cannot continue. Make sure that `gem install mysql2 -v '0.3.11'` succeeds before bundling.
於是我就
gem install mysql2 -v '0.3.11
並得到了以下錯誤:ERROR: Error installing mysql2: ERROR: Failed to build gem native extension. /Users/trevanhetzel/.rvm/rubies/ruby-1.9.3-p327/bin/ruby extconf.rb checking for rb_thread_blocking_region()... yes checking for rb_wait_for_single_fd()... yes checking for mysql_query() in -lmysqlclient... no checking for main() in -lm... yes checking for mysql_query() in -lmysqlclient... no checking for main() in -lz... yes checking for mysql_query() in -lmysqlclient... no checking for main() in -lsocket... no checking for mysql_query() in -lmysqlclient... no checking for main() in -lnsl... no checking for mysql_query() in -lmysqlclient... no checking for main() in -lmygcc... no checking for mysql_query() in -lmysqlclient... no *** extconf.rb failed *** Could not create Makefile due to some reason, probably lack of necessary libraries and/or headers. Check the mkmf.log file for more details. You may need configuration options.
所以這是我在哪裏。如果這會有所幫助,畢竟上面的步驟,我試圖通過rake db:create
創建一個數據庫,並得到了
Could not find gem 'mysql2 (>= 0) ruby' in the gems available on this machine.
所以我猜MySQL是沒有安裝在我的機器上?似乎有點奇怪的原因,我一直使用MAMP的MySQL服務器。
任何幫助指引我在正確的方向將是偉大的傢伙!對此,我真的非常感激。
您正在使用哪個操作系統安裝寶石mysql2?對於OSX看到這個答案:http://stackoverflow.com/questions/4115126/ruby-gem-mysql2-install-failing – doesterr
OSX。我雖然過去了,現在可以啓動服務器。遷移時出現此錯誤: 'Trevan-Hetzels-MacBook-Pro:V4 trevanhetzel $ rake db:create db:migrate saas:bootstrap rake aborted! 未定義的方法'trial_interval'爲# /Users/trevanhetzel/.rvm/gems/ruby-1.9.3-p327/gems/activemodel-3.2.8/lib/active_model/attribute_methods.rb:407: in'method_missing' /Users/trevanhetzel/.rvm/gems/ruby-1.9。3-p327/gems/activerecord-3.2.8/lib/active_record/attribute_methods.rb:149:在'... –
此問題是由於Kit隨附的遷移中缺少字段。這已被修復。 :) –