0
我將一個rails項目從一臺機器移植到另一臺機器,並通過以下清單確保環境和系統設置良好:無法在另一臺機器上運行的Rails項目上運行「rake:db create」 - 獲取錯誤消息
1)紅寶石-v =>
ruby 2.0.0p195 (2013-05-14 revision 40734) [x86_64-darwin12.3.0]
2)導軌-v =>
/Users/AM/.rvm/gems/[email protected]/gems/bundler-
1.3.5/lib/bundler/runtime.rb:216: warning: Insecure world writable dir
/Users/AM/Documents/rubyws/overnights in PATH, mode 040777
/Users/AM/.rvm/gems/[email protected]/gems/bundler-
1.3.5/lib/bundler/runtime.rb:216: warning: Insecure world writable dir
/Users/AM/Documents/rubyws/overnights in PATH, mode 040777
Rails 4.0.0
3)檢查MySQL正在運行:
4)釀造更新
5)束安裝
6)耙分貝:創建.......讓我的終端上的以下消息:
AMs-MacBook-Pro:overnights AM$ rake db:create --trace
/Users/AM/.rvm/gems/[email protected]/gems/bundler-
1.3.5/lib/bundler/runtime.rb:216: warning: Insecure world writable dir
/Users/AM/Documents/rubyws/overnights in PATH, mode 040777
rake aborted!
dlopen(/Users/AM/.rvm/gems/ruby-2.0.0-p195/gems/mysql2-0.3.14/lib/mysql2/mysql2.bundle,
9): Library not loaded: libmysqlclient.18.dylib
Referenced from: /Users/AM/.rvm/gems/ruby-2.0.0-p195/gems/mysql2-
0.3.14/lib/mysql2/mysql2.bundle
Reason: image not found - /Users/AM/.rvm/gems/ruby-2.0.0-p195/gems/mysql2-
0.3.14/lib/mysql2/mysql2.bundle
/Users/AM/.rvm/gems/ruby-2.0.0-p195/gems/mysql2-0.3.14/lib/mysql2.rb:8:in `require'
/Users/AM/.rvm/gems/ruby-2.0.0-p195/gems/mysql2-0.3.14/lib/mysql2.rb:8:in `<top
(required)>'
/Users/AM/.rvm/gems/[email protected]/gems/bundler-
1.3.5/lib/bundler/runtime.rb:72:in `require'
/Users/AM/.rvm/gems/[email protected]/gems/bundler-
1.3.5/lib/bundler/runtime.rb:72:in `block (2 levels) in require'
/Users/AM/.rvm/gems/[email protected]/gems/bundler-
1.3.5/lib/bundler/runtime.rb:70:in `each'
/Users/AM/.rvm/gems/[email protected]/gems/bundler-
1.3.5/lib/bundler/runtime.rb:70:in `block in require'
/Users/AM/.rvm/gems/[email protected]/gems/bundler-
1.3.5/lib/bundler/runtime.rb:59:in `each'
/Users/AM/.rvm/gems/[email protected]/gems/bundler-
1.3.5/lib/bundler/runtime.rb:59:in `require'
/Users/AM/.rvm/gems/[email protected]/gems/bundler-1.3.5/lib/bundler.rb:132:in
`require'
/Users/AM/Documents/rubyws/overnights/config/application.rb:7:in `<top (required)>'
/Users/AM/Documents/rubyws/overnights/Rakefile:4:in `require'
/Users/AM/Documents/rubyws/overnights/Rakefile:4:in `<top (required)>'
/Users/AM/.rvm/gems/ruby-2.0.0-p195/gems/rake-10.1.1/lib/rake/rake_module.rb:25:in
`load'
/Users/AM/.rvm/gems/ruby-2.0.0-p195/gems/rake-10.1.1/lib/rake/rake_module.rb:25:in
`load_rakefile'
/Users/AM/.rvm/gems/ruby-2.0.0-p195/gems/rake-10.1.1/lib/rake/application.rb:637:in
`raw_load_rakefile'
/Users/AM/.rvm/gems/ruby-2.0.0-p195/gems/rake-10.1.1/lib/rake/application.rb:94:in
`block in load_rakefile'
/Users/AM/.rvm/gems/ruby-2.0.0-p195/gems/rake-10.1.1/lib/rake/application.rb:165:in
`standard_exception_handling'
/Users/AM/.rvm/gems/ruby-2.0.0-p195/gems/rake-10.1.1/lib/rake/application.rb:93:in
`load_rakefile'
/Users/AM/.rvm/gems/ruby-2.0.0-p195/gems/rake-10.1.1/lib/rake/application.rb:77:in
`block in run'
/Users/AM/.rvm/gems/ruby-2.0.0-p195/gems/rake-10.1.1/lib/rake/application.rb:165:in
`standard_exception_handling'
/Users/AM/.rvm/gems/ruby-2.0.0-p195/gems/rake-10.1.1/lib/rake/application.rb:75:in
`run'
/Users/AM/.rvm/gems/ruby-2.0.0-p195/gems/rake-10.1.1/bin/rake:33:in `<top (required)>'
/Users/AM/.rvm/gems/ruby-2.0.0-p195/bin/rake:23:in `load'
/Users/AM/.rvm/gems/ruby-2.0.0-p195/bin/rake:23:in `<main>'
/Users/AM/.rvm/gems/ruby-2.0.0-p195/bin/ruby_noexec_wrapper:14:in `eval'
/Users/AM/.rvm/gems/ruby-2.0.0-p195/bin/ruby_noexec_wrapper:14:in `<main>'
7)我的理解是,MySql已安裝並運行,但不知何故rails應用程序找不到它:所以我做了「echo $ PATH」
/Users/AM/.rvm/gems/ruby-2.0.0-p195/bin:/Users/AM/.rvm/gems/ruby-2.0.0-
[email protected]/bin:/Users/AM/.rvm/rubies/ruby-2.0.0-
p195/bin:/Users/AM/.rvm/bin:/usr/local/bin:/usr/local/sbin:
~/bin:/usr/bin:/bin:/usr/sbin:/sbin:/usr/local/bin:/opt/X11/bin
8),那麼我想找個地方MySQL的安裝,所以我去了: CD的/ usr /本地/ LS -la
我看到這一點:現在
drwxrwxr-x 21 root admin 714 11 Jan 08:25 .
[email protected] 13 root wheel 442 1 Jun 2013 ..
drwxr-xr-x 14 AM admin 476 11 Jan 08:25 .git
-rw-r--r-- 1 AM admin 213 20 May 2013 .gitignore
-rw-r--r-- 1 AM admin 592 11 Jan 08:25 CONTRIBUTING.md
drwxr-xr-x 22 AM admin 748 11 Jan 08:32 Cellar
drwxr-xr-x 10 AM admin 340 11 Jan 08:25 Library
-rw-r--r-- 1 AM admin 1240 11 Jan 08:25 README.md
-rw-r--r-- 1 AM admin 23510 11 Jan 08:25 SUPPORTERS.md
drwxr-xr-x 79 AM admin 2686 11 Jan 08:33 bin
drwxr-xr-x 6 AM admin 204 11 Jan 08:33 etc
drwxr-xr-x 6 AM admin 204 2 Jun 2013 foreman
drwxr-xr-x 7 AM admin 238 2 Jun 2013 heroku
drwxr-xr-x 46 AM admin 1564 29 Aug 15:21 include
drwxr-xr-x 50 AM admin 1700 29 Aug 15:21 lib
drwxr-xr-x 5 root wheel 170 29 Mar 2013 man
lrwxr-xr-x 1 root wheel 27 17 Sep 15:47 mysql -> mysql-5.6.13-osx10.7-x86_64
drwxr-xr-x 17 root wheel 578 17 Sep 15:47 mysql-5.6.13-osx10.7-x86_64
drwxr-xr-x 22 AM admin 748 11 Jan 08:33 opt
drwxr-xr-x 17 AM admin 578 29 Aug 15:21 share
drwx------ 6 AM admin 204 11 Jan 08:33 var
所以我覺得我幾乎在那裏,但需要最後幾個步驟來使這個應用程序的工作。有人能幫我弄清楚接下來要做什麼嗎?
感謝
我在哪裏輸入此命令?是否有更持久的解決方案,以便我不必每次都繼續運行腳本。像我可以設置這個地方,以便它保持?感謝 – banditKing
只是複製到終端。命令在兩條路徑之間創建符號鏈接 –
感謝您的幫助 – banditKing