In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-01-19 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Servers >
Share
Shulou(Shulou.com)06/01 Report--
This article introduces the knowledge of "how to install rugged library based on libgit2 library in rails environment". In the operation of actual cases, many people will encounter such a dilemma, so let the editor lead you to learn how to deal with these situations. I hope you can read it carefully and be able to achieve something!
Since the grit library running the operation git in gitlab is no longer updated and maintained, it is necessary to update the grit in gitlab to rugged, and various problems are encountered. With the help of my colleagues. Finally solved, again, thanks all. Record the update process below.
Current status: Ubuntu 14.04, ruby 1.9.3, rails 3.2.4, gitlab 5.056
Updates: ruby 2.1.3, gitlab5.*, grit 0.2.6, ruggged 0.21.0, gitlib_git 6.2.0, libgit 0.21.0
Steps:
1) Update the ruby version
A) use rvm for version management
$> rvm install 2.1.3
B) set to the default version
$> rvm use 2.1.3-default
2) update gem. (assume the rails project directory is / web/pro/gitlab)
$/ web/gitlab > bundle install
3) update gitlab_git, because gitlab already has gitlab_git code in gitlab/lib/gitlab/git, but because it is used in grit library, it needs to be replaced by rugged. In the latest gitlab_git 6.2.0, grit has been replaced with rugged, and the gitlab_git code has been cloned from github below.
A) Clone the gitlab_git code
$> git clone git@github.com:gitlabhq/gitlab_git.git / web/gitlab_git$ > cd / web/gitlab_git$ / web/gitlab_git > git checkout v6.2.0 # switch to version v6.2.0
B) Update the gitlab_git code
$> cp / web/gitlab/lib/git/gitlab/git / web/gitlab/lib/git/gitlab/git.old # backup $> cp / web/gitlab_git/lib/gitlab_git-Rf / web/gitlab/lib/git/gitlab/git # assign and rename
4) install libgit2, because libgit is called in the rugged code, so you need to install libgit2.
A) Clone libgit2
$> git clone git@github.com:libgit2/libgit2.git / web/libgit2 $> cd / web/libgit2 $/ web/libgit2 > git checkout v0.21.5 or $> wget https://github.com/libgit2/libgit2/archive/v0.21.5.zip$> unzip v0.21.5.zip
B) compile and install into / usr/local
$> cd / web/libgit2 $/ web/libgit2 > mkdir build & & cd build$ / web/libgit2 > cmake. -DCMAKE_BUILD_TYPE=Release$ / web/libgit2 > make & & sudo make install
5) install the rugged version in the system
Gem install rugged-use-system-libraries-v 0.21.4
(note: no such file or directory-getcwd will appear when executing the above command in zsh, and you need to switch to bash)
6) rugged in rails project
A) add gem and add the following in / web/gitlab/Gemfile
Gem 'rugged',' 0.21.4 percent, git: git@git.oschina.net:zouqilin/osc_rugged.git
B) install rugged
$/ web/gitlab > bundle config build.rugged-- use-system-libraries$ / web/gitlab > bundle install
C) check to see if the installation was successful
$/ web/gitlab > bundle list | grep rugged * rugged (0.21.4 xxxxx) = this output indicates that it has been installed
End: some errors occur due to unavoidable differences in the installation process. The error log of the rugged installation command bundle install is mainly in the gem_make.out and mkmf.log files in the ~ / .rvm/gems/ruby-2.1.4/bundler/gems/extensions/x86_64-linux/2.1.0/rugged-0fcb463a6c2a/ directory. By analyzing the error log, you can speculate the cause of the error and know how to solve the problem.
That's all for "how to install rugged libraries based on libgit2 libraries in a rails environment". Thank you for reading. If you want to know more about the industry, you can follow the website, the editor will output more high-quality practical articles for you!
Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.
Views: 0
*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.
Continue with the installation of the previous hadoop.First, install zookooper1. Decompress zookoope
"Every 5-10 years, there's a rare product, a really special, very unusual product that's the most un
© 2024 shulou.com SLNews company. All rights reserved.