TE
科技回声
首页24小时热榜最新最佳问答展示工作
GitHubTwitter
首页

科技回声

基于 Next.js 构建的科技新闻平台,提供全球科技新闻和讨论内容。

GitHubTwitter

首页

首页最新最佳问答展示工作

资源链接

HackerNews API原版 HackerNewsNext.js

© 2025 科技回声. 版权所有。

Get Ruby and Rails running on Ubuntu with one command

56 点作者 adamstac超过 14 年前

17 条评论

rm445超过 14 年前
Oblig. bash.org, <a href="http://www.bash.org/?464385" rel="nofollow">http://www.bash.org/?464385</a><p><pre><code> &#60;@insomnia&#62; it only takes three commands to install Gentoo &#60;@insomnia&#62; cfdisk /dev/hda &#38;&#38; mkfs.xfs /dev/hda1 &#38;&#38; mount /dev/hda1 /mnt/gentoo/ &#38;&#38; chroot /mnt/gentoo/ &#38;&#38; env-update &#38;&#38; . /etc/profile &#38;&#38; emerge sync &#38;&#38; cd /usr/portage &#38;&#38; scripts/bootsrap.sh &#38;&#38; emerge system &#38;&#38; emerge vim &#38;&#38; vi /etc/fstab &#38;&#38; emerge gentoo-dev-sources &#38;&#38; cd /usr/src/linux &#38;&#38; make menuconfig &#38;&#38; make install modules_install &#38;&#38; emerge gnome mozilla-firefox openoffice &#38;&#38; emerge grub &#38;&#38; cp /boot/grub/grub.conf.sample /boot/grub/grub.conf &#38;&#38; vi /boot/grub/grub.conf &#38;&#38; grub &#38;&#38; init 6 &#60;@insomnia&#62; that's the first one</code></pre>
评论 #2128383 未加载
telemachos超过 14 年前
This strikes me as no easier than rvm, but less clean (installations go to /usr/local, no easy way to switch between various ruby interpreters or gemsets, harder to uninstall, etc.).<p>Why not just do this?<p><pre><code> 1) Update whatever requirements you need via APT tool of choice. 2) Install rvm 3) Install ruby-1.9 using rvm 4) gem install rails 5) Write great rails app.</code></pre>
评论 #2129255 未加载
评论 #2128503 未加载
评论 #2128506 未加载
评论 #2128466 未加载
评论 #2129634 未加载
rmc超过 14 年前
That is many commands, but it's only one line.<p>And there's something in the inner-sysadmin in me that sees "curl <a href="http://example.com/foo.sh" rel="nofollow">http://example.com/foo.sh</a> &#38;&#38; ./foo.sh" and shudders. That sounds like a receipe for disaster.
评论 #2127916 未加载
评论 #2127898 未加载
评论 #2127915 未加载
wayneeseguin超过 14 年前
Here is a script that I wrote and have been using, should work on most Linux's and OSX to bootstrap a Rails Development environment. Also ensures that git is installed. You can run it with one command (after reading it's contents of course) as follows:<p>curl -O <a href="https://github.com/wayneeseguin/rvm/blob/master/contrib/bootstrap_rails_environment" rel="nofollow">https://github.com/wayneeseguin/rvm/blob/master/contrib/boot...</a> &#38;&#38; source bootstrap_rails_environment<p>This automates installing the prerequisites across many Linux package management types and then bootstraps a Rails development environment using RVM.
评论 #2129313 未加载
Dobbs超过 14 年前
Couldn't you just do:<p>wget <a href="https://github.com/joshfng/railsready/raw/master/railsready.sh" rel="nofollow">https://github.com/joshfng/railsready/raw/master/railsready....</a> &#38;&#38; bash ./railsready.sh<p>Besides the "1" command is really 4.<p>If you are setting up enough VM's that you need this you should have something like puppet installed and don't need this. If you are setting up one machine then do it by hand. Know the tools you have installed and keep track of them it will make deployment easier.
评论 #2127912 未加载
评论 #2130176 未加载
mattyb超过 14 年前
Some comments &#38; questions from someone who's worked on something similar:<p>-What's extglob used here for? I don't see any regexes.<p>-What are libffi-dev and libyaml-dev for? I assume some common gems depend on them. If so, which? (I'm just getting into Rails.)<p>-Git in the Maverick repos is old (1.7.1, which was released in April). Installing it from source is probably a better idea.<p>-You should probably use RVM to install Ruby, since its 1.9.2-head target won't require you to keep updating your script with 1.9.2's patchlevel.<p>-In my rails3.sh (which I should really publish), I didn't need to `gem install bundler` in order for `bundle install` to work. Probably because `rails` depends on `bundler`.<p>-That sudo check is neat, and I'd like to lift it; what's this script's license?
评论 #2128363 未加载
calvin超过 14 年前
Note to the wise: do not run this on a production machine unless you understand the full consequences of what the script is doing.<p>This is great for starting out a new machine and getting things setup, but running the update and upgrade commands without consideration of what's being updated could cause a lot of headaches if any existing sites running on the server have dependencies that are botched by the upgrade.
评论 #2128448 未加载
joshfng超过 14 年前
Just so you guys know this script has changed a lot since I opened it up. It now has way better output formatting, the option to install Ruby from source or RVM, better stdout and stderr redirection to the install.log and even captures signals for things like ctrl-c to kill the script nicely. Thanks for all the input and I hope it's found to be useful :)
joshfng超过 14 年前
This also installs git, I updated the readme. It's a very simple script so if you guys see any ways to improve it let me know.
评论 #2127979 未加载
DanI-S超过 14 年前
Nice! It'd be nicer if it used RVM, though. Might try rolling my own.<p>If anyone else wants to try, or is otherwise interested, I wrote a step-by-step guide to getting Rails on Ubuntu with RVM: <a href="http://news.ycombinator.com/item?id=2113525" rel="nofollow">http://news.ycombinator.com/item?id=2113525</a>
评论 #2129624 未加载
vysogot超过 14 年前
If anyone is looking for a Debian Lenny config script (RVM, Apache, Passenger, SQLite), here it is: <a href="https://github.com/vysogot/railsready-debian-lenny" rel="nofollow">https://github.com/vysogot/railsready-debian-lenny</a><p>Debian has some differences.
fenderplayer超过 14 年前
I just ran the script on Ubuntu 10.10 (64bit) but when i run "rvm list" or any other rvm command i get the following error:<p>/usr/local/bin/rvm: line 73: /home/myuser/.rvm/scripts/rvm: No such file or directory<p>Whats wrong here?
评论 #2147004 未加载
jschuur超过 14 年前
Related and very recent: <a href="http://hivelogic.com/articles/setup-guide-rails-stack-with-passenger-rvm-bundler-apache-and-mysql-on-ubun" rel="nofollow">http://hivelogic.com/articles/setup-guide-rails-stack-with-p...</a>
joshfng超过 14 年前
Just a FYI I changed the script to install Ruby to /usr/local thanks to some input from a Github user. Also people are forking it and setting it up to install RVM so feel free to check those out as well!
评论 #2128417 未加载
joshfng超过 14 年前
I have updated the script to ask you if you want to build Ruby from source or install RVM (Wayne from RVM pointed me in the right direction)
thibaut_barrere超过 14 年前
I now prefer using chef-solo, which allows to tweak and add the remaining bits very quickly once you know how to use it!
jseifer超过 14 年前
Wish this was around a week ago when I did this all manually.
评论 #2128079 未加载