直播:Linux下试玩Heroku

2010-10-09 22:48:46 +08:00
 xinzhi
对heroku没太多兴趣,但看到V2EX有人正在折腾这个,我也随便看看。我不是程序猿,只是玩玩。

基本只是复制粘贴,遇到障碍即终止,不折腾了。如果顺利,那我将创建一个可以通过网络访问的heroku app。

系统环境:
Ubuntu 10.10(Linux)
Gnome Desktop + gnome-terminal

直播线(应该是这个地址吧):
http://v2ex.appspot.com/t/3218?f=1
10781 次点击
所在节点    Heroku
42 条回复
xinzhi
2010-10-09 23:50:23 +08:00
好吧,推倒重来,现在部署personlab到xinzhiblog这个app上:

xinzhi@xinzhi-laptop:~$ git clone git://github.com/huacnlee/personlab.git
Initialized empty Git repository in /home/xinzhi/personlab/.git/
remote: Counting objects: 3588, done.
remote: Compressing objects: 100% (2212/2212), done.
remote: Total 3588 (delta 1622), reused 2986 (delta 1233)
Receiving objects: 100% (3588/3588), 3.54 MiB | 50 KiB/s, done.
Resolving deltas: 100% (1622/1622), done.
xinzhi@xinzhi-laptop:~$ cd personlab
xinzhi@xinzhi-laptop:~/personlab$ heroku create --stack bamboo-ree-1.8.7 xinzhiblog
Creating xinzhiblog... done
Created http://xinzhiblog.heroku.com/ | git@heroku.com:xinzhiblog.git
Git remote heroku added
xinzhi@xinzhi-laptop:~/personlab$ heroku config:add HEROKU=true
Adding config vars:
HEROKU => true
Restarting app...done.
xinzhi@xinzhi-laptop:~/personlab$ git push heroku master
The authenticity of host 'heroku.com (75.101.163.44)' can't be established.
RSA key fingerprint is 8b:48:5e:67:0e:c9:16:47:32:f2:87:0c:1f:c8:60:ad.
Are you sure you want to continue connecting (yes/no)? yes
Warning: Permanently added 'heroku.com,75.101.163.44' (RSA) to the list of known hosts.
Counting objects: 3588, done.
Compressing objects: 100% (1823/1823), done.
Writing objects: 100% (3588/3588), 3.57 MiB | 51 KiB/s, done.
Total 3588 (delta 1622), reused 3588 (delta 1622)

-----> Heroku receiving push
-----> Rails app detected
-----> Detected use of caches_page
Installing caches_page_via_http plugin... done
-----> Detected Rails is not set to serve static_assets
Installing rails3_serve_static_assets... done

-----> Installing gem rails 2.3.5 from http://rubygems.org
Successfully installed activesupport-2.3.5
(此处省略一大堆服务器回馈信息)
disinfeqt
2010-10-09 23:50:36 +08:00
wth are you doing...
xinzhi
2010-10-09 23:50:58 +08:00
接着上面的末段信息:
Installing simple-rss (1.2.3)
Your bundle is complete! Use `bundle show [gemname]` to see where a bundled gem is installed.

Your bundle was installed to `.bundle/gems`
Compiled slug size is 14.0MB
-----> Launching.... done
http://xinzhiblog.heroku.com deployed to Heroku

To git@heroku.com:xinzhiblog.git
* [new branch] master -> master
xinzhi@xinzhi-laptop:~/personlab$
Feuda
2010-10-09 23:53:11 +08:00
@disinfeqt 标题所示
xinzhi
2010-10-09 23:54:44 +08:00
最后3步,是数据库相关操作。

xinzhi@xinzhi-laptop:~/personlab$ heroku rake db:create
DEPRECATION WARNING: railtie_name is deprecated and has no effect. (called from require at /usr/ruby1.8.7/lib/ruby/gems/1.8/gems/bundler-1.0.0/lib/bundler/runtime.rb:64)
DEPRECATION WARNING: Rake tasks in /disk1/home/slugs/313715_da72fc3_b7c2/mnt/vendor/plugins/captcha/tasks/generate.rake are deprecated. Use lib/tasks instead. (called from /disk1/home/slugs/313715_da72fc3_b7c2/mnt/Rakefile:7)
DEPRECATION WARNING: Rake tasks in /disk1/home/slugs/313715_da72fc3_b7c2/mnt/vendor/plugins/heroku_asset_cacher/tasks/heroku_asset_packager_tasks.rake are deprecated. Use lib/tasks instead. (called from /disk1/home/slugs/313715_da72fc3_b7c2/mnt/Rakefile:7)
imffcdufmx already exists
(in /disk1/home/slugs/313715_da72fc3_b7c2/mnt)
xinzhi@xinzhi-laptop:~/personlab$ heroku rake db:migrate
DEPRECATION WARNING: railtie_name is deprecated and has no effect. (called from require at /usr/ruby1.8.7/lib/ruby/gems/1.8/gems/bundler-1.0.0/lib/bundler/runtime.rb:64)
(省略输出)
/heroku_asset_packager_tasks.rake are deprecated. Use lib/tasks instead. (called from /disk1/home/slugs/313715_da72fc3_b7c2/mnt/Rakefile:7)
(in /disk1/home/slugs/313715_da72fc3_b7c2/mnt)
== CreatePosts: migrating ====================================================
-- create_table(:posts)
(省略输出)
========================================

xinzhi@xinzhi-laptop:~/personlab$ heroku rake db:seed
DEPRECATION WARNING: railtie_name is deprecated and has no effect. (called from require at /usr/ruby1.8.7/lib/ruby/gems/1.8/gems/bundler-1.0.0/lib/bundler/runtime.rb:64)
DEPRECATION WARNING: Rake tasks in /disk1/home/slugs/313715_da72fc3_b7c2
(省略输出)
Creating administrator, username:admin password:123123
Creating default menus
Creating default pages
Creating default categories
Creating sample post
xinzhi@xinzhi-laptop:~/personlab$

现在看来,我要做的事情完成了。
AntiGameZ
2010-10-09 23:55:40 +08:00
晕,好复杂,前段时间照着ruby on rails tutorial,在macbook上搞了一遍
xinzhi
2010-10-09 23:56:07 +08:00
OK,打完收工,Heroku app:personlab blog部署成功!

测试地址:

http://xinzhiblog.heroku.com/

好了。全部过程就在上面了。

查看时间线:
http://v2ex.appspot.com/t/3218?f=1
Feuda
2010-10-09 23:59:13 +08:00
@xinzhi ok,明天再问你,早点睡吧
huacnlee
2010-10-10 00:34:36 +08:00
其实整个过程可以简化很多
ssword
2010-10-10 00:36:00 +08:00
囧,没必要把控制台输出的都贴过来吧
chone
2010-10-10 00:54:00 +08:00
来晚了。。。。不过支持 @xinzhi
xinzhi
2010-10-10 01:07:42 +08:00
@Feuda
我可能没空。我也不清楚怎么帮你呢。我也是第一次尝试(也许就这一次了),并不懂这个的。

@huacnlee 嗯。第一次玩呢,我说过了,只是复制粘贴,不做太多思考,不折腾~

@ssword 这是个过程,过程就是这样。。。这是个直播帖,不是总结。开始的时候我也不保证成功的。顺便其他人也可以帮忙看看哪里出问题了,这样才能进行下去。

算我侥幸成功了吧。其实就是复制粘贴,任何人都可以。如你所见。
Feuda
2010-10-10 13:14:02 +08:00
@xinzhi 我就是想问问你昨晚最开始用什么运行这些的

xinzhi@xinzhi-laptop:~$ gem
程序“gem”已包含在下列软件包中:
* rubygems1.8
* rubygems1.9.1
请尝试:sudo apt-get install <选定的软件包>
xinzhi@xinzhi-laptop:~$ sudo apt-get install rubygems1.9.1
[sudo] password for xinzhi:
正在读取软件包列表... 完成
正在分析软件包的依赖关系树
正在读取状态信息... 完成
注意,选取 ruby1.9.1 而非 rubygems1.9.1

怎么会出现:xinzhi@xinzhi-laptop:~$ gem
程序“gem”已包含在下列软件包中:
* rubygems1.8 等等
fanix
2010-10-10 13:44:58 +08:00
我觉得heroku是最好部署的了,在mac环境下我居然一次把一个很大的rails站部署成功。估计linux也差不多了,heroku站方考虑的其实非常周到。
xinzhi
2010-10-10 13:50:08 +08:00
@Feuda

"
看到左侧有快速入门的教程,一看就知道是终端运行的命令行。所以第一步就是打开gnome-terminal命令终端。
"

命令终端
Feuda
2010-10-10 14:13:43 +08:00
@xinzhi 谢谢
samt
2010-10-12 13:19:09 +08:00
ok
kendisk
2010-10-30 17:32:53 +08:00
http://lazy.heroku.com/

这个可以有/。
Sunyanzi
2010-10-30 19:11:26 +08:00
lance
2010-11-24 14:58:01 +08:00
~0~

这是一个专为移动设备优化的页面(即为了让你能够在 Google 搜索结果里秒开这个页面),如果你希望参与 V2EX 社区的讨论,你可以继续到 V2EX 上打开本讨论主题的完整版本。

https://www.v2ex.com/t/3218

V2EX 是创意工作者们的社区,是一个分享自己正在做的有趣事物、交流想法,可以遇见新朋友甚至新机会的地方。

V2EX is a community of developers, designers and creative people.

© 2021 V2EX