This is the starting point for getting help on any issue relating to working with the dev.to open source project. This thread will act as an FAQ de...
For further actions, you may consider blocking this person and/or reporting abuse
I have similar issue running
bundle install
only have Ruby 2.5.1 installed.
I have tried restarting terminal and machine both just to clear cache if there's any.
Did you set 2.5.1 as the global version?
According to karloespiritu.github.io/cheatsheet... you need to type:
rbenv global 2.5.1
, otherwise it uses the default version shipped with the OSThanks for the cheatsheet. Yes, I have tried rbenv global 2.5.1.
When you are in the directory of the project, what does
rbenv version
say?I feel like something is messed up with the
/etc/paths/
although can't seem to figure it out. I am following this link here-: stackoverflow.com/questions/873067...What's the output of
ruby -v
compared torbenv version
?Try running
rbenv shell 2.5.1
and then runningbundle
.If not, a reinstall of
2.5.1
might help:Let me know how it goes!
Thanks Andy. I did a reinstall of rbenv and ran below.
❯ ruby -v
ruby 2.5.1p57 (2018-03-29 revision 63029) [x86_64-darwin15]
❯ rbenv version
2.5.1 (set by RBENV_VERSION environment variable)
❯ rbenv shell 2.5.1
still see the same issue.
❯ bundle install
Your Ruby version is 2.0.0, but your Gemfile specified 2.5.1
Ah, your
bundle install
might be running from your old Ruby version as opposed to the latest one.Try running
which gem
andwhich bundle
. You should be seeing something similar to this output:If it's different, you'll probably see that
bundle
orgem
are running from different paths thanruby
.That did it. Thanks for the tip.
gem and ruby paths were same but bundle. I updated the PATH for bundle gem file using BUNDLE_GEMFILE
Awesome! Glad to know it worked. From my experience, it's "cleaner" to reinstall your gems per version, but I'm not too sure if it matters too much.
Hey, I am currently working on some night mode bugs and my work mainly works on editing scss/css files,
nevertheless I want to run a local setup of the application in an attempt to check the changes I am making.
I am having the same error as above only that dev.to required ruby version
2.6.1
but it seems to be picking up2.3.7
from my system macOSI have followed all the steps but to no use, I have little to no experience in ruby. could use your help in the same.
I don't have a ton of ruby experience so I actually ran into what I thought was a problem installing ruby with
rbenv
. I just wanted to share my experience here in case others run into the same issue.I started by installing
rbenv
with homebrew.No issues, cool. Then I went to install the current ruby version of 2.6.1 in rbenv but it kept hanging on the following line.
I kept canceling out of it thinking it was stuck but it was actually building in the background. The installer could use some work giving users some sort of visual feedback that it's actually building. I looked it up and stumbled on to a GitHub issue about it: github.com/rbenv/ruby-build/issues...
One of the comments mentioned that you can actually use the
install -v
flag when installing with rbenv to get a verbose output of the build process in your terminal. I then ran the following:And no more hanging on readline! It will fill your terminal window with build logs but at least you know it's working.
Hope this helps someone!
Great tip, thanks!
Here's something I ran into as I'm going through the setup instructions, in case anyone else has the same problem.
When I did
gem install bundler
, I got this error message:It might have occurred because I uninstalled rvm (using rvm implode ) after installing rbenv.
The fix (found here ) was to add
eval "$(rbenv init -)"
to my .bash_profile (then dosource ~/.bash_profile
). After thatgem install bundler
worked.Awesome, thanks for sharing!
I found the solution in this site
usabilityetc.com/articles/ruby-on-...
I can't explain how helpful this is. You saved me from a great amount of trouble. Thank you!
Hey Tristan, definitely not a stupid question :)
It's probably a bit early to realistically stand up a fully self-hosted instance of DEV.
If your company is sharing technical content that is for public consumption, you're welcome to set up an organization account on the production site. You can look at Heroku as an example. You never know what might help other users.
@ben will follow up with a bit more info and context.
Yeah, org accounts are the recommended way to go right now, but the instance direction is something we could start working on right away, as long as we’re willing to be patient along the way.
So that area has to be thought of as really theoretical at this point, but being an early adopter of that path could be very powerful, so you are welcome to volunteer to become part of our early group who might start thinking about that use case. Let me know if you’d like me to keep you in the loop.
Does anyone know how to update the built-in version of ruby on Mac?
I ended up getting around it by using RubyMine and telling it to use the brew version for the dev.to environment, and then I set up the bin scripts as run configurations.
Since I had ruby 2.5.1 installed, I wasn't terribly inclined to download RVM just so it could download its own version of ruby, too. I just don't think this was the most optimal way of fixing my version issues.
(And as someone who never used postgressql before, that part was not intuative at all... but I have no clue how to fix that in the docs, since I was bumbling my way through it)
I use RVM because I have different projects using different versions of Ruby and it's useful for that:
Can you please articulate what issues did you have? I think it's very important because a difficult onboarding can be a turn off for first contributors. Thank you!
My issue was trying to figure out how to articulate it late at night ;)
I think the issues started with completely blowing past the hey you need to install this stuff first section of the README and just starting to get the local build working with stuff like api keys and bundle install. And since I was having issues with the ruby version, I was inclined to think all my issues were around ruby rather than the db.
The biggest thing after needing it installed was needing to have it run before running anything. The installation was lumped with installing things like bundle and yarn which are more hands-off, so it wasn't clear that after installing the prereqs, I should actually start the db and that it wasn't handled in the bin scripts like everything else.
Then I wanted to actually see what was in the db, so I hunted through the configs and internet to see how to find the settings of the db that's created to connect to it within RubyMine.
It wasn't anything really hard or missing, just stuff that wasn't obvious as someone not in the stack.
Ah gotcha, we'll shore that up for the next iteration. What sort of issues are you having right now with it?
Are you using a Ruby version manager? You probably have
rbenv
orrvm
installed.As far as I know, I have not because I'm not a Rubyish person, but I can check once I get home. I knew I brew installed it and would have installed it way back when for brew (since I'm pretty sure brew runs on ruby) but otherwise I don't recall ever doing anything with ruby.
Right now, nothing, since I was eventually able to get local dev.to up and running to get my screenshots for my PR :) Originally, though, since I was only installing it to use dev.to, I didn't:
Like, reading the section of hey install this stuff didn't really click with me to actually run the database and that it was not a part of the bin scripts.
Ah gotcha, sorry that wasn't clear! We'll definitely update the instructions for the prerequisites.
And yep, let me know if you still have issues with your Ruby, or anything else really. 🙂
I'm getting the following error when running
bin/setup
:But I already added the Algolia keys to
config/application.yml
:It seems like the ENV variables aren't being set, despite changing
application.yml
. I'm not sure what I'm missing.Hm that's strange. Try these two things:
config/application.yml
and notsample_application.yml
.spring
error, which is a Rails app preloader. If spring is running, it'll runbin
commands for you, but sometimes doesn't refresh when you change things like environment variables. Try turning it off withspring stop
and then runningbin/setup
again.Spring wasn't actually running, but I figured out what the issue was.
When I ran
git status
, it seemed like I accidentally made some changes toconfig/application.rb
. I undid those changes and nowbin/setup
works.Thanks for trying to help though!
Great! Glad it's resolved :)
Hello everyone!
I'm trying to write specs for login/signup procedure.
I've inspected the code and came out with these potential scenarios.
Can someone help me to correct, validate, refine these scenarios to met the reality?
(I follow the format ---> )
1 User never login before
create new user
create new identity
update user data
create session
go to welcome page
2 User second login with same provider
find existing user
find existing identity
update user data
create session
go to dashboard
3 User second login with other provider
find existing user
create new identity
update user data
create session
go to dashboard
4 User revoked authorization on twitter, login and re-authorizes
find existing user
find existing identity
update user data
create session
go to dashboard
Error cases ——
5 Twitter doesn’t provide enough information for the user (let’s say uid is nil)
don't create session
go to back to same page
display error message
Twitter authorization problem. Try again later
Yep, that sounds right. We have a feature test for Twitter auth
/spec/features/user_logs_in_with_twitter_spec.rb
and some other tests for registration inspec/models/user_spec.rb#270
. Those should be helpful for see what else would need coverage.Awesome thanks I'll take a look.
@ben ^ ?
That seems like the right path. @andy can provide more thoughts
Hello! I was successfully able to run
bin/setup
andbin/startup
does work and spin up the server, but when I go to the localhost port it tells me, I get aCannot GET /
error. All routes seem to be doing this. Anyone had this problem before? Do I need to input any keys above and beyond the Algolia ones to get the base site to work?Hmm, not sure what that's about. Do you have another server that's connected to
localhost:3000
? Although if you do, you wouldn't have been able to start up the server.Could you drop a screenshot of the browser on
localhost:3000
and maybe a snippet of the server logs?OH I think I know what it is. You might have went to
localhost:3035
which is running Webpack. It might not be exactly 3035, but it's something similar and is notlocalhost:3000
.localhost:3000
is the port for the backend Rails server, which is the one you want to visit.Also, now that I've got it set up, props to whoever on your team likes this book:
oh wait, there we go! I think I did have something else running on 3000—not surprising, since I am always running like five development servers, but I should have double-checked that port was open. Thanks!
When running
bin/setup
I get the following error:Not sure what to do from here.
Hey Jibran, looks like you have some error with Algolia. You'll need Algolia API keys in order to run the local server on your machine. See our guide here on how to get it: docs.dev.to/get-api-keys-dev-env/
Hey Andy,
Got it to work. Silly setup error on my part. Thanks!
Gotcha :) Glad it's working!
Hello,
Trying to setup locally on my machine but running into an error after running
bin/setup
Has anyone else come across this before as finding it tricky to debug?
The console also throws this error at end of log
So seems like db issues.. is there anything specific I need to do to set this up? I've just been following the installation steps where it only mentions to have postgresql 9.4 or higher (which I have)
Thanks for any help in advance!
Oh that's a strange error. I can't seem to reproduce it, but I think it might be something with the
profile_image_url
we're using. It's currently randomly generated by a gem, but feel free to replace it with any other valid image. The only non-standard validation we have for images is that its dimensions have to be less than or equal to 4096x4096.You can replace line #31 in the
seeds.rb
file with any URL you'd like:Faker::Fillmurray docs here, if you're so inclined. 😇
Thank you!
Yes that was it, I've now been able to get running using my own profile pic. As happy as I am that it's working now am quite sad I've not been able to use the Bill Murray Faker... 😂
For info I was getting a 'redirect' error
...which seemed like it was expecting
https
in the url, but I couldn't find an easy way to resolve this.But all good with a non-Faker url for the profile image 👍
Awesome, glad it worked! Unfortunate about Bill Murray 🙃
I am getting following error I am not sure what is issue with
bcrypt
BCrypt::Errors::InvalidHash in OmniauthCallbacksController#github
Hey, when are you hitting this error? We'll need some more context to help you debug. I'm guessing you tried signing in? If you're doing any sign in process, you'll need to setup the appropriate APIs. Instructions here: docs.dev.to/get-api-keys-dev-env/#...
Hi Andy,
I did all the setup required by the docs and still got this error and there is a GitHub issue[1] and same error while populating the database with the initial seeds
bin/setup
got this errorBCrypt::Errors::InvalidHash: invalid hash
[1] github.com/codahale/bcrypt-ruby/is...
We'll be here for any and all random problems folks run into.
Hi,
I have recently been learning python, HTML5 CSS3 and now Javascript for the past 3 months, and so I am quite new to all of this, but I am incredibly driven and passionate about growing and learning new things and more.
I am also new to the community scene, therefore I was hoping someone could help me learn how I can contribute and get to know others who I can work alongside and grow with.
Thanks,
I've got it running but I get a 401 unauthorized when I try to log in (using the Twitter button).
I'm looking to play around with editing posts and comments to look into the stale post/comment issue I've run into (maybe the same as #526, though I haven't had it give me a 404 ), which might require looking into caching stuff.
Hmm, did you set up your Twitter OAuth app? Guide here: docs.dev.to/get-api-keys-dev-env/#...
Thanks, I must have skipped that one. I'm now waiting to hear back from Twitter about my applicaiton for an API account.
Oh hmm that must be new. If you'd rather, you can make a GitHub OAuth app instead. For sign in purposes they're the same.
Hey @ben , it's my first time contribution to any open source project. I am trying to setup the project on my machine (rails version 5.2.1) but schema migrations are causing some trouble. Here take a look:
Hey @mirza, that's a current bug with the migrations since our older migrations are not forward-compatible right now. Since you're setting up for the first time, we recommend using
bin/setup
to setup your database from scratch. If you've setup your database already withrails db:create
orrake db:create
(same command), you'll need to drop it first withrails db:drop
before runningbin/setup
.i followed your suggestion and its now working. thanks mate! any advise for a rookie OSS contributor?
Glad it works! You can check out our issues page and work on any issues with the approved label. There should be enough context in the issue or the comments to get started. Any issues with "good first issue" is also a good start.
For OSS in general, I personally don't have much advice but that's how repo works. We try to adhere to similar standards that the OSS community has, and any feedback along the way will certainly be heard!
Is anyone else having problems when running the whole suite of tests?
Yeah, this seems to be an issue for me, too. I wrote a post about it: dev.to/andy/ruby-segmentation-faul...
I didn't think it was anything since I was the only person on our team who could reproduce it for a while. I've also been using our CI as a workaround since that seems to pass properly.
I don't think it's hardware related, but my specs are macOS 10.13.5 on a Macbook Air with a 1.6 GHz i5 and 8 GB 1600 MHz DDR3 RAM.
Trying github auth with gitpod and failing 😕
https://gitpod-url.gitpod.io/?error=redirect_uri_mismatch&error_description=The+redirect_uri+MUST+match+the+registered+callback+URL+for+this+application.&error_uri=https%3A%2F%2Fdeveloper.github.com%2Fapps%2Fmanaging-oauth-apps%2Ftroubleshooting-authorization-request-errors%2F%23redirect-uri-mismatch&state=[REDACTED]
Any help would be awesome :)
Hey Samarth! To get GitHub auth working, you can follow this guide:
docs.dev.to/backend/auth-github/
The one thing you might need to change is the authorization callback URL in your GitHub OAuth app. I'm not sure how it would work with GitPod though; maybe try matching it to whatever GitPod URL you instead of
localhost:3000
?Hey, im trying to contribute to issue #3091
Rate limiting new posts for users #3091
Is your feature request related to a problem? Please describe. I occasionally find my feed clogged with posts that I guess are bots? Or users trying to push users off site.
Describe the solution you'd like Rate limit users posts per hour. Perhaps loosen limits for people who have old enough accounts and/or enough post interactions.
Describe alternatives you've considered Creating a bot to filter out any similarly titled articles?
Additional context Example of my latest feed:
Examples of users who have been created today and have posted 15+ posts each within the last 40 minutes:
Im new to ruby/rails & this codebase and having a couple of issues with identifying the correct place to add new features.
Where I am up to:
I have rate limiting working and it will save a users post instead of publishing it. I am trying to inform the user of this by appending a message in the front end based upon a flag on the Article. Similar to the flag used when informing the user of a saved post (eg. Article.published). but I cannot figure out how to add this parameter to the Article object.
Thanks for any help.
Hey George, thanks for working on this. I'm not completely clear on what you mean by "appending a message in the front end based upon a flag on the Article." In my head, you mean the following:
I think it would make more sense to add error messaging that prevents a user from publishing, and the user will still have click "save draft" instead.
I had this, although it was recommended against in the pull request. Although it seems there were more issues there.
Trying to setup the project for the first time and i keep getting this error when i run bin/setup.
Any help will be greatly appreciated thanks.
@zhao-andy
Hmm, do you have your environment variables set up properly, with the correct syntax? Your
application.yml
should look like this:Make sure you're using double quotes for the values, and that your keys have no quotes. There should also only be a colon and space in between the two.
Thanks that worked
Long-time reader, first-time poster (on this thread!)
Can anyone help me to understand what the roadmap / design goal / plan is around the external API?
I'm seeing a bunch of specs, some of which explicitly live under /api/v0 and others of which just seem to be available at the root level unversioned. Some of them seem to overlap (github_repos_spec). Some objects like User seem to be "needed" or no-brainer entities on an external API, but are at the top level and unversioned. I'm not really seeing any documentation on this at the moment.
Also, are there any thoughts about adopting or conforming to e.g. OpenAPI or other standard specifications?
In general: big fan of APIs; want to help, advise, contribute; but at the moment I'm fairly confused about what I'm seeing in the codebase and in a few scattered posts where devs have used the current early v0. Would love to understand more about the goals and design intent here!
I was running into an error around gem install pg after bundle install ran for a while.
I followed the instructions here to fix it
I also ran into an issue during
bundle install
wherepg
failed to install.I went with the recommended quick install method for PostgreSQL and just installed the macOS app. It looks like this unfortunately causes an issue in
bundle install
where it can't find thepg_config
file. I tried to follow the instructions in the referenced blog post above but some of the commands are actually written/formatted incorrectly. I was able to find thepg_config
file within the app package though.Once I found that, I ran the following command to get
pg
installed.Then I was able to rerun
bundle install
and it completed successfully.@ben How can I make myself an admin? Is there any separate area for admins?
For development, you can add yourself as admin via CLI.
bin/rails console
Thanks for the quick reply. I'm thinking of moving my discourse forum to dev.to hosted site.
Can you let me know what are the minimum requirements to host dev.to instance?
I've around 19K users and 20000+ Posts on my discourse forum.
Ah gotcha. Someone else in this thread asked this question, so I'll link that thread, which includes @ben and @peter 's responses: dev.to/tristan957/comment/4j6g
It's not relevant to my question. It's not related to programming its something about a community of founders which is based on discourse.
So I wanted to know the basic requirements to run dev.to hosted environment.
Thanks.
@andy @ben can you guys pls reply on this?
Hi guys,
When i tried to run bin/setup, it throws this error
I tried to Google but since I have no exp with Ruby so i am kinda clueless.
Thank you
Hey Khang, sorry just seeing this now. A few questions:
rbenv global
should give you a Ruby version.ruby -v
to find out. This should match the version given withrbenv global
Hey, I'm looking to start work on
Allow pinning of GitHub organisation projects #243
GitHub Organisation Projects
It would be great if you could pin a GitHub repo from one of your organisations, as well as your personal repositories e.g. I'd like to be able to pin this project on my profile
I wouldn't say this is a particularly simple first Rails issue but since it's yours I think you have the other insight to make it happen.
Basically in the controller we have this defined:
Octokit is the GitHub Ruby wrapper. It's been around a long time and is well-supported.
From here with
@client
, we currently call an octokit method to look up repos to display in the settings area.I imagine to add the org repos, it'll be a matter of finding out what octokit has for that. Maybe they have a flattened way of finding all the repos, but I imagine it could be about sort of traveling up and down the object tree to get them. Hopefully it can be done efficiently.
Good luck, we can help with any bumps!
I have an issue running
bin/startup
Hey Hugo, what's the full error message you're getting?
Thanks for answer quickly. It was my mistake, I forgot to install foreman
Gotcha, glad you resolved it :)
Perhaps you don’t have your environment variables/keys set up?
Hey guys. Does fixing a typo count as a contribution? :)
Yeah, based on the URL endpoint you provided it looks like you are missing Stream API keys. See our docs for more info:
docs.dev.to/get-api-keys-dev-env/#...
Have you given any (and I mean any) thought to using Dart in the future? Whether via AngularDart for the frontend or Dart on the backend?
What about Flutter for Android and iOS apps?
I've played around with Flutter. I don't think it necessarily fits our use cases today, but I am all for keeping an eye on Flutter and Dart as choices for new things in the future. (And possibly for our current native app story, but need to be convinced)
1.) Could we create a separate CONTRIBUTING.md file for "How to Contribute" guidelines?
Yeah, I think that makes sense.
Can I start to assist in this project by helping with items to do with the Roadmap? I see it's pretty scant and I used to do PM work along time ago and while it's not exactly relevant here, I may be able to afford more time to it than is being done now.
Thoughts?
Hi all. Is there any way to hide specific tags from feed? dev.to has "my tags" section, but i don't understand its purpose.
Hey @ben Will you get a notification when i mention you?
Hey @gradi , sorry about that. Just seeing your message now. Tags help you build your feed, and the feed provides posts based on the tags and people you follow.
We currently don't have a way to hide specific tags from a feed. It's something that's been suggested before by other people. Feel free to add any additional thoughts in this issue: github.com/thepracticaldev/dev.to/...
I’m working on the issue below. What’s the best way to better understand how the RSS publishing feature works?
Improve documentation of RSS cross-publication feature #321
Hi! Thanks for the RSS cross-publish feature. Just had a suggestion related to its documentation in the website.
Feature Request or Task
User Story / Description
As a user wanting to cross-publish on DEV, I would like to have a description of how a draft is created from an RSS item so that I can decide whether my feed is correctly formatted for cross-publication.
Definition of Done
Additional Info (device/browser, helpful links)
From Twitter discussion with DEV:
Can i make my own dev.to community
How to make yourself an administrator?
In
rails console
you can run:Whatcha working on? More context means I can offer more help. :)
Hey guy MacOS and Ubuntu on digital ocean found this same problem
Hey Kris, not sure where you ran into that error. Could you provide some more details about the issue?
From a basic check, it looks like you're running into an issue with our ENV variable checker gem
envied
. Yourapplication.yml
should have key value pairs where the key is all capitals with no quotes and the value should have quotes, like so:Hi,
Can i contribute using Microsoft Windows?
Definitely! Check out our installation guide and docs in general: docs.dev.to/installation/windows/
Hi,
I would like to know the production release for dev.to. How is the production release cycle like?
Hey there, we use Travis as our CI. Someone makes a pull request, it runs through tests, and after a variety of checks (Travis test suite passes, CodeClimate looks okay) and a review, we merge it. Once merged to the master branch, it goes through the CI once again and if it passes, it deploys.